finish update

This commit is contained in:
英树 2020-06-11 15:06:19 +08:00
parent cee8715f8e
commit c582bc1ad6
9 changed files with 320 additions and 263 deletions

View File

@ -1,17 +1,17 @@
//拓展Format函数以获取时间
Date.prototype.Format = function(fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
Date.prototype.Format = function (fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
// 云函数入口文件
@ -23,14 +23,14 @@ const db = cloud.database()
//新建商品返回新商品id
var addProduct = async (event) => {
//add成功就返回id 失败就可以catch到
var res = await db.collection("sM_productInfo").add({
var res = await db.collection("sM_productInfo").add({
data: {
userName:event.userInfos.userName,
userName: event.userInfos.userName,
userAvatarUrl: event.userInfos.avatarUrl,
userId: event.userInfos._id,
adds: event.adds,
adds: event.adds,
time: (new Date(new Date().getTime() + 1000 * 60 * 60 * 8)).Format("yyyy-MM-dd hh:mm:ss"), //+8时差
sorttime: Date.now() + 60 * 60 * 8 , //+8h时差
sorttime: Date.now() + 60 * 60 * 8, //+8h时差
title: event.title,
details: event.details,
price: event.price,
@ -38,68 +38,68 @@ var addProduct = async (event) => {
tag: event.tag,
viewNum: 0,
photos: event.photos,
isSall:false,
wantUser:new Array()
isSall: false,
wantUser: new Array()
}
}).then(res => {
}).then(res => {
//获取id
return {
errCode: 200,
errMsg: res._id,
};
}).catch(err => {
}).catch(err => {
//报错,然后再处理
return {
return {
errCode: 101,
errMsg: '创建新商品失败。',
err: err,
};
})
return res;
}
//把这个新商品id和名称push到用户信息里
var rewriteUserInfo = async (newId,event) => {
var res = await db.collection('sM_userInfo').doc(event.userInfos._id).update({
var rewriteUserInfo = async (newId, event) => {
var res = await db.collection('sM_userInfo').doc(event.userInfos._id).update({
data: {
issue: db.command.push({
id:newId,
id: newId,
title: event.title,
details: event.details,
})
}
}).then(res => {
if(res.stats.updated === 0)
}).then(res => {
if (res.stats.updated === 0)
return {
errCode: 102,
errMsg: '新商品id注入用户信息里时用户id错误。',
userId: event.userInfos._id,
};
else
else
return {
errCode: 200,
errMsg: res,
};
}).catch(err => {
};
}).catch(err => {
//报错
return {
return {
errCode: 103,
errMsg: '新商品id注入到用户信息里失败。',
err: err,
};
})
return res;
return res;
}
//删除审核表里边的记录
var deleteOldOne = async (id) => {
var res = await db.collection('sM_examine').doc(id).remove().then(res => {
if(res.stats.removed === 0) return {
var res = await db.collection('sM_examine').doc(id).remove().then(res => {
if (res.stats.removed === 0) return {
errCode: 104,
errMsg: '删除审核表旧记录失败。(旧表id错误)',
id:id
id: id
};
else return {
errCode: 200,
@ -109,7 +109,7 @@ var deleteOldOne = async (id) => {
return {
errCode: 105,
errMsg: '删除审核表旧记录失败。',
err:err,
err: err,
};
});
@ -129,7 +129,7 @@ var update = async (event) => {
isfree: event.isfree,
photos: event.photos,
time: (new Date(new Date().getTime() + 1000 * 60 * 60 * 8)).Format("yyyy-MM-dd hh:mm:ss"), //+8时差
formId: event.formId2,
needSend: event.needSend,
}
}).then(res => {
return {
@ -140,103 +140,109 @@ var update = async (event) => {
return {
errCode: 106,
errMsg: '上传到审核表失败',
err:err,
}
})
//如果添加失败就直接返回
if(res.errCode === 106) return res;
//发信息(预留错误码107发送失败)
var sendRes = await cloud.callFunction({
name: 'sM_sendMsg',
data: {
stats: 1,
sendId: event.userInfos._openid,
sendName: event.userInfos.userName,
title: event.title,
formId1: event.formId1,
examineId: res.errMsg,
}
}).then(res => {
return res.result
}).catch(err => {
return {
errCode: 107,
errMsg: '用户点击发布函数调用错误',
err: err,
}
})
return sendRes;
// 直接进行返回,不向用户发送信息
return res
//如果添加失败就直接返回
// if(res.errCode === 106) return res;
//发信息(预留错误码107发送失败)
// var sendRes = await cloud.callFunction({
// name: 'sM_sendMsg',
// data: {
// stats: 1,
// sendId: event.userInfos._openid,
// sendName: event.userInfos.userName,
// title: event.title,
// formId1: event.formId1,
// examineId: res.errMsg,
// }
// }).then(res => {
// return res.result
// }).catch(err => {
// return {
// errCode: 107,
// errMsg: '用户点击发布函数调用错误',
// err: err,
// }
// })
// return sendRes;
}
//审核通过
var pass = async (event) => {
//删除审核表里的旧记录
var delRes = await deleteOldOne(event.oldId);
if(delRes.errCode !== 200) return delRes;
if (delRes.errCode !== 200) return delRes;
//向商品表里边添加记录
var addRes = await addProduct(event);
if(addRes.errCode === 101) return addRes;
if (addRes.errCode === 101) return addRes;
//将这个表添加到用户个人信息里
var reRes = await rewriteUserInfo(addRes.errMsg, event);
if(reRes.errCode !== 200) return reRes;
//发信息(预留错误码107)
var sendRes = await cloud.callFunction({
name: 'sM_sendMsg',
data: {
stats: 2,
sendId: event.userInfos._openid,
sendName: event.userInfos.userName,
result: "审核通过",
remarks: event.remarks + "\n注点击下方即可进入小程序",
formId: event.formId,
}
}).then(res => {
return res.result;
}).catch(err => {
return {
errCode:107,
errMsg: '审核通过信息发送函数调用错误',
err: err,
}
})
if (reRes.errCode !== 200) return reRes;
if (event.needSend) {
//发信息(预留错误码107)
var sendRes = await cloud.callFunction({
name: 'sM_sendMsg',
data: {
stats: 2,
sendId: event.userInfos._openid,
sendName: event.userInfos.userName,
result: "审核通过",
remarks: event.remarks + "\n注点击下方即可进入小程序",
}
}).then(res => {
return res.result;
}).catch(err => {
return {
errCode: 107,
errMsg: '审核通过信息发送函数调用错误',
err: err,
}
})
return sendRes;
}
return reRes
return sendRes;
}
//审核失败
var fail = async(event) => {
var fail = async (event) => {
//删除审核表旧纪录
var delRes = await deleteOldOne(event.oldId);
if(delRes.errCode !== 200) return delRes;
//发信息(预留错误码107)
var sendRes = await cloud.callFunction({
name: 'sM_sendMsg',
data: {
stats: 2,
sendId: event.userInfos._openid,
sendName: event.userInfos.userName,
result: "审核失败",
remarks: event.remarks + "\n注您的商品信息已被删除请重新发布。",
formId: event.formId,
}
}).then(res => {
return res.result;
}).catch(err => {
return {
errCode: 107,
errMsg: '审核失败信息发送函数调用失败',
err: err
}
})
if (delRes.errCode !== 200) return delRes;
if (event.needSend) {
//发信息(预留错误码107)
var sendRes = await cloud.callFunction({
name: 'sM_sendMsg',
data: {
stats: 2,
sendId: event.userInfos._openid,
sendName: event.userInfos.userName,
result: "审核失败",
remarks: event.remarks + "\n注您的商品信息已被删除请重新发布。",
}
}).then(res => {
return res.result;
}).catch(err => {
return {
errCode: 107,
errMsg: '审核失败信息发送函数调用失败',
err: err
}
})
return sendRes;
return sendRes;
}
return delRes
}
// 云函数入口函数
@ -298,6 +304,19 @@ exports.main = async (event, context) => {
注意需要获取oldId给发消息用不过得等前端写完页面之后
作者RainSun
时间2019/04/29
更新
参数
stats = 1 用户点击发布时
userInfos 数据库里边的用户完整信息
title商品名
details商品详细信息
adds地址
tag标签
price价格
isfree是否免费
photos照片地址数组
needSend: 是否允许发送成功通知
时间2020/06/10
*/
/*
日志
@ -305,6 +324,10 @@ exports.main = async (event, context) => {
20190430
今天完成错误信息的返回详情见下方错误报告
代码格式整理完成
20200610
因为小程序比赛回来改代码因为模板消息改成了订阅消息
所以取消上传成功的订阅消息只保留审核完成的订阅消息
如果用户不同意还可以不发送
*/
/*
@ -357,4 +380,4 @@ exports.main = async (event, context) => {
未提交或者非法的stats值:
code:108
msg:
*/
*/

View File

@ -1,17 +1,17 @@
//拓展Format函数以获取时间
Date.prototype.Format = function(fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
Date.prototype.Format = function (fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
const cloud = require('wx-server-sdk')
@ -20,37 +20,37 @@ cloud.init()
//开始审核
var startExamine = async (event) => {
//给发布人发消息说开始审核了
var userRes = await cloud.openapi.templateMessage.send({
touser: event.sendId,
data: {
keyword1: {
var userRes = await cloud.openapi.templateMessage.send({
touser: event.sendId,
data: {
keyword1: {
//姓名
value: event.sendName
},
keyword2: {
value: event.sendName
},
keyword2: {
//类型
value: '发布商品'
},
keyword3: {
value: '发布商品'
},
keyword3: {
//申请时间
value: (new Date(new Date().getTime() + 1000 * 60 * 60 * 8)).Format("yyyy-MM-dd hh:mm:ss") //+8时差
},
keyword4: {
value: (new Date(new Date().getTime() + 1000 * 60 * 60 * 8)).Format("yyyy-MM-dd hh:mm:ss") //+8时差
},
keyword4: {
//审核内容
value: '商品名称、商品描述、商品图片'
},
keyword5: {
value: '商品名称、商品描述、商品图片'
},
keyword5: {
//信息概要
value: event.title
},
keyword6: {
value: event.title
},
keyword6: {
//备注
value: '审核时长大约半天左右,请耐心等待。'
}
},
templateId: 'pRo9V3HgghrtyAKCKnQAmwyQysT1Yqr72iT4TdU6S7c',
formId: event.formId1,
}).then(res => {
value: '审核时长大约半天左右,请耐心等待。'
}
},
templateId: 'pRo9V3HgghrtyAKCKnQAmwyQysT1Yqr72iT4TdU6S7c',
formId: event.formId1,
}).then(res => {
return {
errCode: 200,
errMsg: 'ok'
@ -62,36 +62,31 @@ var startExamine = async (event) => {
err: err,
}
})
return userRes;
}
//审核结果
var passExamine = async (event) => {
//给被审核人发送消息说审核结果
var res = await cloud.openapi.templateMessage.send({
touser: event.sendId,
page:'components/welcome/welcome',
data: {
keyword1: {
//申请人
value: event.sendName
},
keyword2: {
//申请内容
value: "发布商品"
},
keyword3: {
//审核结果
value: event.result
},
keyword4: {
//备注
value: event.remarks
}
},
templateId: 'ZSTBhVkZwfX2ZgDfiAL8uBMeuJ_zFJfJFch4zqzpBZ8',
formId: event.formId,
var res = await cloud.openapi.subscribeMessage.send({
touser: event.sendId,
page: 'components/welcome/welcome',
data: {
// 审核类型
thing18: {
value: '上传物品'
},
// 审核结果
thing19: {
value: event.result
},
// 备注
thing17: {
value: event.remarks
},
},
templateId: 'PPngF-ljr1S6yixiorFJ4bj8t8mP5odUhHEnu_08Smw',
}).then(res => {
return {
errCode: 200,
@ -108,9 +103,10 @@ var passExamine = async (event) => {
}
exports.main = async (event, context) => {
if(event.stats == 1) var res = await startExamine(event);
else if(event.stats == 2) var res = await passExamine(event);
return res;
// if(event.stats == 1) var res = await startExamine(event);
// else if(event.stats == 2) var res = await passExamine(event);
// return res;
return await passExamine(event)
}
/*
@ -133,6 +129,12 @@ exports.main = async (event, context) => {
注意在前端写完界面之后要在这里加入跳转界面给管理员用
作者RainSun
时间2019/05/01
更新
参数
sendId: 收件人openid
result 结果 审核通过 或者 审核失败
remarks 备注 随便填
时间2020/06/10
*/
/*
错误报告

View File

@ -1,7 +1,7 @@
// components/createProj/createProj.js
//去除字符串两边留白
String.prototype.trim=function(){
  return this.replace(/(^\s*)|(\s*$)/g, "");
String.prototype.trim = function () {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
var App = getApp();
Page({
@ -10,19 +10,17 @@ Page({
* 页面的初始数据
*/
data: {
title:'',
details:'',
adds:null,
tag:null,
price:'',
isfree:false,
title: '',
details: '',
adds: null,
tag: null,
price: '',
isfree: false,
imgList: [],
formId1:null,
formId2:null,
customBar:null,
showSubmit:false,
showError:false,
photos:[],
customBar: null,
showSubmit: false,
showError: false,
photos: [],
},
/**
@ -30,7 +28,7 @@ Page({
*/
onLoad: function (options) {
this.setData({
customBar:App.globalData.CustomBar
customBar: App.globalData.CustomBar
})
wx.hideShareMenu();
},
@ -98,7 +96,7 @@ Page({
//上传图片
var that = this;
var userInfo = wx.getStorageSync('userInfoDetail')
let path = 'cherryStore/userImg/'+userInfo._id+'/'+(new Date()).getTime() + this.data.photos.length ;
let path = 'cherryStore/userImg/' + userInfo._id + '/' + (new Date()).getTime() + this.data.photos.length;
wx.cloud.uploadFile({
cloudPath: path, // 上传至云端的路径
filePath: res.tempFilePaths[0], // 小程序临时文件路径
@ -160,29 +158,29 @@ Page({
},
input(e) {
// console.log(e.detail.value)
switch(e.target.dataset.inputtype){
switch (e.target.dataset.inputtype) {
case 1: //title
if(e.detail.value) this.data.title = e.detail.value;
if (e.detail.value) this.data.title = e.detail.value;
else this.data.title = null;
break;
case 2: //detail
if(e.detail.value)
if (e.detail.value)
this.setData({
details:e.detail.value
details: e.detail.value
})
else
else
this.setData({
details:null
details: null
})
break;
case 3: //price
e.detail.value = e.detail.value.trim();
if(e.detail.value) {
e.detail.value = e.detail.value.trim();
if (e.detail.value) {
let judgePrice = isNaN(e.detail.value)
if(parseInt(e.detail.value)===0){
if (parseInt(e.detail.value) === 0) {
this.data.isfree = true;
this.data.price = 0;
} else if(judgePrice){
} else if (judgePrice) {
this.data.isfree = false;
this.data.price = null;
} else {
@ -195,21 +193,21 @@ Page({
}
break;
case 4: //adds
if(e.target.dataset.tagtype === this.data.adds )
if (e.target.dataset.tagtype === this.data.adds)
this.setData({
adds:null
adds: null
})
else
else
this.setData({
adds: e.target.dataset.tagtype
})
break;
case 5: //tag
if(e.target.dataset.tagtype === this.data.tag )
if (e.target.dataset.tagtype === this.data.tag)
this.setData({
tag:null
tag: null
})
else
else
this.setData({
tag: e.target.dataset.tagtype
})
@ -217,36 +215,51 @@ Page({
}
console.log(this.data)
},
submit (e) {
// 申请发送模板消息
requestSubscribeMessage() {
this.hideModal()
wx.requestSubscribeMessage({
tmplIds: ['PPngF-ljr1S6yixiorFJ4bj8t8mP5odUhHEnu_08Smw'],
}).then(res => {
console.log(res)
if(res['PPngF-ljr1S6yixiorFJ4bj8t8mP5odUhHEnu_08Smw'] == 'reject') {
// 用户点击不同意
this.submit(false)
} else {
// 用户同意
this.submit()
}
}).catch(err => {
console.log(err)
})
},
submit(needSend = true) {
var userInfo = wx.getStorageSync('userInfoDetail');
wx.showLoading({
title: '上传中',
mask: true
})
this.data.formId2 = e.detail.formId;
if(this.data.photos.length!== this.data.imgList.length) {
if (this.data.photos.length !== this.data.imgList.length) {
wx.showToast({
title: '请等待图片上传完成',
image:'../../images/info.png',
image: '../../images/info.png',
duration: 2000
})
return;
return;
}
var d = this.data;
var data = {
stats:1,
userInfos:userInfo,
title:d.title,
details:d.details,
adds:d.adds,
tag:d.tag,
price:d.price,
isfree:d.isfree,
photos:d.photos,
formId1:d.formId1,
formId2:d.formId2,
stats: 1,
userInfos: userInfo,
title: d.title,
details: d.details,
adds: d.adds,
tag: d.tag,
price: d.price,
isfree: d.isfree,
photos: d.photos,
needSend: needSend
}
console.log(data);
wx.cloud.callFunction({
@ -254,10 +267,10 @@ Page({
data: data
}).then(res => {
wx.hideLoading({})
if(res.result.errCode!==200) {
if (res.result.errCode !== 200) {
wx.showToast({
title: '错误码'+res.result.errCode,
image:'../../images/info.png',
title: '错误码' + res.result.errCode,
image: '../../images/info.png',
duration: 2000
})
console.log(res.result)
@ -267,18 +280,19 @@ Page({
icon: 'success',
duration: 2000
})
wx.setStorageSync('refreshMain',true)
wx.setStorageSync('refreshMine',true)
wx.setStorageSync('refreshMain', true)
wx.setStorageSync('refreshMine', true)
this.setData({
adds:null,
tag:null,
isfree:false,
adds: null,
tag: null,
isfree: false,
imgList: [],
formId1:null,
formId2:null,
showSubmit:false,
showError:false,
photos:[],
showSubmit: false,
showError: false,
photos: [],
title: '',
details: '',
price: '',
})
}
}).catch(err => {
@ -286,30 +300,31 @@ Page({
console.log(err)
wx.showToast({
title: '错误请重试',
image:'../../images/info.png',
image: '../../images/info.png',
duration: 2000
})
})
},
// 点击我填完了校验内容
judge(e) {
this.data.formId1 = e.detail.formId
let d = this.data
if(d.title&&d.details&&d.adds&&d.tag&&d.price!==null) {
if (d.title && d.details && d.adds && d.tag && d.price !== null) {
this.setData({
showSubmit:true
showSubmit: true
})
} else {
this.setData({
showError:true
showError: true
})
}
},
//判断是否注册
//点击确认上传,判断是否注册
judgeHasSign(e) {
var userInfo = wx.getStorageSync('userInfoDetail');
if(!userInfo.isSign) {
if (!userInfo.isSign) {
wx.showModal({
title: '警告',
content: '您还未注册',
@ -324,14 +339,15 @@ Page({
}
})
} else {
this.submit(e);
// 校验通过,申请发送完成的信息
this.requestSubscribeMessage(e);
}
},
hideModal(e) {
this.setData({
showSubmit:false,
showError:false
showSubmit: false,
showError: false
})
},
})

View File

@ -65,7 +65,7 @@
</view>
<view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub">
<view class="padding-xs bg-img" style="background-image:url({{imgList[index]}})" wx:for="{{imgList}}" wx:key="{{index}}" bindtap="ViewImage" data-url="{{imgList[index]}}">
<view class="padding-xs bg-img" style="background-image:url({{imgList[index]}})" wx:for="{{imgList}}" wx:key="index" bindtap="ViewImage" data-url="{{imgList[index]}}">
<view class="cu-tag bg-red" catchtap="DelImg" data-index="{{index}}">
<text class="icon-close" style="color:#fff;"></text>
</view>
@ -80,7 +80,7 @@
</form>
</view>
<form bindsubmit='judge' report-submit='true'>         
<form bindsubmit='judge'>         
<button class='submit' form-type='submit'>我填完了</button>       
</form>
@ -96,7 +96,7 @@
下一步将进入审核,是否确认提交
</view>
<view class="cu-bar bg-white justify-end">
<form class="action" report-submit='true' bindsubmit='judgeHasSign'>
<form class="action" bindsubmit='judgeHasSign'>
<button class="cu-btn cancel-button" bindtap="hideModal" >取消</button>
<button class="cu-btn confirm-button margin-left" form-type="submit">确定</button>
</form>
@ -116,7 +116,7 @@
除了图片每一项都是必填项,请检查。
</view>
<view class="cu-bar bg-white justify-end">
<form class="action" report-submit="{{true}}">
<form class="action" >
<button class="cu-btn confirm-button margin-left" bindtap="hideModal" form-type="submit">确定</button>
</form>
</view>

View File

@ -128,6 +128,7 @@ Page({
oldId: proj._id,
remarks: this.data.inputValue,
formId:proj.formId,
needSend: proj.needSend
}
} else {
var data = {
@ -135,7 +136,8 @@ Page({
userInfos: proj.userInfo,
oldId:proj._id,
remarks: this.data.inputValue,
formId: proj.formId
formId: proj.formId,
needSend: proj.needSend
}
}
wx.cloud.callFunction({

View File

@ -49,7 +49,7 @@
<textarea wx:if="{{isShowModal}}" class="input-box radius" show-confirm-bar="false" bindinput="inputChange" value="{{inputValue}}" focus="{{true}}"></textarea>
</view>
<view class="cu-bar bg-white justify-end">
<form bindsubmit="submit" report-submit='{{true}}' class="action">
<form bindsubmit="submit" class="action">
<button class="cu-btn line-green text-green" bindtap="hideModal">取消</button>
<button form-type="submit" class="cu-btn bg-green margin-left" bindtap="hideModal">提交</button>
</form>

View File

@ -13,7 +13,7 @@
<!-- swiper -->
<swiper class="card-swiper square-dot" indicator-dots="true" circular="true" autoplay="true" interval="5000" duration="500" bindchange="cardSwiper" indicator-color="#aaa" indicator-active-color="#fff">
<swiper-item wx:for="{{swiperList}}" wx:key class="{{cardCur==index?'cur':''}}">
<swiper-item wx:for="{{swiperList}}" wx:key="index" class="{{cardCur==index?'cur':''}}">
<view class="swiper-item">
<image src="{{item.url}}" mode="aspectFill"></image>
</view>
@ -23,7 +23,7 @@
<!-- 标签列表 -->
<view class="tag-box">
<view class="item-box" bindtap="goToTagSearch" data-tagtype="图书">
<view class="item-box" bindtap="requestSubscribeMessage" data-tagtype="图书">
<image src="cloud://cloud-83621f.636c-cloud-83621f/cherryStore/book.png" />
<view class="text">图书</view>
</view>
@ -74,7 +74,7 @@
<!-- 商品列表 -->
<view class="product-list" >
<view class="product-item" wx:for="{{list}}" wx:key wx:if="{{!item.isSall}}" data-productId="{{item._id}}" bindtap="jumpToDetail">
<view class="product-item" wx:for="{{list}}" wx:key="index" wx:if="{{!item.isSall}}" data-productId="{{item._id}}" bindtap="jumpToDetail">
<view class="user-box">
<image src="{{item.userAvatarUrl}}" />
<view class="user-info">

View File

@ -101,6 +101,7 @@ Page({
} else {
//已经登陆过了
var userInfo = res.data[0];
console.log(userInfo)
wx.setStorageSync('userInfoDetail', userInfo);
if(userInfo.isSign) wx.setStorageSync('isSign', true);
else wx.setStorageSync('isSign',false);

View File

@ -7,11 +7,24 @@
"postcss": true,
"minified": true,
"newFeature": true,
"checkSiteMap": false
"coverView": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"checkInvalidKey": true,
"checkSiteMap": false,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"appid": "wx0df150c438e4c8f0",
"projectname": "cherry%20Store",
"libVersion": "2.7.1",
"libVersion": "2.11.1",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"cloudfunctionTemplateRoot": "cloudfunctionTemplate",