1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- const util = require("../../utils/util");
- Component({
- properties: {
- showType:{
- type:Boolean,
- value:false,
- observer:function(newVal){
- this.setData({showType:newVal})
- }
- },
- aid:{
- type:String,
- observer:function(newVal){
- this.setData({aid:newVal})
- this.getGoodstext();
- this.getGoodsList();
- }
- },
- },
- data: {
- dataList:{},
- content:{},
- aid:'',
- showType:false,
- },
- methods: {
- getGoodstext(){
- let that=this;
- util.getGoodstext(this.data.aid).then(res=>{
- let data=res;
- data.provide = data.provide.replace(/section/g, "div");
- data.provide = data.provide.replace(/<img/g, "<img style='max-width:100%'");
-
- data.userProvided = data.userProvided.replace(/section/g, "div");
- data.userProvided = data.userProvided.replace(/<img/g, "<img style='max-width:100%'");
- that.setData({content:data})
- })
- },
- getGoodsList(){
- let that=this;
- util.getGoodsList(this.data.aid).then(res=>{
- res.forEach(el => {
- el.logo=el.logo.replace('@!logo','')
- });
- that.setData({dataList:res})
- })
- }
- }
- })
|