|
@@ -1,6 +1,7 @@
|
|
|
// pages/productinfo/productinfo.js
|
|
|
import productApi from '../../api/product'
|
|
|
import commentsApi from '../../api/comments'
|
|
|
+const app = getApp()
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -37,9 +38,6 @@ Page({
|
|
|
commentsList: list,
|
|
|
commentsNum: comments.count
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
standardCommentsList: function (list) {
|
|
|
list.forEach(function (item, i, array) {
|
|
@@ -107,14 +105,20 @@ Page({
|
|
|
url: '../comments/comments?title=全部评论&commentstype=all&shopId=' + shopId + '&productId=' + productId,
|
|
|
})
|
|
|
},
|
|
|
- gotoAppointment: function (e) {
|
|
|
+ gotoAppointment: async function (e) {
|
|
|
+ const self = this
|
|
|
+ console.log(this)
|
|
|
var shopId = this.data.shopId;
|
|
|
var productId = this.data.productId;
|
|
|
- var productImg = this.data.product.productImg;
|
|
|
- var productName = this.data.product.productName;
|
|
|
- var price = this.data.product.currentPrice;
|
|
|
+ const isAuth = await app.isAuth()
|
|
|
+ if (!isAuth) {
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/prompt/prompt?page=' + this.route+`&shopId=${shopId}&productId=${productId}`,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
wx.navigateTo({
|
|
|
- url: '../appointment/appointment?' + 'shopId=' + shopId + '&productId=' + productId + '&productImg=' + productImg + '&productName=' + productName + '&price=' + price,
|
|
|
+ url: '../appointment/appointment?' + 'shopId=' + shopId + '&productId=' + productId,
|
|
|
})
|
|
|
}
|
|
|
})
|