|
@@ -1,10 +1,15 @@
|
|
|
// pages/user/user.js
|
|
|
-const {getOrder} = require("../../API/appraise")
|
|
|
+const {getOrder,getUserAllGoods} = require("../../API/appraise")
|
|
|
var getOrderOption = {
|
|
|
data: {
|
|
|
id: wx.getStorageSync('uid'),
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+var getUserAllGoodsOption = {
|
|
|
+ id:wx.getStorageSync('uid'),
|
|
|
+}
|
|
|
+
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -14,14 +19,49 @@ Page({
|
|
|
avatarUrl:"https://img.js.design/assets/smartFill/img313164da746310.jpg",
|
|
|
nickName:"Username",
|
|
|
userWxID:"UserWxID",
|
|
|
- personalSignatrue:"编辑个性签名,展示我的独特态度"
|
|
|
+ personalSignatrue:"编辑个性签名,展示我的独特态度",
|
|
|
+ soldGoodsPic1:'',
|
|
|
+ soldGoodsPic2:'',
|
|
|
+ soldGoodsPic3:'',
|
|
|
+ unsoldGoodsPic1:'',
|
|
|
+ unsoldGoodsPic2:'',
|
|
|
+ unsoldGoodsPic3:'',
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
+ let soldPic = [];
|
|
|
+ let unsoldPic = [];
|
|
|
+ getUserAllGoods(getUserAllGoodsOption).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ const Pic = res.data.data;
|
|
|
+ console.log(Pic);
|
|
|
+ let cnt = 0;
|
|
|
+ for(let i = Pic.length-1;i>=0;i--)
|
|
|
+ {
|
|
|
+ if(cnt == 6){
|
|
|
+ break;
|
|
|
+ }else{
|
|
|
+ if(Pic[i].State === 0){
|
|
|
+ soldPic.push(Pic[i].Pic);
|
|
|
+ cnt++;
|
|
|
+ }else if(Pic[i].State === 2){
|
|
|
+ unsoldPic.push(Pic[i].Pic);
|
|
|
+ cnt++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ soldGoodsPic1:soldPic[0],
|
|
|
+ soldGoodsPic2:soldPic[1],
|
|
|
+ soldGoodsPic3:soldPic[2],
|
|
|
+ unsoldGoodsPic1:unsoldPic[0],
|
|
|
+ unsoldGoodsPic2:unsoldPic[1],
|
|
|
+ unsoldGoodsPic3:unsoldPic[2],
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -38,7 +78,7 @@ Page({
|
|
|
this.setData({
|
|
|
avatarUrl: wx.getStorageSync('avatarUrl'),
|
|
|
nickName: wx.getStorageSync('nickName'),
|
|
|
- personalSignatrue: wx.getStorageSync('personalSignatrue'),
|
|
|
+ personalSignatrue: wx.getStorageSync('personalSignatrue')
|
|
|
})
|
|
|
},
|
|
|
|