|
@@ -15,6 +15,7 @@ Page({
|
|
// brand: {},
|
|
// brand: {},
|
|
// specificationList: [],
|
|
// specificationList: [],
|
|
// productList: [],
|
|
// productList: [],
|
|
|
|
+ isSeller:false,
|
|
seller: {},
|
|
seller: {},
|
|
sellerDates: 0,
|
|
sellerDates: 0,
|
|
sellerHistory: 0,
|
|
sellerHistory: 0,
|
|
@@ -25,6 +26,7 @@ Page({
|
|
checkedSpecText: '请选择规格数量',
|
|
checkedSpecText: '请选择规格数量',
|
|
openAttr: false,
|
|
openAttr: false,
|
|
openComment: false,
|
|
openComment: false,
|
|
|
|
+ openDelete:false,
|
|
replyId: '',
|
|
replyId: '',
|
|
replyUserId: '',
|
|
replyUserId: '',
|
|
replyUserName: '',
|
|
replyUserName: '',
|
|
@@ -40,6 +42,16 @@ Page({
|
|
let that = this;
|
|
let that = this;
|
|
util.request(api.GoodsDetail + '/' + that.data.id).then(function(res) {
|
|
util.request(api.GoodsDetail + '/' + that.data.id).then(function(res) {
|
|
if (res.errno === 0) {
|
|
if (res.errno === 0) {
|
|
|
|
+ if (res.data.info.isDelete) {
|
|
|
|
+ util.showErrorToast('商品不存在')
|
|
|
|
+ setTimeout(function callback() {
|
|
|
|
+
|
|
|
|
+ wx.navigateBack({
|
|
|
|
+ delta: 1
|
|
|
|
+ })
|
|
|
|
+ }, 1000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
//计算卖家来平台第几天
|
|
//计算卖家来平台第几天
|
|
let registerTime = res.data.seller.registerTime
|
|
let registerTime = res.data.seller.registerTime
|
|
@@ -51,12 +63,7 @@ Page({
|
|
seller: res.data.seller,
|
|
seller: res.data.seller,
|
|
sellerHistory: res.data.sellerHistory,
|
|
sellerHistory: res.data.sellerHistory,
|
|
sellerDates: dates,
|
|
sellerDates: dates,
|
|
- // attribute: res.data.attribute,
|
|
|
|
- // issueList: res.data.issue,
|
|
|
|
comment: res.data.comment,
|
|
comment: res.data.comment,
|
|
- // brand: res.data.brand,
|
|
|
|
- // specificationList: res.data.specificationList,
|
|
|
|
- // productList: res.data.productList,
|
|
|
|
userHasCollect: res.data.userHasCollect
|
|
userHasCollect: res.data.userHasCollect
|
|
});
|
|
});
|
|
|
|
|
|
@@ -70,6 +77,13 @@ Page({
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (that.data.seller.openId == wx.getStorageSync('userInfo').openId){
|
|
|
|
+ console.log("当前用户是卖家")
|
|
|
|
+ that.setData({
|
|
|
|
+ isSeller: true
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
WxParse.wxParse('goodsDetail', 'html', res.data.info.goods_desc, that);
|
|
WxParse.wxParse('goodsDetail', 'html', res.data.info.goods_desc, that);
|
|
|
|
|
|
that.getGoodsRelated();
|
|
that.getGoodsRelated();
|
|
@@ -90,6 +104,26 @@ Page({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ deleteGoods: function () {
|
|
|
|
+ let that = this;
|
|
|
|
+ util.request(api.GoodsDelete + '/' + that.data.id,{},'DELETE').then(function (res) {
|
|
|
|
+ if (res.errno === 0) {
|
|
|
|
+
|
|
|
|
+ setTimeout(function goback() {
|
|
|
|
+ wx.reLaunch({
|
|
|
|
+ url: '/pages/index/index'
|
|
|
|
+ })
|
|
|
|
+ }, 1000)
|
|
|
|
+
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '删除成功'
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ console.log(res.errmsg)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
},
|
|
},
|
|
// clickSkuValue: function (event) {
|
|
// clickSkuValue: function (event) {
|
|
// let that = this;
|
|
// let that = this;
|
|
@@ -211,6 +245,7 @@ Page({
|
|
|
|
|
|
var that = this;
|
|
var that = this;
|
|
this.getGoodsInfo();
|
|
this.getGoodsInfo();
|
|
|
|
+
|
|
// util.request(api.CartGoodsCount).then(function (res) {
|
|
// util.request(api.CartGoodsCount).then(function (res) {
|
|
// if (res.errno === 0) {
|
|
// if (res.errno === 0) {
|
|
// that.setData({
|
|
// that.setData({
|
|
@@ -257,6 +292,18 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ switchDeletetPop: function (event) {
|
|
|
|
+ let that = this
|
|
|
|
+ user.checkLoginAndNav().then(() => {
|
|
|
|
+ if (this.data.openDelete == false) {
|
|
|
|
+ this.setData({
|
|
|
|
+ openDelete: !this.data.openDelete
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
|
|
closeComment: function() {
|
|
closeComment: function() {
|
|
this.setData({
|
|
this.setData({
|
|
@@ -265,6 +312,13 @@ Page({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ closeDelete: function () {
|
|
|
|
+ this.setData({
|
|
|
|
+
|
|
|
|
+ openDelete: false,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
postComment: function(event) {
|
|
postComment: function(event) {
|
|
let that = this
|
|
let that = this
|
|
if (event.detail.value.trim() == '') {
|
|
if (event.detail.value.trim() == '') {
|