From 4deff541be51e30db0e21524f3078a55fd51afe4 Mon Sep 17 00:00:00 2001 From: WXD-SEASON\season Date: Tue, 18 May 2021 15:22:55 +0800 Subject: [PATCH] 创建packageB --- app.json | 35 +++++++++++++++++++++++------------ packageB/pages/user/add_comment/add_comment.js | 228 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/add_comment/add_comment.json | 7 +++++++ packageB/pages/user/add_comment/add_comment.wxml | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/add_comment/add_comment.wxss | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/collect_list/collect_list.js | 301 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/collect_list/collect_list.json | 8 ++++++++ packageB/pages/user/collect_list/collect_list.wxml | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/collect_list/collect_list.wxss | 521 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/comment/comment.js | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/comment/comment.json | 3 +++ packageB/pages/user/comment/comment.wxml | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/comment/comment.wxss | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/user_coupon/c_filter.wxs | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/user_coupon/filter.wxs | 11 +++++++++++ packageB/pages/user/user_coupon/user_coupon.js | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/user_coupon/user_coupon.json | 8 ++++++++ packageB/pages/user/user_coupon/user_coupon.wxml | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/user_coupon/user_coupon.wxss | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/view_comment/view_comment.js | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/view_comment/view_comment.json | 7 +++++++ packageB/pages/user/view_comment/view_comment.wxml | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageB/pages/user/view_comment/view_comment.wxss | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/user/add_comment/add_comment.js | 228 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ pages/user/add_comment/add_comment.json | 7 ------- pages/user/add_comment/add_comment.wxml | 114 ------------------------------------------------------------------------------------------------------------------ pages/user/add_comment/add_comment.wxss | 162 ------------------------------------------------------------------------------------------------------------------------------------------------------------------ pages/user/collect_list/collect_list.js | 298 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/collect_list/collect_list.json | 8 -------- pages/user/collect_list/collect_list.wxml | 110 -------------------------------------------------------------------------------------------------------------- pages/user/collect_list/collect_list.wxss | 521 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/comment/comment.js | 158 -------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/comment/comment.json | 3 --- pages/user/comment/comment.wxml | 127 ------------------------------------------------------------------------------------------------------------------------------- pages/user/comment/comment.wxss | 215 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/index/index.js | 2 +- pages/user/order_detail/order_detail.wxml | 4 ++-- pages/user/order_list/order_list.wxml | 4 ++-- pages/user/user_coupon/c_filter.wxs | 63 --------------------------------------------------------------- pages/user/user_coupon/filter.wxs | 11 ----------- pages/user/user_coupon/user_coupon.js | 160 ---------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/user_coupon/user_coupon.json | 8 -------- pages/user/user_coupon/user_coupon.wxml | 123 --------------------------------------------------------------------------------------------------------------------------- pages/user/user_coupon/user_coupon.wxss | 181 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/userqy/userqy.js | 2 +- pages/user/view_comment/view_comment.js | 127 ------------------------------------------------------------------------------------------------------------------------------- pages/user/view_comment/view_comment.json | 7 ------- pages/user/view_comment/view_comment.wxml | 105 --------------------------------------------------------------------------------------------------------- pages/user/view_comment/view_comment.wxss | 170 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 49 files changed, 2937 insertions(+), 2924 deletions(-) create mode 100644 packageB/pages/user/add_comment/add_comment.js create mode 100644 packageB/pages/user/add_comment/add_comment.json create mode 100644 packageB/pages/user/add_comment/add_comment.wxml create mode 100644 packageB/pages/user/add_comment/add_comment.wxss create mode 100644 packageB/pages/user/collect_list/collect_list.js create mode 100644 packageB/pages/user/collect_list/collect_list.json create mode 100644 packageB/pages/user/collect_list/collect_list.wxml create mode 100644 packageB/pages/user/collect_list/collect_list.wxss create mode 100644 packageB/pages/user/comment/comment.js create mode 100644 packageB/pages/user/comment/comment.json create mode 100644 packageB/pages/user/comment/comment.wxml create mode 100644 packageB/pages/user/comment/comment.wxss create mode 100644 packageB/pages/user/user_coupon/c_filter.wxs create mode 100644 packageB/pages/user/user_coupon/filter.wxs create mode 100644 packageB/pages/user/user_coupon/user_coupon.js create mode 100644 packageB/pages/user/user_coupon/user_coupon.json create mode 100644 packageB/pages/user/user_coupon/user_coupon.wxml create mode 100644 packageB/pages/user/user_coupon/user_coupon.wxss create mode 100644 packageB/pages/user/view_comment/view_comment.js create mode 100644 packageB/pages/user/view_comment/view_comment.json create mode 100644 packageB/pages/user/view_comment/view_comment.wxml create mode 100644 packageB/pages/user/view_comment/view_comment.wxss delete mode 100644 pages/user/add_comment/add_comment.js delete mode 100644 pages/user/add_comment/add_comment.json delete mode 100644 pages/user/add_comment/add_comment.wxml delete mode 100644 pages/user/add_comment/add_comment.wxss delete mode 100644 pages/user/collect_list/collect_list.js delete mode 100644 pages/user/collect_list/collect_list.json delete mode 100644 pages/user/collect_list/collect_list.wxml delete mode 100644 pages/user/collect_list/collect_list.wxss delete mode 100644 pages/user/comment/comment.js delete mode 100644 pages/user/comment/comment.json delete mode 100644 pages/user/comment/comment.wxml delete mode 100644 pages/user/comment/comment.wxss delete mode 100644 pages/user/user_coupon/c_filter.wxs delete mode 100644 pages/user/user_coupon/filter.wxs delete mode 100644 pages/user/user_coupon/user_coupon.js delete mode 100644 pages/user/user_coupon/user_coupon.json delete mode 100644 pages/user/user_coupon/user_coupon.wxml delete mode 100644 pages/user/user_coupon/user_coupon.wxss delete mode 100644 pages/user/view_comment/view_comment.js delete mode 100644 pages/user/view_comment/view_comment.json delete mode 100644 pages/user/view_comment/view_comment.wxml delete mode 100644 pages/user/view_comment/view_comment.wxss diff --git a/app.json b/app.json index 1a93be2..1556432 100644 --- a/app.json +++ b/app.json @@ -19,8 +19,7 @@ "pages/user/coupon/coupon", "pages/user/checkcoupon/checkcoupon", "pages/user/add_address/add_address", - "pages/user/withdrawals_list/withdrawals_list", - "pages/user/add_comment/add_comment", + "pages/user/withdrawals_list/withdrawals_list", "pages/user/return_goods_info/return_goods_info", "pages/user/return_goods/return_goods", "pages/user/withdrawals/withdrawals", @@ -50,8 +49,7 @@ "pages/user/integral/msg/msg", "pages/user/userqy/userqy", "pages/user/user_spsy/user_spsy", - "pages/user/user_fw/user_fw", - "pages/user/user_coupon/user_coupon", + "pages/user/user_fw/user_fw", "pages/user/grow_value/grow_value", "pages/payment/pay_success/pay_success", "pages/user/plus/plus", @@ -66,10 +64,8 @@ "pages/user/my_service/tment_eval", "pages/user/my_service/tment_order_list", "pages/user/my_service/beauty_deta", - "pages/user/labels/labels", - "pages/user/view_comment/view_comment", - "pages/giftpack/birthdaygift/birthdaygift", - "pages/user/comment/comment", + "pages/user/labels/labels", + "pages/giftpack/birthdaygift/birthdaygift", "pages/giftpack/evaluategift/evaluategift", "pages/giftpack/newvipgift/newvipgift", "pages/giftpack/payment/payment", @@ -88,7 +84,7 @@ "pages/cart/cart2_inte/cart2_inte", "pages/giftpack/festival/festival", "pages/team/team_more/team_more", - "pages/user/collect_list/collect_list", + "pages/user/deposit/deposit", "pages/user/deposit/prepaid/msg/msg", "pages/user/deposit/prepaid/prepaid", @@ -96,7 +92,7 @@ ], "plugins": { "live-player-plugin": { - "version": "1.2.5", + "version": "1.3.0", "provider": "wx2b03c6e691cd7370" } }, @@ -141,10 +137,25 @@ "pages/my_service/tment_order_list", "pages/my_service/beauty_deta", "pages/profile/profile", - "pages/parseHtml/parseHtml" + "pages/parseHtml/parseHtml" + ] - }], + }, + { + "root": "packageB/", + "name":"pack2", + "pages": [ + "pages/user/collect_list/collect_list", + "pages/user/comment/comment", + "pages/user/view_comment/view_comment", + "pages/user/add_comment/add_comment", + "pages/user/user_coupon/user_coupon" + ] + +} + +], "permission": { "scope.userLocation": { "desc": "获取你的位置信息" diff --git a/packageB/pages/user/add_comment/add_comment.js b/packageB/pages/user/add_comment/add_comment.js new file mode 100644 index 0000000..ae5369c --- /dev/null +++ b/packageB/pages/user/add_comment/add_comment.js @@ -0,0 +1,228 @@ +var t = getApp(), oo = t.globalData, a = t.globalData.setting, os = a, e = t.request, s = require("../../../utils/util.js"), + i = require("../../../utils/selectFiles.js"); +var regeneratorRuntime = require('../../../utils/runtime.js'); + +Page({ + data: { + url: a.url, + resourceUrl: a.resourceUrl, + iurl: a.imghost, + defaultPhoto: a.resourceUrl + "/static/images/camera.png", + uploadPath: [], //上传后文件路径 + maxWord: 0, + is_anonymous: !1, + goods_rank: 0, + service_rank: 0, + deliver_rank: 0, + content: "", + options: null, + isLongPress: !1, + userinfo: null, + imgs: [], //本地文件再上传时的路径 + lenMore:0, + goods_id: "", //商品id + order_id: "", //订单id + }, + onLoad: async function (a) { + var th = this; + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data:{store_id:os.stoid,goods_id:a.goods_id, order_id:a.order_id}}).then(res => { + + a.img = th.data.iurl + res.data.data.pageData[0].original_img; + a.goods_name=res.data.data.pageData[0].goods_name; + a.goods_num=res.data.data.pageData[0].goods_num; + }) + this.setData({ options: a }); + t.getUserInfo(function (e) { + console.log(e); + th.setData({userinfo: e}) + }) + th.setData({ + goods_id: a.goods_id, + order_id: a.order_id + }) + }, + keyUpChangeNum: function (t) { + this.setData({ + maxWord: t.detail.value.length + }), this.data.content = t.detail.value; + }, + checkAnonymous: function () { + this.setData({ + is_anonymous: !this.data.is_anonymous + }); + }, + checkGoodsRank: function (t) { + this.setData({ + goods_rank: parseInt(t.currentTarget.dataset.i) + 1 + }); + }, + checkServiceRank: function (t) { + this.setData({ + service_rank: parseInt(t.currentTarget.dataset.i) + 1 + }); + }, + checkDeliverRank: function (t) { + this.setData({ + deliver_rank: parseInt(t.currentTarget.dataset.i) + 1 + }); + }, + selectPhotos: function (t) { + if (this.data.isLongPress) this.data.isLongPress = !1; else { + var a = this; + i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function (t) { + a.setData({ + filePaths: t + }); + }); + } + }, + removePhoto: function (t) { + var a = this; + this.data.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function (t) { + a.setData({ + filePaths: t + }); + }); + }, + submitComment: function (i) { + var a = this; + if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) + return getApp().my_warnning("请先打分",0,a); + // if(a.data.content=="") + // return getApp().my_warnning("请填写评价内容",0,a); + + //this.uploadPhotos(function () { + var p_data= { + email: ' ', + is_show: 1, + goods_rank: a.data.goods_rank, + service_rank: a.data.service_rank, + deliver_rank: a.data.deliver_rank, + content: a.data.content, + goods_id: a.data.options.goods_id, + order_id: a.data.options.order_id, + user_id: oo.user_id, + store_id: os.stoid, + username: a.data.userinfo.nickname, + source_type:1 + } + if(a.data.uploadPath){ + p_data['weapp_img']=JSON.stringify(a.data.uploadPath); + } + if(a.data.is_anonymous){ + p_data['is_anonymous']=1; + } + + e.post("/api/weshop/comment/savecomment", { + data:p_data, + success: function (a) { + if(a.data.code==0){ + wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () { + // wx.navigateBack(); + var url = i.currentTarget.dataset.url; + getApp().goto(url); + }); + }else{ + getApp().my_warnning(a.data.msg,0,a); + } + } + }); + //}); + }, + + + uploadPhotos: function (t, a) { + if (0 == this.data.imgs.length) return t(); + if ("number" != typeof a) a = 0; else if (a >= this.data.imgs.length) return t(); + var s = this; + e.uploadFile("/api/weshop/comment/uploadCommentImg", { + filePath: s.data.imgs[a], + name: "file", + success: function (e) { + console.log("uploadPhotos"); + console.log(e.data); + if(e.data.code==0) + s.data.uploadPath[a] = e.data.data, s.uploadPhotos(t, a + 1); + } + }); + }, + + //图片失败,默认图片 + bind_bnerr2: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = a.imghost + "/public/images/default_goods_image_240.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, + // 上传图片 + chooseImg: function (e) { + var that = this; + var imgs = this.data.imgs; + if (imgs.length >= 3){ + if(this.data.lenMore==0){ + this.setData({ lenMore: 1 }); + } + return false; + } + + var imgs = this.data.imgs; + + wx.chooseImage({ + count: 1, // 默认9 + sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 + success: function (res) { + // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 + var tempFilePaths = res.tempFilePaths; + + getApp().request.uploadFile("/api/weshop/comment/uploadCommentImg", { + filePath: tempFilePaths[0], + name: "file", + success: function (e) { + if(e.data.code==0) { + that.data.uploadPath.push(e.data.data); + imgs.push(tempFilePaths[0]); + that.setData({ + imgs: imgs + }); + } + } + }); + } + }); + }, + // 删除图片 + deleteImg: function (e) { + var imgs = this.data.imgs; + var index = e.currentTarget.dataset.index; + imgs.splice(index, 1); + this.setData({ + imgs: imgs + }); + }, + // 预览图片 + previewImg: function (e) { + //获取当前图片的下标 + var index = e.currentTarget.dataset.index; + //所有图片 + var imgs = this.data.imgs; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs + }) + }, + + txtInpt:function (e) { + this.setData({ + content: e.detail.value + }) + }, + + onUnload: function () { + wx.navigateBack({ delta:1 }) + }, + + +}); \ No newline at end of file diff --git a/packageB/pages/user/add_comment/add_comment.json b/packageB/pages/user/add_comment/add_comment.json new file mode 100644 index 0000000..401e4e6 --- /dev/null +++ b/packageB/pages/user/add_comment/add_comment.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "评价宝贝", + "enablePullDownRefresh": false, + "usingComponents": { + "warn": "/components/long_warn/long_warn" + } +} \ No newline at end of file diff --git a/packageB/pages/user/add_comment/add_comment.wxml b/packageB/pages/user/add_comment/add_comment.wxml new file mode 100644 index 0000000..aecfbcd --- /dev/null +++ b/packageB/pages/user/add_comment/add_comment.wxml @@ -0,0 +1,114 @@ + + + + + + + + + {{options.goods_name}} + + + + + + {{options.price}} + + + + + x + {{options.goods_num}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 添加图片 + {{imgs.length>0?imgs.length:0}}/3 + + + + + + + + + + + + + + 宝贝评分 + + + + + + 描述相符 + + + + + + + + + 物流服务 + + + + + + + + 服务态度 + + + + + + + + + + + + + + + + + + 匿名评价 + + + + 提交评价 + + + + + \ No newline at end of file diff --git a/packageB/pages/user/add_comment/add_comment.wxss b/packageB/pages/user/add_comment/add_comment.wxss new file mode 100644 index 0000000..43c1670 --- /dev/null +++ b/packageB/pages/user/add_comment/add_comment.wxss @@ -0,0 +1,162 @@ +page{ + overflow-x: hidden; +} +/* 商品详情和评价 */ +.commoditymax{ + overflow-x: hidden; +} +.commodity { + height: 715rpx; + border-top: 6rpx solid rgb(245, 245, 245); + border-bottom: 6rpx solid rgb(245, 245, 245); + padding: 0rpx 30rpx; +} + +.commodity .information { + height: 286rpx; +} + +.commodity .information image { + width: 186rpx; + height: 186rpx; +} + +.information .goods_name { + width: 480rpx; + margin-left: 25rpx; + height: 186rpx; +} + +.information .goods_name .ellipsis-2 { + line-height: 40rpx; + height: 80rpx; +} + +.information .goods_name .jc_sb { + margin-top: 60rpx; + color: rgb(212, 28, 52); + margin-right: 7rpx; +} + +.information .goods_name .jc_sb .fs32 { + line-height: 40rpx; +} + +.information .goods_name .jc_sb .sum { + margin-right: 5rpx; +} + +.balin { + align-items: baseline; +} + +.addComment { + height: 345rpx; + width: 690rpx; + background-color: rgb(248, 248, 248); + padding: 32rpx 0rpx 21rpx 0rpx; +} + +.addComment textarea { + padding: 0rpx 18rpx; + height: 175rpx; + width: 654rpx; +} + +.addComment .addimages { + padding: 0rpx 18rpx; + margin-top: 20rpx; + align-items: flex-end; + width: 652rpx; +} + +.addComment .addimages .images { + height: 140rpx; +} + +.addComment .addimages .images .rel { + width: 140rpx; + height: 100%; + overflow: visible; + margin-right: 15rpx; +} + +.addComment .addimages .images image .abs { + width: 30rpx; + height: 30rpx; + top: -7rpx; + right: -7rpx; +} + +.addComment .addimage { + width: 139rpx; + height: 139rpx; + border: 2rpx dashed rgb(196, 196, 196); + font-size: 16rpx; + margin-left: 6rpx; +} + +.addComment .addimage image { + width: 60rpx; + height: 58rpx; +} + +.Grade { + width: 100%; + height: 310rpx; + border-bottom: 6rpx solid rgb(245, 245, 245); + padding-left: 45rpx; +} + +.Grade .title { + width: 100%; + height: 105rpx; +} + +.Grade .title .column { + height: 30rpx; + border-left: 6rpx solid rgb(211, 27, 58); + margin-right: 12rpx; +} + +.Grade .score-item { + height: 55rpx; + line-height: 55rpx; +} + +.Grade .score-item .stars { + margin-left: 83rpx; +} +.Grade .score-item .stars view{ + width: 60rpx; + height: 55rpx; +} + +.Grade .score-item .stars image { + width: 35rpx; + height: 35rpx; +} +.Whether { + padding:0rpx 31rpx; +} +.Whether .flex-right-vertical { + height: 67rpx; +} + +.Whether .flex-right-vertical .radio { + margin-right: 15rpx; +} + +.Whether .Submission { + margin: 40rpx 0 40rpx 0; +} + +.Whether .white { + width: 364rpx; + height: 58rpx; + background-color: rgb(212, 28, 52); + border-radius: 40rpx; + line-height: 58rpx; +} + + diff --git a/packageB/pages/user/collect_list/collect_list.js b/packageB/pages/user/collect_list/collect_list.js new file mode 100644 index 0000000..ea786ae --- /dev/null +++ b/packageB/pages/user/collect_list/collect_list.js @@ -0,0 +1,301 @@ +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; + }(require("../../../../utils/LoadMore.js")), + e = getApp(), + a = e.request, + o = new t.default(); +var oo = e.globalData.setting, + app_d = e.globalData; +var ut = require('../../../../utils/util.js'); + +Page({ + data: { + url: e.globalData.setting.imghost, + resourceUrl: e.globalData.setting.resourceUrl, + iurl: e.globalData.setting.imghost, + collects: null, + currentPage: 1, + curpage: 1, + ismore: 0, + iscollects: 0, + editEd: 0, //商品编辑按钮是否点击 + isall: false, //是否全选 + sum: 0, + total_collects: 0, + is_goods: 0, + pageSize: 8, //分页数量 + isdelete: 0 + }, + onLoad: function() { + + o.init(this, "", "collects"), + this.requestCollectList(); + }, + requestCollectList: function() { + var th = this; + e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize + "&user_id=" + + app_d.user_id + "&store_id=" + oo.stoid + "&page=" + th.data.currentPage; + o.request(e, function(e) { + th.data.currentPage++; + if (th.data.total_collects == 0) { + th.setData({ + iscollects: 1, + total_collects: e.data.data.total + }) + } + if (th.data.total_collects < th.data.pageSize) { + + th.setData({ + is_goods: 1 + }) + var goods_list = th.selectComponent("#goods_recommend"); //组件的id + if (goods_list) + { + goods_list.init(); + setTimeout(function () { goods_list.get_list(); }, 300) + } + } + }); + }, + + //--到底部刷新--- + onReachBottom: function() { + if ((this.data.currentPage - 1) * this.data.pageSize < this.data.total_collects) { + this.requestCollectList(); + } else { + if (this.data.is_goods == 0) this.setData({ + is_goods: 1 + }); + var goods_list = this.selectComponent("#goods_recommend"); //组件的id + goods_list.get_list(); + } + + }, + + //--取消收藏--- + cancelCollect: function(t) { + var e = t.currentTarget.dataset.id, + o = this; + a.delete("/api/weshop/goodscollect/del/" + oo.stoid + "/" + e, { + success: function(t) { + o.deleteItemData(e); + } + }); + }, + deleteItemData: function(t) { + for (var e = 0; e < this.data.collects.length; e++) + if (this.data.collects[e].collect_id == t) { + this.data.collects.splice(e, 1), this.setData({ + collects: this.data.collects + }); + break; + } + }, + //图片失败,默认图片 + bind_bnerr: function(e) { + var _errImg = e.currentTarget.dataset.errimg; + var _errObj = {}; + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + + }, + + requestList: function() { + + var e = this; + a.get("/api/weshop/goods/page", { + isShowLoading: 0, + data: { + store_id: 1, + user_id: oo.user_id, + page: e.data.curpage, + pageSize: 10 + }, + success: function(t) { + e.data.curpage++; + var arr1 = e.data.collects_Recommend; + var arr2 = t.data.data.pageData; + var arr3 = [...arr1, ...arr2]; + + var ismore = 0; + if (arr3.length == t.data.data.total) ismore = 1 + + e.setData({ + collects_Recommend: arr3, + total_goods: t.data.data.total, + ismore_goods: ismore, + loadName: null + }), wx.stopPullDownRefresh(); + } + }); + }, + + + goto: function(ee) { + getApp().goto("/pages/index/index/index"); + + }, + //编辑商品显示 + editcollects: function() { + var th = this.data; + var t = this; + if (th.editEd == 0) { + t.select_checked(false, null) + t.setData({ + editEd: 1, + isall:0 + }) + } else { + t.select_checked(false, null) + t.setData({ + editEd: 0 + }) + } + }, + iconClick: function(e) { + var th = this.data; + var index = e.currentTarget.dataset.index; + var url = e.currentTarget.dataset.url; + + var item=this.data.collects[index]; + if(url){ + console.log("---"); + console.log(item.add_time); + console.log(ut.gettimestamp()); + + if(ut.gettimestamp()-item.add_time<3600*24 && item.guide_id>0) + url+="&c_guide_id="+item.guide_id; + getApp().goto(url); + return false; + } + var collect = "collects[" + index + "].checked"; + if (this.data.collects[index].checked == true) { + this.setData({ + [collect]: false, + isall: 0, + sum: --th.sum + }) + } else { + var id = th.collects[index].collect_id; + this.setData({ + [collect]: true, + sum: ++th.sum + }) + if (th.sum == th.collects.length) { + this.setData({ + isall: 1 + }) + } + } + }, + //全选为收藏商品checked为true + allClick: function() { + var th = this; + var list = th.data.collects; + //判断是否全选 + if (th.data.isall) { + for (var i = 0; i < list.length; i++) { + list[i].checked = false; + } + this.setData({ + sum: 0, + isall: 0, + collects: list + }) + } else { + for (var i = 0; i < list.length; i++) { + list[i].checked = true; + } + this.setData({ + sum: th.data.collects.length, + collects: list, + isall: 1 + }) + } + }, + + //分页删除 + alldelete: function(e) { + + var th = this; + if (th.data.isdelete) return false; + // 全选的话直接删除 + if (th.data.isall) { + a.delete("/api/weshop/goodscollect/removeUser/" + oo.stoid + "/" + app_d.user_id, { + isShowLoading: 0, + success: function(e) { + th.setData({ + collects: [], + total_collects: 0, + isdelete:0 + }) + getApp().my_warnning("取消成功", 1, th); + + } + }) + } else { //按照多个id删除收藏商品 + + var new_colls = []; + var collectId = th.data.collects; + + var str = ""; + for (var i = 0; i < th.data.collects.length; i++) { + if (collectId[i].checked) { + str += collectId[i].collect_id + ","; + } else { + new_colls.push(collectId[i]); + } + } + if(str.length==""){ + getApp().my_warnning("请选择商品", 0, th); + return false; + } + th.setData({ + isdelete: 1 + }) + str = str.substr(0, str.length - 1); + var url = "/api/weshop/goodscollect/removeByIds/" + oo.stoid + "/" + app_d.user_id + "/" + str; + + a.delete(url, { + isShowLoading: 0, + success: function(e) { + th.setData({ + collects: new_colls, + sum: 0, + total_collects: new_colls.length, + isdelete: 0 + }) + // th.select_checked(false,null); + getApp().my_warnning("取消收藏成功", 1, th); + } + + }) + + } + }, + select_checked: function(check, sum) { + var th = this; + if (sum == null) { + for (var i = 0; i < this.data.collects.length; i++) { + var collect = "collects[" + i + "].checked"; + th.setData({ + [collect]: check, + sum:0 + }) + } + } else { + var collect = "collects[" + sum + "].checked"; + th.setData({ + [collect]: check + }) + } + }, + + go_to: function(e) { + var th = this; + var url = e.currentTarget.dataset.url; + getApp().goto(url); + } +}); \ No newline at end of file diff --git a/packageB/pages/user/collect_list/collect_list.json b/packageB/pages/user/collect_list/collect_list.json new file mode 100644 index 0000000..64db42e --- /dev/null +++ b/packageB/pages/user/collect_list/collect_list.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我的收藏", + "enablePullDownRefresh": false, + "usingComponents": { + "warn": "/components/long_warn/long_warn", + "goods_recommend": "/components/goods_list/goods_list" + } +} \ No newline at end of file diff --git a/packageB/pages/user/collect_list/collect_list.wxml b/packageB/pages/user/collect_list/collect_list.wxml new file mode 100644 index 0000000..00f5f3b --- /dev/null +++ b/packageB/pages/user/collect_list/collect_list.wxml @@ -0,0 +1,110 @@ + + + + + + 当前暂无收藏 + + + 去首页逛逛 + + + + + + + + + + 共{{total_collects}}件商品 + {{editEd==1?'完成':'编辑'}} + + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + + + + + + + + {{item.shop_price}} + + + + 零售价: + ¥{{item.market_price}} + + + + + + 找相似 + + + + + + + + + + + + + + + + + + + + + + 好物推荐 + + + + + + + + + + + + + + + 全选 + + + + 已选 + {{sum>0?sum:'0'}} 件 + + + + {{isdelete==0?'删除':'删除中'}} + + + + \ No newline at end of file diff --git a/packageB/pages/user/collect_list/collect_list.wxss b/packageB/pages/user/collect_list/collect_list.wxss new file mode 100644 index 0000000..efd2d00 --- /dev/null +++ b/packageB/pages/user/collect_list/collect_list.wxss @@ -0,0 +1,521 @@ +/* .collect-ul { + width: 100%; + background-color: #f0f2f5; +} + +.collect-li { + width: 50%; + background-color: white; + box-sizing: border-box; + display: inline-block; + border: 1rpx solid #f0f2f5; + margin-top: -5rpx; +} + +.collect-img { + width: 100%; + height: 375rpx; +} + +.collect-name { + font-size: 32rpx; + line-height: 36rpx; + padding: 0 10rpx; + margin: 10rpx 0; + height: 72rpx; +} + +.collect-footer { + font-size: 32rpx; + padding: 10rpx 10rpx; + overflow: hidden; +} + +.collect-price { + color: red; + display: inline-block; +} + +.collect-btn { + padding: 6rpx 10rpx; + height: 36rpx; + border: 1rpx solid #bfbfbf; + float: right; + text-align: center; + margin-left: 5rpx; + border-radius: 5rpx; + color: #686868; + font-size: 30rpx; +} */ + +page { + width: 100%; + background-color: rgb(245, 245, 245); + overflow-x: hidden; +} + +.Collection { + overflow-x: hidden; +} + +/* vip开卡框架 */ + +.vip { + width: 100%; + height: 70rpx; + background-color: rgb(250, 242, 219); + font-size: 25rpx; + padding: 0rpx 31rpx; +} + +.vip .vip_image { + width: 40rpx; + height: 40rpx; + background-color: rgb(55, 45, 13); + border-radius: 50%; + line-height: 70rpx; +} + +.vip .vip_image image { + width: 25rpx; + height: 25rpx; + line-height: 70rpx; +} + +.vip .vip_describe { + width: 502prx; + margin-left: 20rpx; + padding-right: 172rpx; + line-height: 70rpx; + border-right: 4rpx solid #000; + height: 25rpx; +} + +.vip .vip_describe .vip_province_money { + color: rgb(254, 0, 0); +} + +.vip .vip_card { + margin-left: 17rpx; + line-height: 70rpx; +} + +.vip .vip_card .vip_go_image { + margin-left: 10rpx; +} + +.vip .vip_card .vip_immediately { + color: rgb(56, 47, 14); +} + +.vip .vip_card .vip_go_image image { + width: 35rpx; + height: 35rpx; +} + +.commodity { + width: 100%; +} + +/* 无收藏样式 */ + +.noCollection image { + width: 329rpx; + height: 229rpx; + margin-top: 202rpx; +} + +.noCollection .xc-ash { + margin-top: 41rpx; + font-weight: 600px; +} + +.noCollection navigator { + margin-top: 73rpx; + border-radius: 40rpx; +} + +.noCollection navigator view { + width: 247rpx; + height: 56rpx; + background-color: rgb(255, 72, 72); + border-radius: 40rpx; +} + +/* 商品详情 */ + +.commodity .sum { + font-size: 28rpx; + height: 70rpx; + background-color: rgb(245, 245, 245); + padding-left: 31rpx; + color: rgb(131, 131, 131); +} + +.commodity .sum view { + height: 100%; + letter-spacing: 1rpx; +} + +.commodity .sum .editEd { + width: 100rpx; + padding-right: 31rpx; +} + +.colls_max { + padding-left: 30rpx; +} + +.commodity .collects_max .collect { + width: 100%; + height: 244rpx; + border-bottom: 4rpx solid rgb(245, 245, 245); + background-color: rgb(255, 255, 255); + padding-right: 31rpx; +} + +.commodity .collects_max .collect .collect_image { + height: 183rpx; + width: 183rpx; + margin-left: 31rpx; +} + +.commodity .collects_max .collect .iconrp { + margin-left: 0rpx; +} + +.commodity .collects_max .collect .collect_image image { + width: 183rpx; + height: 183rpx; +} + +.commodity .collects_max .collect .attribute { + line-height: 68rpx; + height: 183rpx; + margin-left: 21rpx; + width: 70%; + +} + +.commodity .collects_max .collect .attribute .attribute_name { + height: 68rpx; + align-items: center; +} + +.commodity .collects_max .collect .attribute .attribute_name .name { + line-height: 35rpx; +} + +.commodity .collects_max .collect .attribute .attribute_money { + margin-top: 60rpx; + display: flex; + justify-content: space-between; + height: 50rpx; + align-items: flex-end; +} + +.commodity .collects_max .money_left { + height: 54rpx; +} + +.commodity .collects_max .collect .attribute .attribute_money .money_left .price { + font-weight: 1000rpx; + color: rgb(212, 28, 52); + margin-right: 10rpx; + align-items: baseline; +} + +.commodity .collects_max .collect .attribute .attribute_money .money_right { + align-items: flex-end; + padding-bottom: 1rpx; +} + +.commodity .collects_max .collect .attribute .attribute_money .money_right .similar { + width: 97rpx; + height: 35rpx; + border-radius: 21rpx; + border: 1rpx solid rgb(162, 162, 162); + margin-right: 22rpx; + color: rgb(110,110, 110); + align-items: center; +} + +.commodity .collects_max .collect .attribute .attribute_money .money_right view { + height: 30rpx; + line-height: 30rpx; +} + +.commodity .collects_max .collect .attribute .attribute_money .money_right image { + width: 35rpx; + height: 35rpx; + margin-right: 10rpx; + margin-bottom: 1rpx; +} + +.line { + align-items: baseline; +} + +.title .collect { + background-color: rgb(255, 255, 255); +} + +/* 热门好物 */ + +/* .title .China { + width: 100%; + margin-top: 50rpx; + margin-bottom: 10rpx; + line-height: 0rpx; +} + +.title .China .lin view { + width: 2rpx; +} + +.title .China .le { + height: 40rpx; + color: rgb(51,51, 51); +} + +.title .China .line .one { + height: 23rpx; + background-color: #000; + margin-left: 5rpx; +} + +.title .China .line .two { + height: 15rpx; + background-color: #000; + margin-left: 5rpx; +} + +.title .China .line .three { + height: 18rpx; + background-color: #000; + margin-left: 5rpx; +} + +.title .China .Recommend { + margin: 0rpx 20rpx; + font-size: 28rpx; + line-height: 39rpx; + font-weight: bold; +} + +.title .english .silk { + width: 214rpx; + height: 2rpx; + background-color: #000; +} + +.title .english .esh { + margin: 0rpx 15rpx; +} */ + +/* .collects { + margin-top: 40rpx; +} */ + +.Recommend { + height: 80rpx; + padding-top: 7rpx; +} + +.Recommend .lin { + width: 210rpx; + height: 2rpx; + background-color: rgb(167, 167, 167); +} + +.Recommend .flex-center { + margin: 0 20rpx; + color: rgb(51, 51, 51); + font-weight: bold; +} + +.Recommend .flex-center image { + margin-right: 5rpx; + width: 32rpx; + height: 29rpx; +} + +.hang { + width: 100%; + margin: auto; + padding-left: 31rpx; +} + +.hang .collect { + width: 335rpx; + height: 503rpx; + border-radius: 23rpx; + border: 1rpx solid rgb(214, 214, 214); + overflow: hidden; + margin-right: 14rpx; + margin-bottom: 10rpx; +} + +.collect .bottom { + padding: 0rpx 16rpx; +} + +.collect .bottom .goods_name { + height: 68rpx; +} + +.collect .sp { + width: 100%; + height: 315rpx; +} + +.collect .money { + margin-top: 40rpx; + line-height: 28rpx; + align-items: baseline; +} + +.collect .money view { + display: flex; + align-items: baseline; + font-weight: 1000rpx; +} + +.collect .Discount { + width: 156rpx; + height: 28rpx; + border-radius: 20rpx; + background-color: rgb(56, 56, 56); + font-size: 18rpx; + color: rgb(255, 255, 255); +} + +.collect .Discount image { + height: 18rpx; + width: 18rpx; + line-height: 28rpx; + margin-right: 3rpx; +} + +.collect.ml20 { + margin-left: 13rpx; +} + +.fs24.dollar { + padding: 0rpx; +} + +.through { + text-decoration: line-through; + color: rgb(155, 155, 155); + margin-left: 7rpx; +} + +.money .price { + margin-left: 12rpx; + text-decoration: line-through; +} + +.money .price view { + display: flex; + align-items: flex-end; +} + +.province { + line-height: 28rpx; +} + +.nothing { + height: 75rpx; + width: 100%; +} + +.nothing .no_content { + margin: 0rpx 11rpx; + color: rgb(138, 138, 138); +} + +.nothing .Foil { + width: 80rpx; + height: 2rpx; + background-color: rgb(138, 138, 138); +} + +.iconUn { + margin-left: 15rpx; + margin-right: 21rpx; + transform: scale(1.0); +} + +.Un { + margin-left: 0rpx; +} + +.iconClick { + margin-left: 21rpx; + margin-right: 16rpx; +} + +.radioCheck { + height: 100%; + display: flex; + align-items: center; + width: 65rpx; + justify-content: center; +} + +.scale { + transform: scale(0.8); +} + +.load { + width: 100%; + height: 80rpx; + padding: 0rpx 31rpx; +} + +.abs { + position: fixed; + left: 0rpx; + bottom: 0rpx; + height: 100rpx; + background-color: rgb(255, 255, 255); + width: 100%; + border-top: 1rpx solid #eee; +} + +.abs .left { + display: flex; + justify-content: space-between; + width: 515rpx; + padding-left: 31rpx; +} + +.abs .allClick { + margin-left: 31rpx; +} + +.abs icon { + margin-right: 31rpx; +} + +.abs .delete { + width: 235rpx; + height: 100%; + background-color: rgb(219, 27, 52); +} +.abs .Deleting{ + background-color: rgb(131, 131, 131); +} +.abs .Number { + margin-right: 18rpx; + letter-spacing: 0rpx; + font-size: 32rpx; + height: 55rpx; + +} +.goods_num{ + height: 55rpx; +line-height: 55rpx; + +} \ No newline at end of file diff --git a/packageB/pages/user/comment/comment.js b/packageB/pages/user/comment/comment.js new file mode 100644 index 0000000..9922c98 --- /dev/null +++ b/packageB/pages/user/comment/comment.js @@ -0,0 +1,158 @@ +var ut = require("../../../../utils/util.js"); +var t = function(t) { + return t && t.__esModule ? t : { + default: t + }; + }(require("../../../../utils/LoadMore.js")), + e = getApp(), + rq = e.request, + a = new t.default(), + s = require("../../../../utils/util.js"), + oo = e.globalData, + os = e.globalData.setting; +var regeneratorRuntime = require('../../../../utils/runtime.js'); + +Page({ + data: { + url: e.globalData.setting.url, + resourceUrl: e.globalData.setting.imghost, + iurl: e.globalData.setting.imghost, + categories: [{ + name: "全部评价", + status: 2 + }, { + name: "待评价", + status: 0 + }, { + name: "已评价", + status: 1 + }], + activeStatus: 0, + comments: null, + currentPage: 1, + isloaded: 0, + order_id:0, + is_no_more:0, + }, + onLoad: function(t) { + var e = void 0 === t.status ? this.data.activeStatus : t.status; + this.data.order_id=t.order_id; + + //a.init(this, "", "comments"), + //this.requestComments(e); + this.requestComments_new(e); + }, + onShow: function() { + wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1), + this.resetData(), this.requestComments_new(this.data.activeStatus)); + }, + changeTab: function(t) { + var e = this; + if (this.data.activeStatus == t.currentTarget.dataset.status) + return false; + this.resetData(), this.requestComments_new(t.currentTarget.dataset.status); + }, + + requestComments_new:async function(t){ + var e = this, th = e, n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage; + this.setData({ + activeStatus: t + }); + + if(e.data.order_id) n+="&order_id="+e.data.order_id; + var rq_data={store_id: os.stoid, user_id: oo.user_id}; + if (t!= 2) {rq_data['is_comment']=t;} + + var rs_data=null,com_data=this.data.comments; + await getApp().request.promiseGet(n,{data:rq_data}).then(res=>{ + e.data.currentPage++ + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + rs_data=res.data.data.pageData; + }else{ + th.setData({ is_no_more: 1, }) + } + }) + + if(rs_data){ + for(var ind in rs_data ){ + var em=rs_data[ind] + await getApp().request.promiseGet("/api/weshop/comment/pageComment", { + data:{ store_id: os.stoid, goods_id: em.goods_id, + pageSize: 3, parent_id: em.comment_id, page:1} + }).then(res=>{ + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) + rs_data[ind].replay_list=res.data.data.pageData; + }) + if (em.img != undefined && em.img != null && ut.isString(em.img)) rs_data[ind].img = ut.unserialize(em.img); + var str = em.weapp_img; + if (str != "" && ut.isString(str)) rs_data[ind].weapp_img = JSON.parse(str); + rs_data[ind].original_img=this.data.iurl+rs_data[ind].original_img; + } + + if(!com_data) com_data=rs_data; + else com_data= com_data.concat(rs_data); + th.setData({ comments: com_data }) + } + + th.setData({isloaded: 1,}) + }, + + onReachBottom: function() { + if(this.data.is_no_more) return false; + //a.canloadMore() && this.requestComments(this.data.activeStatus); + this.requestComments_new(this.data.activeStatus); + }, + + + onPullDownRefresh: function(t) { + this.resetData(), this.requestComments_new(this.data.activeStatus); + }, + resetData: function() { + this.data.comments = null, this.data.currentPage = 1, this.data.is_no_more=0, a.resetConfig(); + }, + /*-----评论-----*/ + comment: function(t) { + for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++); + if (!(s >= a.length)) { + var n = "?order_id=" + a[s].order_id; + n += "&goods_id=" + a[s].goods_id, n += "&price=" + a[s].goods_price; + wx.navigateTo({ + url: "/packageB/pages/user/add_comment/add_comment" + n + }); + } + }, + + //图片失败,默认图片 + bind_bnerr2: function(e) { + var th = this; + var _errImg = e.currentTarget.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif"; + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, + //预览图片 + previewImg: function(e) { + var index = e.currentTarget.dataset.index; + var sindex = e.currentTarget.dataset.sindex; + var name = e.currentTarget.dataset.name; + var imgArr = this.data.comments; + var image = null; + if (name == "img") { + image = imgArr[index].img[sindex]; + } else { + image = imgArr[index].weapp_img[sindex]; + } + wx.previewImage({ + current: image, + //当前图片地址 + urls: imgArr[index].weapp_img, //所有要预览的图片的地址集合 数组形式 + }) + }, + //跳到首页 + goto: function(ee) { + wx.navigateTo({ + url: '/pages/index/index/index', + }) + }, + +}); \ No newline at end of file diff --git a/packageB/pages/user/comment/comment.json b/packageB/pages/user/comment/comment.json new file mode 100644 index 0000000..2b3db22 --- /dev/null +++ b/packageB/pages/user/comment/comment.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "我的评价" +} \ No newline at end of file diff --git a/packageB/pages/user/comment/comment.wxml b/packageB/pages/user/comment/comment.wxml new file mode 100644 index 0000000..ad7859b --- /dev/null +++ b/packageB/pages/user/comment/comment.wxml @@ -0,0 +1,127 @@ + + + + + {{item.name}} + + + + + + + + + + 当前暂无评价 + + + 去首页逛逛 + + + + + + + + + + + 订单编号:{{item.order_sn}} + + {{item.comment_id>0?'已评价':'待评价'}} + + + + + + + + + + + + + + {{item.goods_name}} + + + {{item.goods_color+item.goods_spec.length>-1?item.goods_color+item.goods_spec:'规格1'}} + + + + + + + + {{filter.toFix(item.goods_price,2)}} + + x{{item.goods_num}} + + + + + + + + + 评价: + + + + + + {{item.content.length>0?item.content:'此用户没有填写评论'}} + + + + + + + + + + 店家回复: + + {{r_item.content}} + + + + + + {{item.comment_addtime}} + + + + + + + 共{{item.goods_num}}件商品 + + + 合计: + + + {{filter.toFix(item.goods_price,2)}} + + + + + + 查看订单 + + + + 查看评价 + + + + 去评价 + + + + + + + 已经加载到底部 + + \ No newline at end of file diff --git a/packageB/pages/user/comment/comment.wxss b/packageB/pages/user/comment/comment.wxss new file mode 100644 index 0000000..3ca00d8 --- /dev/null +++ b/packageB/pages/user/comment/comment.wxss @@ -0,0 +1,215 @@ +.padding { + padding: 0rpx 27rpx; +} + +.container { + background-color: rgb(255, 255, 255); +} + +.type-navbar { + white-space: nowrap; + display: flex; + height: 80rpx; + background-color: #fff; + border-top: 2rpx solid rgb(221, 221, 221); + justify-content: space-between; + color: rgb(51, 51, 51); +} + +.type-box { + box-sizing: border-box; + line-height: 76rpx; + text-align: center; + display: inline-block; + overflow: hidden; +} + +.type-navbar-item { + border-bottom: 4rpx solid #fff; +} + +.type-item-on { + /* width: 146rpx; */ + border-bottom: 7rpx solid #e64340; +} + +.border_bottom { + border-bottom: 3rpx solid rgb(245, 245, 245); +} + +/* 无评价 */ + +.noCollection image { + width: 329rpx; + height: 229rpx; + margin-top: 202rpx; +} + +.noCollection .xc-ash { + margin-top: 10rpx; + font-weight: 600px; +} + +.noCollection navigator { + margin-top: 60rpx; + border-radius: 40rpx; +} + +.noCollection navigator view { + width: 247rpx; + height: 56rpx; + background-color: rgb(255, 72, 72); + border-radius: 40rpx; +} + +/* 待评价栏 */ + +.Commodity_number { + height: 70rpx; + border-top: 13rpx solid rgb(245, 245, 245); +} + +/* 文字基线对齐 */ + +.baseline { + display: flex; + align-items: baseline; +} + +/* 单个商品框架 */ + +.detail_commodity { + height: 231rpx; +} + +.detail_commodity image { + width: 185rpx; + height: 185rpx; +} + +.detail_commodity .goods_name { + width: 485rpx; + /* height: 75rpx; */ + line-height: 37rpx; +} + +.Commodity_content { + height: 185rpx; + margin-left: 21rpx; +} + +.Commodity_content .Commodity_goods { + height: 150rpx; +} + +.Commodity_content .Commodity_money { + font-size: 16rpx; +} + +/* 商品评价按钮框架 */ + +.commodity_evaluate { + height: 110rpx; + padding-top: 15rpx; +} + +.commodity_evaluate .commodity_smy .commodity_money { + margin-left: 29rpx; + letter-spacing: 1rpx; +} + +.commodity_evaluate .commodity_To_evaluate { + width: 128rpx; + height: 39rpx; + border-radius: 9rpx; +} + +.commodity_evaluate .commodity_To_evaluate view { + height: 39rpx; + line-height: 39rpx; +} + +.commodity_evaluate .comment_go { + margin-left: 20rpx; + background-color: rgb(211, 28, 52); + color: rgb(255, 255, 255); + border: 2rpx solid rgb(211, 28, 52); +} + +.Commodity_spec { + width: 106rpx; + background-color: rgb(236, 236, 236); + border-radius: 7rpx; + font-size: 18rpx; + margin-top: 10rpx; +} + +.Commodity_spec view { + height: 28rpx; + align-items: center; +} + +.Commodity_evaluation .Comment_content { + color: rgb(153, 153, 153); + letter-spacing: 1rpx; +} + +.Commodity_evaluation .starss { + height: 58rpx; + /* // line-height: 58rpx; */ + align-items: center; +} + +.Commodity_evaluation .commen { + height: 58rpx; + line-height: 58rpx; +} + +.Commodity_evaluation .starss .stars { + line-height: 58rpx; +} + +.Commodity_evaluation .starss .stars image { + width: 29rpx; + height: 26rpx; + margin-right: 5rpx; +} + +.Commodity_evaluation .Comment_images image { + width: 100rpx; + height: 100rpx; + margin-right: 8rpx; + margin-top: 18rpx; + border-radius: 6rpx; + border: 2rpx solid rgb(245, 245, 245); + margin-left: 15rpx; +} + +.commodity_evaluate .View_evaluation { + border: 2rpx solid rgb(179, 179, 179); + color: rgb(0, 0, 0); + background-color: rgb(255, 255, 255); +} + +.comment_addtime { + height: 50rpx; +} + +.title_width { + width: 146rpx; + text-align: center; +} + +.shop-font { + color: rgb(153, 153, 153); +} + +.reply { + margin-top: 10rpx; +} + +.get_bottom { + text-align: center; + color: #999; + margin-bottom: 20rpx; +} diff --git a/packageB/pages/user/user_coupon/c_filter.wxs b/packageB/pages/user/user_coupon/c_filter.wxs new file mode 100644 index 0000000..b1d896d --- /dev/null +++ b/packageB/pages/user/user_coupon/c_filter.wxs @@ -0,0 +1,63 @@ +var filters = { + toFix:function(val,count){ + return val.toFixed(count) + }, + format_time:function(ts,isFull) { + var d = getDate(ts*1000) + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); + if(isFull==1) + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') + return fm; + }, + setcolor:function(ind){ + if(ind==0) return "red"; + if(ind==1) return "green"; + if(ind==2) return "blue"; + if(ind==11) return "green"; + if(ind==12) return "blue"; + return ""; + }, + setbgcolor: function (ind) { + if (ind == 0) return "#ffa1b9"; + if (ind == 1) return "#59e1d2"; + if (ind == 2) return "#a3bcff"; + if (ind == 11) return "#59e1d2"; + if (ind == 12) return "#a3bcff"; + return ""; + }, + + get_type:function(ind){ + if (ind == 0) return "全场通用"; + if (ind == 1) return "品牌"; + if (ind == 2) return "品类"; + if (ind == 11) return "用途"; + if (ind == 12) return "分类1"; + return ""; + }, + get_type_card:function(ind){ + if (ind == 0) return "全场通用"; + if (ind == 1) return "指定品牌"; + if (ind == 2) return "指定品类"; + if (ind == 11) return "指定用途"; + if (ind == 12) return "指定分类1"; + return ""; + }, + format_huiche:function (text) { + if (!text) { + return ""; + } + var reg = getRegExp('\\\\n', 'g') + return text.replace(reg, '\n') + } +} + +module.exports = { + toFix: filters.toFix, + format_time:filters.format_time, + setcolor:filters.setcolor, + setbgcolor: filters.setbgcolor, + get_type: filters.get_type, + get_split_name: filters.get_split_name, + get_type_card: filters.get_type_card, + format_huiche: filters.format_huiche, +} \ No newline at end of file diff --git a/packageB/pages/user/user_coupon/filter.wxs b/packageB/pages/user/user_coupon/filter.wxs new file mode 100644 index 0000000..c0e8d13 --- /dev/null +++ b/packageB/pages/user/user_coupon/filter.wxs @@ -0,0 +1,11 @@ +var format = function (text) { + if (!text) { + return + } + var reg = getRegExp('\\\\n', 'g') + return text.replace(reg, '\n') +} + +module.exports = { + format: format +} diff --git a/packageB/pages/user/user_coupon/user_coupon.js b/packageB/pages/user/user_coupon/user_coupon.js new file mode 100644 index 0000000..fa5d7a4 --- /dev/null +++ b/packageB/pages/user/user_coupon/user_coupon.js @@ -0,0 +1,159 @@ +var e = getApp(),os = e.globalData.setting; +var utils = require('../../../../utils/util.js'); +var regeneratorRuntime = require('../../../../utils/runtime.js'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + judge:0, + quan_list:null, + iurl:os.imghost, + h_pic:null, + GradeId:null, + FormId:null, + now:'', + }, + clik_coupon:function(){ + this.setData({ + judge:1 + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log("onLoad"); + console.log(options); + var h_pic=options.img; + + if(h_pic.indexOf("http")==-1){ + h_pic= os.imghost+h_pic; + } + + var FormId=options.FormId; + var GradeId=options.gradeId; + var now=utils.gettimestamp(); + this.setData({h_pic:h_pic,GradeId:GradeId,FormId:FormId,now:now}); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow:async function () { + var th = this,q_list=null; + + //--获取列表-- + await getApp().request.promiseGet("/api/weshop/users/grade/wechat/cash/page", { + data:{ storeId:os.stoid,FormId:th.data.FormId,GradeId:th.data.GradeId,userId:getApp().globalData.user_id} + }).then(res => { + q_list = res.data.data.pageData; + }) + //取分类最后一级 + for(var i in q_list){ + var name=q_list[i].UseObjectName; + var arr=name.split("\\") + q_list[i].UseObjectName=arr[arr.length-1]; + q_list[i].Remark = q_list[i].Remark.replace(/\n/g, "\n") + } + th.setData({quan_list:q_list}); + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + //获取券 + get_quan:function (e) { + var th=this,index=e.currentTarget.dataset.ind; + var item = this.data.quan_list[index]; + var can_get = item.ObtainTimes; + var Obtain = item.Obtain; + var Id = item.Id; + + if (!Obtain || Obtain == undefined) Obtain = 0; + + getApp().request.post("/api/weshop/users/grade/cash/insert",{ + data:{ + privilegeId:Id, + storeId:os.stoid, + userId:getApp().globalData.user_id, + }, + success:function (e) { + if(e.data.code==0){ + var txt="quan_list["+index+"].ObtainTimes" + var obj={};obj[txt]=can_get-1; + + var text = "quan_list[" + index + "].Obtain"; Obtain++; + obj[text] = Obtain; + th.setData(obj); + getApp().my_warnning("您已成功领取该券",1,th); + } + } + }) + }, + + //点击核销券 + get_out:function (e) { + var qt_txt = this.selectComponent("#pop_txt"); //组件的id + var ob={title:"温馨提示",content:"当前优惠券已领取,点击二维码可立即使用"}; + qt_txt.open(ob); + + }, + + clik_coupon:function (e) { + var ind=e.currentTarget.dataset.ind; + var is_open=this.data.quan_list[ind].is_open; + if(is_open==1) is_open=0; + else is_open=1; + + var txt="quan_list["+ind+"].is_open" + var obj={};obj[txt]=is_open; + this.setData(obj); + }, + + //--显示核销券-- + show_quan:function (e) { + var ind=e.currentTarget.dataset.ind; + var item=this.data.quan_list[ind]; + var pId=this.data.quan_list[ind].Id; + var th=this; + var validay = item.Validay; + var now = e.currentTarget.dataset.now; + + getApp().request.get("/api/weshop/users/grade/cash/code/get",{ + data:{ + storeId:os.stoid, + privilegeId:pId, + userId:getApp().globalData.user_id, + }, + success:function (e) { + console.log(e); + console.log('/code/get'); + var name= e.data.data.UseObjectName; + + //--获取成功的时候-- + if(e.data.code==0){ + var no=e.data.data.CashRepNo; + var qc_com = th.selectComponent("#qc_com"); //组件的id + var obj={val:no,content:"请将二维码展示给核销员,抵券更快捷",now: now, validay: validay, name: name,is_quan:1}; + qc_com.open(obj) + + }else{ + var qt_txt = this.selectComponent("#pop_txt"); //组件的id + var ob={title:"温馨提示",content:"您暂时还没有该券"}; + qt_txt.open(ob); + } + + } + }) + + + } + +}) \ No newline at end of file diff --git a/packageB/pages/user/user_coupon/user_coupon.json b/packageB/pages/user/user_coupon/user_coupon.json new file mode 100644 index 0000000..31d3bbc --- /dev/null +++ b/packageB/pages/user/user_coupon/user_coupon.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "我的优惠券", + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "pop_txt": "/components/userqy_pop_up/userqy_pop_up", + "warn": "/components/long_warn/long_warn" + } +} \ No newline at end of file diff --git a/packageB/pages/user/user_coupon/user_coupon.wxml b/packageB/pages/user/user_coupon/user_coupon.wxml new file mode 100644 index 0000000..7b6df4a --- /dev/null +++ b/packageB/pages/user/user_coupon/user_coupon.wxml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x{{item.ObtainTimes}} + + + + + + {{item.CashSum}} + + + + 无使用门槛 + + + 满{{item.BuySum}}元可用 + + + + + + + + + + + + + + + {{filter.get_type_card(item.UseObjectType)}} + + {{item.PrivilegeName}} + + + + {{filter.format_time(now)}}至{{item.Validay}} + + + + + + + + + + + 立即领取 + 已领取 + + + + + 优惠券使用说明 + + + + + + + + + + + + {{util.format(item.Remark)}} + + + + + + + + + + + + + + + + + + + + diff --git a/packageB/pages/user/user_coupon/user_coupon.wxss b/packageB/pages/user/user_coupon/user_coupon.wxss new file mode 100644 index 0000000..53b47d6 --- /dev/null +++ b/packageB/pages/user/user_coupon/user_coupon.wxss @@ -0,0 +1,181 @@ +.xc-coupon-img{ + width: 100%; + height: 330rpx; +} +.xc-coupon-frame{ + width: 710rpx; + height:auto; + margin: 0 auto; + +} +.xc-coupon-frame .coupon-frame{ + width: 100%; + height: 200rpx; + margin-top:10rpx; + +} +.xc-coupon-frame .coupon-frame .coupon-left{ + width: 215rpx; + height:100%; + overflow: hidden; +} +.xc-money-frame{ + width:96%; + margin-top: -10px; +} + +.xc-rmb-symbol{ + font-size:36rpx; + font-weight: bold +} + +.xc-rmb-val{ + font-size:78rpx; + font-weight: bolder +} +.coupon-explain{ + font-size:25rpx; +width:100%; + + +} +.xc-valuer{ + margin-top:39rpx; + margin-left:28rpx; + font-size:25rpx; +} +.coupon-frame .oval{ + width:155rpx; + height:83rpx; + border-radius: 50%; + right:-78rpx; + top:-37rpx; +} +.coupon-right{ + width:490rpx; + height: 99%; + border-top: 1rpx solid #eaeaea; + border-bottom: 1rpx solid #eaeaea; + border-right: 1rpx solid #eaeaea; + +} +.coupon-annotation{ + width: 95%; + height: 100%; + +} +.xc-brand{ + width:100rpx; + height:35rpx; + line-height: 35rpx; + font-size:21rpx; + border-radius:10rpx; position: relative; top:-1px; +} +.top-frame{ + width:82%; + height: 75rpx; + margin-top:10rpx; + +} +.top-frame .coupon-wode{ + font-size: 25rpx; + margin-left:10rpx; + width:340rpx; + height:88rpx; +} +.coupon-code{ + width:60rpx; + height:60rpx; + margin-top:5rpx; + +} +.frame{ + width: 100% +} +.coupon-time{ + font-size: 23rpx; + line-height:33rpx; + color: #7d7d7d; +} + +.clik-get{ + width:125rpx; + height:45rpx; + border-radius: 25rpx; + line-height: 45rpx; + font-size:25rpx; + bottom:67rpx; + right:6px; +} + +.code-img{ + margin-left:20rpx; +} +.bottmo-explain{ +top:145rpx; +width:94%; +border-top:1rpx dashed #eee; +padding-top:8rpx; +height:38rpx; +line-height: 51rpx; + +} +.font-word{ + font-size: 22rpx; +} +.circle-size{ + background: #a0a0a0; + width: 26rpx; + height: 26rpx; + margin-top:13rpx; +margin-left:8rpx; + + +} +.xc-jiantou{ + width: 10rpx; + height: 10rpx; + border-top: 2rpx solid #fff; + border-right: 2rpx solid #fff; + transform: rotate(133deg); + display:inline-block; + margin-left: 8rpx; + margin-top:6rpx; + +} +.xc-buttom{ + width:700rpx; +min-height:76rpx; +height:auto; +line-height:40rpx; +border-left:1rpx solid #eee; +border-right:1rpx solid #eee; +border-bottom:1rpx solid #eee; +margin:0 0rpx 0 22rpx; + + +} +.explain-coupon{ + + font-size:25rpx; + +} +.circle-frame{ + width: 20rpx; + height: auto; + z-index:1; + left:210rpx; + +} +.circle-sawtooth{ + width: 11rpx; + height: 11rpx; + background: #fff; +} + +.red{background-color: #fe7496;} +.green{ background-color: #22c7c1;} +.blue{background-color:#5e82e3;} +.g_gray{background-color: #aaaaaa} + +.f_text{text-align: center; height:96rpx; } \ No newline at end of file diff --git a/packageB/pages/user/view_comment/view_comment.js b/packageB/pages/user/view_comment/view_comment.js new file mode 100644 index 0000000..0764c07 --- /dev/null +++ b/packageB/pages/user/view_comment/view_comment.js @@ -0,0 +1,127 @@ +var i = require("../../../../utils/util.js"), + ut = i; +var e = getApp(), + a = e.globalData.setting, + os = a, + t = e.request, + d = e.globalData; +Page({ + + /** + * 页面的初始数据 + */ + data: { + url: a.url, + iurl: a.imghost, + comment: [], //用户单个评价的内容 + goods_id: "", //商品id + order_id: "", //订单id + is_act: 0, //是否开启活动 + actId: "", //活动id + giftBagId: "", //礼包id + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + var th = this; + th.setData({ + goods_id: options.goods_id, + order_id: options.order_id + }) + th.query_comment(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + + }, + query_comment: function() { + var th = this; + wx.showLoading({ + title: '加载中' + }) + var url = "/api/weshop/comment/list"; + getApp().request.promiseGet(url, { + data: { + store_id: a.stoid, + userId: d.user_id, + goods_id: th.data.goods_id, + order_id: th.data.order_id + } + }).then(res => { + wx.hideLoading(); + if (res.data.code == 0) { + var data = res.data.data.pageData; + if (data[0].img) data[0].img = ut.unserialize(data[0].img); + if (data[0].weapp_img) data[0].weapp_img = JSON.parse(data[0].weapp_img); + th.setData({ + comment: data + }) + th.judge_act(); //判断是否开启评价有礼 + } else { + getApp().my_warnning("系统繁忙,请稍后再试", 0, th); + } + }) + }, + //评价有礼判断 + judge_act: function() { + var th = this; + var url = "/api/weshop/marketing/comment/act/judge"; + getApp().request.promiseGet(url, { + data: { + orderGoodsId: th.data.goods_id, + orderNumber: th.data.order_id, + orderType: 1, + storeId: a.stoid, + userId: d.user_id + } + }).then(res => { + if (res.data.code == 0) { + var id = res.data.data.id; + var giftbagid = res.data.data.giftbagid; + th.setData({ + is_act: 1, + actId: id, + giftBagId: giftbagid + }) + } else { + + } + }) + }, + //预览图片 + previewImg: function(e) { + var th = this; + var index = e.currentTarget.dataset.index; + var sindex = e.currentTarget.dataset.sindex; + var imgArr = th.data.comment; + var image = imgArr[0].weapp_img; + var imagename = ""; + var iurl = th.data.iurl; + if (image != "") { + image = imgArr[0].weapp_img[index]; + wx.previewImage({ + current: iurl + image, + //当前图片地址 + urls: imgArr[0].weapp_img, //所有要预览的图片的地址集合 数组形式 + }) + } else { + image = imgArr[0].img[index]; + wx.previewImage({ + current: iurl + image, + //当前图片地址 + urls: imgArr[0].img, //所有要预览的图片的地址集合 数组形式 + }) + } + }, + goto: function(e) { + var th = this; + var url = e.currentTarget.dataset.url; + getApp().goto(url); + } + +}) \ No newline at end of file diff --git a/packageB/pages/user/view_comment/view_comment.json b/packageB/pages/user/view_comment/view_comment.json new file mode 100644 index 0000000..eacc6fa --- /dev/null +++ b/packageB/pages/user/view_comment/view_comment.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "查看评价", + "usingComponents": { + "warn": "/components/long_warn/long_warn", + "my_confirm": "/components/my_confirm/my_confirm" + } +} \ No newline at end of file diff --git a/packageB/pages/user/view_comment/view_comment.wxml b/packageB/pages/user/view_comment/view_comment.wxml new file mode 100644 index 0000000..c74b53f --- /dev/null +++ b/packageB/pages/user/view_comment/view_comment.wxml @@ -0,0 +1,105 @@ + + + + + + + + + {{item.goods_name}} + + + + + + {{item.goods_price}} + + + + + x + {{item.goods_num}} + + + + + + + + + + + + {{item.content}} + + + + + + + + + + + + + + + + + + + + + + + + 宝贝评分 + + + + + + 描述相符 + + + + + + + + + 物流服务 + + + + + + + + 服务态度 + + + + + + + + + + + + + + + + 评价其他 + + + 点击领取礼品 + + + + + + \ No newline at end of file diff --git a/packageB/pages/user/view_comment/view_comment.wxss b/packageB/pages/user/view_comment/view_comment.wxss new file mode 100644 index 0000000..ed974d5 --- /dev/null +++ b/packageB/pages/user/view_comment/view_comment.wxss @@ -0,0 +1,170 @@ +page{ + overflow-x: hidden; +} +/* 商品详情和评价 */ +.commoditymax{ + overflow-x: hidden; +} +.commodity { + border-top: 6rpx solid rgb(245, 245, 245); + border-bottom: 6rpx solid rgb(245, 245, 245); + padding: 0rpx 30rpx; + padding-bottom:10rpx; +} + +.commodity .information { + height: 286rpx; +} + +.commodity .information image { + width: 186rpx; + height: 186rpx; +} + +.information .goods_name { + width: 480rpx; + margin-left: 25rpx; + height: 186rpx; +} + +.information .goods_name .ellipsis-2 { + line-height: 40rpx; + height: 80rpx; +} + +.information .goods_name .jc_sb { + margin-top: 60rpx; + color: rgb(212, 28, 52); + margin-right: 7rpx; +} + +.information .goods_name .jc_sb .fs32 { + line-height: 40rpx; +} + +.information .goods_name .jc_sb .sum { + margin-right: 5rpx; +} + +.balin { + align-items: baseline; +} + +.addComment { + width: 690rpx; + padding: 32rpx 0rpx 21rpx 0rpx; +} + +.addComment textarea { + padding: 0rpx 18rpx; + max-height: 100rpx; + width: 654rpx; +} + +.addComment .addimages { + padding: 0rpx 18rpx; + margin-top: 20rpx; + align-items: flex-end; + width: 652rpx; + margin-bottom: 15rpx; +} +.comment{ + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; +} +.addComment .addimages .images { + height: 140rpx; +} + +.addComment .addimages .images .rel { + width: 140rpx; + height: 100%; + overflow: visible; + margin-right: 15rpx; +} + +.addComment .addimages .images image .abs { + width: 30rpx; + height: 30rpx; + top: -7rpx; + right: -7rpx; +} + +.addComment .addimage { + width: 139rpx; + height: 139rpx; + border: 2rpx dashed rgb(196, 196, 196); + font-size: 16rpx; + margin-left: 6rpx; +} + +.addComment .addimage image { + width: 60rpx; + height: 58rpx; +} + +.Grade { + width: 100%; + height: 310rpx; + border-bottom: 6rpx solid rgb(245, 245, 245); + padding-left: 45rpx; +} + +.Grade .title { + width: 100%; + height: 105rpx; +} + +.Grade .title .column { + height: 30rpx; + border-left: 6rpx solid rgb(211, 27, 58); + margin-right: 12rpx; +} + +.Grade .score-item { + height: 55rpx; + line-height: 55rpx; +} + +.Grade .score-item .stars { + margin-left: 83rpx; +} +.Grade .score-item .stars view{ + width: 60rpx; + height: 55rpx; +} + +.Grade .score-item .stars image { + width: 35rpx; + height: 35rpx; +} +.Whether { + padding:0rpx 31rpx; +} +.Whether .flex-right-vertical { + height: 67rpx; +} + +.Whether .flex-right-vertical .radio { + margin-right: 15rpx; +} + +.Whether .Submission { + margin: 40rpx 0 40rpx 0; +} + +.Whether .white { + width: 364rpx; + height: 58rpx; + background-color: rgb(212, 28, 52); + border-radius: 40rpx; + line-height: 58rpx; +} +.Whether .receive{ + background-color: rgb(255, 176, 63); +} + + diff --git a/pages/user/add_comment/add_comment.js b/pages/user/add_comment/add_comment.js deleted file mode 100644 index ae5369c..0000000 --- a/pages/user/add_comment/add_comment.js +++ /dev/null @@ -1,228 +0,0 @@ -var t = getApp(), oo = t.globalData, a = t.globalData.setting, os = a, e = t.request, s = require("../../../utils/util.js"), - i = require("../../../utils/selectFiles.js"); -var regeneratorRuntime = require('../../../utils/runtime.js'); - -Page({ - data: { - url: a.url, - resourceUrl: a.resourceUrl, - iurl: a.imghost, - defaultPhoto: a.resourceUrl + "/static/images/camera.png", - uploadPath: [], //上传后文件路径 - maxWord: 0, - is_anonymous: !1, - goods_rank: 0, - service_rank: 0, - deliver_rank: 0, - content: "", - options: null, - isLongPress: !1, - userinfo: null, - imgs: [], //本地文件再上传时的路径 - lenMore:0, - goods_id: "", //商品id - order_id: "", //订单id - }, - onLoad: async function (a) { - var th = this; - await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data:{store_id:os.stoid,goods_id:a.goods_id, order_id:a.order_id}}).then(res => { - - a.img = th.data.iurl + res.data.data.pageData[0].original_img; - a.goods_name=res.data.data.pageData[0].goods_name; - a.goods_num=res.data.data.pageData[0].goods_num; - }) - this.setData({ options: a }); - t.getUserInfo(function (e) { - console.log(e); - th.setData({userinfo: e}) - }) - th.setData({ - goods_id: a.goods_id, - order_id: a.order_id - }) - }, - keyUpChangeNum: function (t) { - this.setData({ - maxWord: t.detail.value.length - }), this.data.content = t.detail.value; - }, - checkAnonymous: function () { - this.setData({ - is_anonymous: !this.data.is_anonymous - }); - }, - checkGoodsRank: function (t) { - this.setData({ - goods_rank: parseInt(t.currentTarget.dataset.i) + 1 - }); - }, - checkServiceRank: function (t) { - this.setData({ - service_rank: parseInt(t.currentTarget.dataset.i) + 1 - }); - }, - checkDeliverRank: function (t) { - this.setData({ - deliver_rank: parseInt(t.currentTarget.dataset.i) + 1 - }); - }, - selectPhotos: function (t) { - if (this.data.isLongPress) this.data.isLongPress = !1; else { - var a = this; - i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function (t) { - a.setData({ - filePaths: t - }); - }); - } - }, - removePhoto: function (t) { - var a = this; - this.data.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function (t) { - a.setData({ - filePaths: t - }); - }); - }, - submitComment: function (i) { - var a = this; - if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) - return getApp().my_warnning("请先打分",0,a); - // if(a.data.content=="") - // return getApp().my_warnning("请填写评价内容",0,a); - - //this.uploadPhotos(function () { - var p_data= { - email: ' ', - is_show: 1, - goods_rank: a.data.goods_rank, - service_rank: a.data.service_rank, - deliver_rank: a.data.deliver_rank, - content: a.data.content, - goods_id: a.data.options.goods_id, - order_id: a.data.options.order_id, - user_id: oo.user_id, - store_id: os.stoid, - username: a.data.userinfo.nickname, - source_type:1 - } - if(a.data.uploadPath){ - p_data['weapp_img']=JSON.stringify(a.data.uploadPath); - } - if(a.data.is_anonymous){ - p_data['is_anonymous']=1; - } - - e.post("/api/weshop/comment/savecomment", { - data:p_data, - success: function (a) { - if(a.data.code==0){ - wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () { - // wx.navigateBack(); - var url = i.currentTarget.dataset.url; - getApp().goto(url); - }); - }else{ - getApp().my_warnning(a.data.msg,0,a); - } - } - }); - //}); - }, - - - uploadPhotos: function (t, a) { - if (0 == this.data.imgs.length) return t(); - if ("number" != typeof a) a = 0; else if (a >= this.data.imgs.length) return t(); - var s = this; - e.uploadFile("/api/weshop/comment/uploadCommentImg", { - filePath: s.data.imgs[a], - name: "file", - success: function (e) { - console.log("uploadPhotos"); - console.log(e.data); - if(e.data.code==0) - s.data.uploadPath[a] = e.data.data, s.uploadPhotos(t, a + 1); - } - }); - }, - - //图片失败,默认图片 - bind_bnerr2: function (e) { - var _errImg = e.target.dataset.errorimg; - var _errObj = {}; - _errObj[_errImg] = a.imghost + "/public/images/default_goods_image_240.gif"; - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; - }, - // 上传图片 - chooseImg: function (e) { - var that = this; - var imgs = this.data.imgs; - if (imgs.length >= 3){ - if(this.data.lenMore==0){ - this.setData({ lenMore: 1 }); - } - return false; - } - - var imgs = this.data.imgs; - - wx.chooseImage({ - count: 1, // 默认9 - sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { - // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 - var tempFilePaths = res.tempFilePaths; - - getApp().request.uploadFile("/api/weshop/comment/uploadCommentImg", { - filePath: tempFilePaths[0], - name: "file", - success: function (e) { - if(e.data.code==0) { - that.data.uploadPath.push(e.data.data); - imgs.push(tempFilePaths[0]); - that.setData({ - imgs: imgs - }); - } - } - }); - } - }); - }, - // 删除图片 - deleteImg: function (e) { - var imgs = this.data.imgs; - var index = e.currentTarget.dataset.index; - imgs.splice(index, 1); - this.setData({ - imgs: imgs - }); - }, - // 预览图片 - previewImg: function (e) { - //获取当前图片的下标 - var index = e.currentTarget.dataset.index; - //所有图片 - var imgs = this.data.imgs; - wx.previewImage({ - //当前显示图片 - current: imgs[index], - //所有图片 - urls: imgs - }) - }, - - txtInpt:function (e) { - this.setData({ - content: e.detail.value - }) - }, - - onUnload: function () { - wx.navigateBack({ delta:1 }) - }, - - -}); \ No newline at end of file diff --git a/pages/user/add_comment/add_comment.json b/pages/user/add_comment/add_comment.json deleted file mode 100644 index 401e4e6..0000000 --- a/pages/user/add_comment/add_comment.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "navigationBarTitleText": "评价宝贝", - "enablePullDownRefresh": false, - "usingComponents": { - "warn": "/components/long_warn/long_warn" - } -} \ No newline at end of file diff --git a/pages/user/add_comment/add_comment.wxml b/pages/user/add_comment/add_comment.wxml deleted file mode 100644 index 71d1232..0000000 --- a/pages/user/add_comment/add_comment.wxml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - {{options.goods_name}} - - - - - - {{options.price}} - - - - - x - {{options.goods_num}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 添加图片 - {{imgs.length>0?imgs.length:0}}/3 - - - - - - - - - - - - - - 宝贝评分 - - - - - - 描述相符 - - - - - - - - - 物流服务 - - - - - - - - 服务态度 - - - - - - - - - - - - - - - - - - 匿名评价 - - - - 提交评价 - - - - - \ No newline at end of file diff --git a/pages/user/add_comment/add_comment.wxss b/pages/user/add_comment/add_comment.wxss deleted file mode 100644 index 43c1670..0000000 --- a/pages/user/add_comment/add_comment.wxss +++ /dev/null @@ -1,162 +0,0 @@ -page{ - overflow-x: hidden; -} -/* 商品详情和评价 */ -.commoditymax{ - overflow-x: hidden; -} -.commodity { - height: 715rpx; - border-top: 6rpx solid rgb(245, 245, 245); - border-bottom: 6rpx solid rgb(245, 245, 245); - padding: 0rpx 30rpx; -} - -.commodity .information { - height: 286rpx; -} - -.commodity .information image { - width: 186rpx; - height: 186rpx; -} - -.information .goods_name { - width: 480rpx; - margin-left: 25rpx; - height: 186rpx; -} - -.information .goods_name .ellipsis-2 { - line-height: 40rpx; - height: 80rpx; -} - -.information .goods_name .jc_sb { - margin-top: 60rpx; - color: rgb(212, 28, 52); - margin-right: 7rpx; -} - -.information .goods_name .jc_sb .fs32 { - line-height: 40rpx; -} - -.information .goods_name .jc_sb .sum { - margin-right: 5rpx; -} - -.balin { - align-items: baseline; -} - -.addComment { - height: 345rpx; - width: 690rpx; - background-color: rgb(248, 248, 248); - padding: 32rpx 0rpx 21rpx 0rpx; -} - -.addComment textarea { - padding: 0rpx 18rpx; - height: 175rpx; - width: 654rpx; -} - -.addComment .addimages { - padding: 0rpx 18rpx; - margin-top: 20rpx; - align-items: flex-end; - width: 652rpx; -} - -.addComment .addimages .images { - height: 140rpx; -} - -.addComment .addimages .images .rel { - width: 140rpx; - height: 100%; - overflow: visible; - margin-right: 15rpx; -} - -.addComment .addimages .images image .abs { - width: 30rpx; - height: 30rpx; - top: -7rpx; - right: -7rpx; -} - -.addComment .addimage { - width: 139rpx; - height: 139rpx; - border: 2rpx dashed rgb(196, 196, 196); - font-size: 16rpx; - margin-left: 6rpx; -} - -.addComment .addimage image { - width: 60rpx; - height: 58rpx; -} - -.Grade { - width: 100%; - height: 310rpx; - border-bottom: 6rpx solid rgb(245, 245, 245); - padding-left: 45rpx; -} - -.Grade .title { - width: 100%; - height: 105rpx; -} - -.Grade .title .column { - height: 30rpx; - border-left: 6rpx solid rgb(211, 27, 58); - margin-right: 12rpx; -} - -.Grade .score-item { - height: 55rpx; - line-height: 55rpx; -} - -.Grade .score-item .stars { - margin-left: 83rpx; -} -.Grade .score-item .stars view{ - width: 60rpx; - height: 55rpx; -} - -.Grade .score-item .stars image { - width: 35rpx; - height: 35rpx; -} -.Whether { - padding:0rpx 31rpx; -} -.Whether .flex-right-vertical { - height: 67rpx; -} - -.Whether .flex-right-vertical .radio { - margin-right: 15rpx; -} - -.Whether .Submission { - margin: 40rpx 0 40rpx 0; -} - -.Whether .white { - width: 364rpx; - height: 58rpx; - background-color: rgb(212, 28, 52); - border-radius: 40rpx; - line-height: 58rpx; -} - - diff --git a/pages/user/collect_list/collect_list.js b/pages/user/collect_list/collect_list.js deleted file mode 100644 index cc53c36..0000000 --- a/pages/user/collect_list/collect_list.js +++ /dev/null @@ -1,298 +0,0 @@ -var t = function(t) { - return t && t.__esModule ? t : { - default: t - }; - }(require("../../../utils/LoadMore.js")), - e = getApp(), - a = e.request, - o = new t.default(); -var oo = e.globalData.setting, - app_d = e.globalData; -var ut = require('../../../utils/util.js'); - -Page({ - data: { - url: e.globalData.setting.imghost, - resourceUrl: e.globalData.setting.resourceUrl, - iurl: e.globalData.setting.imghost, - collects: null, - currentPage: 1, - curpage: 1, - ismore: 0, - iscollects: 0, - editEd: 0, //商品编辑按钮是否点击 - isall: false, //是否全选 - sum: 0, - total_collects: 0, - is_goods: 0, - pageSize: 8, //分页数量 - isdelete: 0 - }, - onLoad: function() { - o.init(this, "", "collects"), - this.requestCollectList(); - }, - requestCollectList: function() { - var th = this; - e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize + "&user_id=" + - app_d.user_id + "&store_id=" + oo.stoid + "&page=" + th.data.currentPage; - o.request(e, function(e) { - th.data.currentPage++; - if (th.data.total_collects == 0) { - th.setData({ - iscollects: 1, - total_collects: e.data.data.total - }) - } - if (th.data.total_collects < th.data.pageSize) { - - th.setData({ - is_goods: 1 - }) - var goods_list = th.selectComponent("#goods_recommend"); //组件的id - goods_list.init(); - setTimeout(function () { goods_list.get_list(); }, 300) - } - }); - }, - - //--到底部刷新--- - onReachBottom: function() { - if ((this.data.currentPage - 1) * this.data.pageSize < this.data.total_collects) { - this.requestCollectList(); - } else { - if (this.data.is_goods == 0) this.setData({ - is_goods: 1 - }); - var goods_list = this.selectComponent("#goods_recommend"); //组件的id - goods_list.get_list(); - } - - }, - - //--取消收藏--- - cancelCollect: function(t) { - var e = t.currentTarget.dataset.id, - o = this; - a.delete("/api/weshop/goodscollect/del/" + oo.stoid + "/" + e, { - success: function(t) { - o.deleteItemData(e); - } - }); - }, - deleteItemData: function(t) { - for (var e = 0; e < this.data.collects.length; e++) - if (this.data.collects[e].collect_id == t) { - this.data.collects.splice(e, 1), this.setData({ - collects: this.data.collects - }); - break; - } - }, - //图片失败,默认图片 - bind_bnerr: function(e) { - var _errImg = e.currentTarget.dataset.errimg; - var _errObj = {}; - _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif"; - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; - - }, - - requestList: function() { - - var e = this; - a.get("/api/weshop/goods/page", { - isShowLoading: 0, - data: { - store_id: 1, - user_id: oo.user_id, - page: e.data.curpage, - pageSize: 10 - }, - success: function(t) { - e.data.curpage++; - var arr1 = e.data.collects_Recommend; - var arr2 = t.data.data.pageData; - var arr3 = [...arr1, ...arr2]; - - var ismore = 0; - if (arr3.length == t.data.data.total) ismore = 1 - - e.setData({ - collects_Recommend: arr3, - total_goods: t.data.data.total, - ismore_goods: ismore, - loadName: null - }), wx.stopPullDownRefresh(); - } - }); - }, - - - goto: function(ee) { - wx.navigateTo({ - url: '/pages/index/index/index', - }) - }, - //编辑商品显示 - editcollects: function() { - var th = this.data; - var t = this; - if (th.editEd == 0) { - t.select_checked(false, null) - t.setData({ - editEd: 1, - isall:0 - }) - } else { - t.select_checked(false, null) - t.setData({ - editEd: 0 - }) - } - }, - iconClick: function(e) { - var th = this.data; - var index = e.currentTarget.dataset.index; - var url = e.currentTarget.dataset.url; - - var item=this.data.collects[index]; - if(url){ - console.log("---"); - console.log(item.add_time); - console.log(ut.gettimestamp()); - - if(ut.gettimestamp()-item.add_time<3600*24 && item.guide_id>0) - url+="&c_guide_id="+item.guide_id; - getApp().goto(url); - return false; - } - var collect = "collects[" + index + "].checked"; - if (this.data.collects[index].checked == true) { - this.setData({ - [collect]: false, - isall: 0, - sum: --th.sum - }) - } else { - var id = th.collects[index].collect_id; - this.setData({ - [collect]: true, - sum: ++th.sum - }) - if (th.sum == th.collects.length) { - this.setData({ - isall: 1 - }) - } - } - }, - //全选为收藏商品checked为true - allClick: function() { - var th = this; - var list = th.data.collects; - //判断是否全选 - if (th.data.isall) { - for (var i = 0; i < list.length; i++) { - list[i].checked = false; - } - this.setData({ - sum: 0, - isall: 0, - collects: list - }) - } else { - for (var i = 0; i < list.length; i++) { - list[i].checked = true; - } - this.setData({ - sum: th.data.collects.length, - collects: list, - isall: 1 - }) - } - }, - - //分页删除 - alldelete: function(e) { - - var th = this; - if (th.data.isdelete) return false; - // 全选的话直接删除 - if (th.data.isall) { - a.delete("/api/weshop/goodscollect/removeUser/" + oo.stoid + "/" + app_d.user_id, { - isShowLoading: 0, - success: function(e) { - th.setData({ - collects: [], - total_collects: 0, - isdelete:0 - }) - getApp().my_warnning("取消成功", 1, th); - - } - }) - } else { //按照多个id删除收藏商品 - - var new_colls = []; - var collectId = th.data.collects; - - var str = ""; - for (var i = 0; i < th.data.collects.length; i++) { - if (collectId[i].checked) { - str += collectId[i].collect_id + ","; - } else { - new_colls.push(collectId[i]); - } - } - if(str.length==""){ - getApp().my_warnning("请选择商品", 0, th); - return false; - } - th.setData({ - isdelete: 1 - }) - str = str.substr(0, str.length - 1); - var url = "/api/weshop/goodscollect/removeByIds/" + oo.stoid + "/" + app_d.user_id + "/" + str; - - a.delete(url, { - isShowLoading: 0, - success: function(e) { - th.setData({ - collects: new_colls, - sum: 0, - total_collects: new_colls.length, - isdelete: 0 - }) - // th.select_checked(false,null); - getApp().my_warnning("取消收藏成功", 1, th); - } - - }) - - } - }, - select_checked: function(check, sum) { - var th = this; - if (sum == null) { - for (var i = 0; i < this.data.collects.length; i++) { - var collect = "collects[" + i + "].checked"; - th.setData({ - [collect]: check, - sum:0 - }) - } - } else { - var collect = "collects[" + sum + "].checked"; - th.setData({ - [collect]: check - }) - } - }, - - go_to: function(e) { - var th = this; - var url = e.currentTarget.dataset.url; - getApp().goto(url); - } -}); \ No newline at end of file diff --git a/pages/user/collect_list/collect_list.json b/pages/user/collect_list/collect_list.json deleted file mode 100644 index 64db42e..0000000 --- a/pages/user/collect_list/collect_list.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "navigationBarTitleText": "我的收藏", - "enablePullDownRefresh": false, - "usingComponents": { - "warn": "/components/long_warn/long_warn", - "goods_recommend": "/components/goods_list/goods_list" - } -} \ No newline at end of file diff --git a/pages/user/collect_list/collect_list.wxml b/pages/user/collect_list/collect_list.wxml deleted file mode 100644 index 00f5f3b..0000000 --- a/pages/user/collect_list/collect_list.wxml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - 当前暂无收藏 - - - 去首页逛逛 - - - - - - - - - - 共{{total_collects}}件商品 - {{editEd==1?'完成':'编辑'}} - - - - - - - - - - - - - - - - - - - {{item.goods_name}} - - - - - - - - - {{item.shop_price}} - - - - 零售价: - ¥{{item.market_price}} - - - - - - 找相似 - - - - - - - - - - - - - - - - - - - - - - 好物推荐 - - - - - - - - - - - - - - - 全选 - - - - 已选 - {{sum>0?sum:'0'}} 件 - - - - {{isdelete==0?'删除':'删除中'}} - - - - \ No newline at end of file diff --git a/pages/user/collect_list/collect_list.wxss b/pages/user/collect_list/collect_list.wxss deleted file mode 100644 index efd2d00..0000000 --- a/pages/user/collect_list/collect_list.wxss +++ /dev/null @@ -1,521 +0,0 @@ -/* .collect-ul { - width: 100%; - background-color: #f0f2f5; -} - -.collect-li { - width: 50%; - background-color: white; - box-sizing: border-box; - display: inline-block; - border: 1rpx solid #f0f2f5; - margin-top: -5rpx; -} - -.collect-img { - width: 100%; - height: 375rpx; -} - -.collect-name { - font-size: 32rpx; - line-height: 36rpx; - padding: 0 10rpx; - margin: 10rpx 0; - height: 72rpx; -} - -.collect-footer { - font-size: 32rpx; - padding: 10rpx 10rpx; - overflow: hidden; -} - -.collect-price { - color: red; - display: inline-block; -} - -.collect-btn { - padding: 6rpx 10rpx; - height: 36rpx; - border: 1rpx solid #bfbfbf; - float: right; - text-align: center; - margin-left: 5rpx; - border-radius: 5rpx; - color: #686868; - font-size: 30rpx; -} */ - -page { - width: 100%; - background-color: rgb(245, 245, 245); - overflow-x: hidden; -} - -.Collection { - overflow-x: hidden; -} - -/* vip开卡框架 */ - -.vip { - width: 100%; - height: 70rpx; - background-color: rgb(250, 242, 219); - font-size: 25rpx; - padding: 0rpx 31rpx; -} - -.vip .vip_image { - width: 40rpx; - height: 40rpx; - background-color: rgb(55, 45, 13); - border-radius: 50%; - line-height: 70rpx; -} - -.vip .vip_image image { - width: 25rpx; - height: 25rpx; - line-height: 70rpx; -} - -.vip .vip_describe { - width: 502prx; - margin-left: 20rpx; - padding-right: 172rpx; - line-height: 70rpx; - border-right: 4rpx solid #000; - height: 25rpx; -} - -.vip .vip_describe .vip_province_money { - color: rgb(254, 0, 0); -} - -.vip .vip_card { - margin-left: 17rpx; - line-height: 70rpx; -} - -.vip .vip_card .vip_go_image { - margin-left: 10rpx; -} - -.vip .vip_card .vip_immediately { - color: rgb(56, 47, 14); -} - -.vip .vip_card .vip_go_image image { - width: 35rpx; - height: 35rpx; -} - -.commodity { - width: 100%; -} - -/* 无收藏样式 */ - -.noCollection image { - width: 329rpx; - height: 229rpx; - margin-top: 202rpx; -} - -.noCollection .xc-ash { - margin-top: 41rpx; - font-weight: 600px; -} - -.noCollection navigator { - margin-top: 73rpx; - border-radius: 40rpx; -} - -.noCollection navigator view { - width: 247rpx; - height: 56rpx; - background-color: rgb(255, 72, 72); - border-radius: 40rpx; -} - -/* 商品详情 */ - -.commodity .sum { - font-size: 28rpx; - height: 70rpx; - background-color: rgb(245, 245, 245); - padding-left: 31rpx; - color: rgb(131, 131, 131); -} - -.commodity .sum view { - height: 100%; - letter-spacing: 1rpx; -} - -.commodity .sum .editEd { - width: 100rpx; - padding-right: 31rpx; -} - -.colls_max { - padding-left: 30rpx; -} - -.commodity .collects_max .collect { - width: 100%; - height: 244rpx; - border-bottom: 4rpx solid rgb(245, 245, 245); - background-color: rgb(255, 255, 255); - padding-right: 31rpx; -} - -.commodity .collects_max .collect .collect_image { - height: 183rpx; - width: 183rpx; - margin-left: 31rpx; -} - -.commodity .collects_max .collect .iconrp { - margin-left: 0rpx; -} - -.commodity .collects_max .collect .collect_image image { - width: 183rpx; - height: 183rpx; -} - -.commodity .collects_max .collect .attribute { - line-height: 68rpx; - height: 183rpx; - margin-left: 21rpx; - width: 70%; - -} - -.commodity .collects_max .collect .attribute .attribute_name { - height: 68rpx; - align-items: center; -} - -.commodity .collects_max .collect .attribute .attribute_name .name { - line-height: 35rpx; -} - -.commodity .collects_max .collect .attribute .attribute_money { - margin-top: 60rpx; - display: flex; - justify-content: space-between; - height: 50rpx; - align-items: flex-end; -} - -.commodity .collects_max .money_left { - height: 54rpx; -} - -.commodity .collects_max .collect .attribute .attribute_money .money_left .price { - font-weight: 1000rpx; - color: rgb(212, 28, 52); - margin-right: 10rpx; - align-items: baseline; -} - -.commodity .collects_max .collect .attribute .attribute_money .money_right { - align-items: flex-end; - padding-bottom: 1rpx; -} - -.commodity .collects_max .collect .attribute .attribute_money .money_right .similar { - width: 97rpx; - height: 35rpx; - border-radius: 21rpx; - border: 1rpx solid rgb(162, 162, 162); - margin-right: 22rpx; - color: rgb(110,110, 110); - align-items: center; -} - -.commodity .collects_max .collect .attribute .attribute_money .money_right view { - height: 30rpx; - line-height: 30rpx; -} - -.commodity .collects_max .collect .attribute .attribute_money .money_right image { - width: 35rpx; - height: 35rpx; - margin-right: 10rpx; - margin-bottom: 1rpx; -} - -.line { - align-items: baseline; -} - -.title .collect { - background-color: rgb(255, 255, 255); -} - -/* 热门好物 */ - -/* .title .China { - width: 100%; - margin-top: 50rpx; - margin-bottom: 10rpx; - line-height: 0rpx; -} - -.title .China .lin view { - width: 2rpx; -} - -.title .China .le { - height: 40rpx; - color: rgb(51,51, 51); -} - -.title .China .line .one { - height: 23rpx; - background-color: #000; - margin-left: 5rpx; -} - -.title .China .line .two { - height: 15rpx; - background-color: #000; - margin-left: 5rpx; -} - -.title .China .line .three { - height: 18rpx; - background-color: #000; - margin-left: 5rpx; -} - -.title .China .Recommend { - margin: 0rpx 20rpx; - font-size: 28rpx; - line-height: 39rpx; - font-weight: bold; -} - -.title .english .silk { - width: 214rpx; - height: 2rpx; - background-color: #000; -} - -.title .english .esh { - margin: 0rpx 15rpx; -} */ - -/* .collects { - margin-top: 40rpx; -} */ - -.Recommend { - height: 80rpx; - padding-top: 7rpx; -} - -.Recommend .lin { - width: 210rpx; - height: 2rpx; - background-color: rgb(167, 167, 167); -} - -.Recommend .flex-center { - margin: 0 20rpx; - color: rgb(51, 51, 51); - font-weight: bold; -} - -.Recommend .flex-center image { - margin-right: 5rpx; - width: 32rpx; - height: 29rpx; -} - -.hang { - width: 100%; - margin: auto; - padding-left: 31rpx; -} - -.hang .collect { - width: 335rpx; - height: 503rpx; - border-radius: 23rpx; - border: 1rpx solid rgb(214, 214, 214); - overflow: hidden; - margin-right: 14rpx; - margin-bottom: 10rpx; -} - -.collect .bottom { - padding: 0rpx 16rpx; -} - -.collect .bottom .goods_name { - height: 68rpx; -} - -.collect .sp { - width: 100%; - height: 315rpx; -} - -.collect .money { - margin-top: 40rpx; - line-height: 28rpx; - align-items: baseline; -} - -.collect .money view { - display: flex; - align-items: baseline; - font-weight: 1000rpx; -} - -.collect .Discount { - width: 156rpx; - height: 28rpx; - border-radius: 20rpx; - background-color: rgb(56, 56, 56); - font-size: 18rpx; - color: rgb(255, 255, 255); -} - -.collect .Discount image { - height: 18rpx; - width: 18rpx; - line-height: 28rpx; - margin-right: 3rpx; -} - -.collect.ml20 { - margin-left: 13rpx; -} - -.fs24.dollar { - padding: 0rpx; -} - -.through { - text-decoration: line-through; - color: rgb(155, 155, 155); - margin-left: 7rpx; -} - -.money .price { - margin-left: 12rpx; - text-decoration: line-through; -} - -.money .price view { - display: flex; - align-items: flex-end; -} - -.province { - line-height: 28rpx; -} - -.nothing { - height: 75rpx; - width: 100%; -} - -.nothing .no_content { - margin: 0rpx 11rpx; - color: rgb(138, 138, 138); -} - -.nothing .Foil { - width: 80rpx; - height: 2rpx; - background-color: rgb(138, 138, 138); -} - -.iconUn { - margin-left: 15rpx; - margin-right: 21rpx; - transform: scale(1.0); -} - -.Un { - margin-left: 0rpx; -} - -.iconClick { - margin-left: 21rpx; - margin-right: 16rpx; -} - -.radioCheck { - height: 100%; - display: flex; - align-items: center; - width: 65rpx; - justify-content: center; -} - -.scale { - transform: scale(0.8); -} - -.load { - width: 100%; - height: 80rpx; - padding: 0rpx 31rpx; -} - -.abs { - position: fixed; - left: 0rpx; - bottom: 0rpx; - height: 100rpx; - background-color: rgb(255, 255, 255); - width: 100%; - border-top: 1rpx solid #eee; -} - -.abs .left { - display: flex; - justify-content: space-between; - width: 515rpx; - padding-left: 31rpx; -} - -.abs .allClick { - margin-left: 31rpx; -} - -.abs icon { - margin-right: 31rpx; -} - -.abs .delete { - width: 235rpx; - height: 100%; - background-color: rgb(219, 27, 52); -} -.abs .Deleting{ - background-color: rgb(131, 131, 131); -} -.abs .Number { - margin-right: 18rpx; - letter-spacing: 0rpx; - font-size: 32rpx; - height: 55rpx; - -} -.goods_num{ - height: 55rpx; -line-height: 55rpx; - -} \ No newline at end of file diff --git a/pages/user/comment/comment.js b/pages/user/comment/comment.js deleted file mode 100644 index 051d8fa..0000000 --- a/pages/user/comment/comment.js +++ /dev/null @@ -1,158 +0,0 @@ -var ut = require("../../../utils/util.js"); -var t = function(t) { - return t && t.__esModule ? t : { - default: t - }; - }(require("../../../utils/LoadMore.js")), - e = getApp(), - rq = e.request, - a = new t.default(), - s = require("../../../utils/util.js"), - oo = e.globalData, - os = e.globalData.setting; -var regeneratorRuntime = require('../../../utils/runtime.js'); - -Page({ - data: { - url: e.globalData.setting.url, - resourceUrl: e.globalData.setting.imghost, - iurl: e.globalData.setting.imghost, - categories: [{ - name: "全部评价", - status: 2 - }, { - name: "待评价", - status: 0 - }, { - name: "已评价", - status: 1 - }], - activeStatus: 0, - comments: null, - currentPage: 1, - isloaded: 0, - order_id:0, - is_no_more:0, - }, - onLoad: function(t) { - var e = void 0 === t.status ? this.data.activeStatus : t.status; - this.data.order_id=t.order_id; - - //a.init(this, "", "comments"), - //this.requestComments(e); - this.requestComments_new(e); - }, - onShow: function() { - wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1), - this.resetData(), this.requestComments_new(this.data.activeStatus)); - }, - changeTab: function(t) { - var e = this; - if (this.data.activeStatus == t.currentTarget.dataset.status) - return false; - this.resetData(), this.requestComments_new(t.currentTarget.dataset.status); - }, - - requestComments_new:async function(t){ - var e = this, th = e, n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage; - this.setData({ - activeStatus: t - }); - - if(e.data.order_id) n+="&order_id="+e.data.order_id; - var rq_data={store_id: os.stoid, user_id: oo.user_id}; - if (t!= 2) {rq_data['is_comment']=t;} - - var rs_data=null,com_data=this.data.comments; - await getApp().request.promiseGet(n,{data:rq_data}).then(res=>{ - e.data.currentPage++ - if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ - rs_data=res.data.data.pageData; - }else{ - th.setData({ is_no_more: 1, }) - } - }) - - if(rs_data){ - for(var ind in rs_data ){ - var em=rs_data[ind] - await getApp().request.promiseGet("/api/weshop/comment/pageComment", { - data:{ store_id: os.stoid, goods_id: em.goods_id, - pageSize: 3, parent_id: em.comment_id, page:1} - }).then(res=>{ - if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) - rs_data[ind].replay_list=res.data.data.pageData; - }) - if (em.img != undefined && em.img != null && ut.isString(em.img)) rs_data[ind].img = ut.unserialize(em.img); - var str = em.weapp_img; - if (str != "" && ut.isString(str)) rs_data[ind].weapp_img = JSON.parse(str); - rs_data[ind].original_img=this.data.iurl+rs_data[ind].original_img; - } - - if(!com_data) com_data=rs_data; - else com_data= com_data.concat(rs_data); - th.setData({ comments: com_data }) - } - - th.setData({isloaded: 1,}) - }, - - onReachBottom: function() { - if(this.data.is_no_more) return false; - //a.canloadMore() && this.requestComments(this.data.activeStatus); - this.requestComments_new(this.data.activeStatus); - }, - - - onPullDownRefresh: function(t) { - this.resetData(), this.requestComments_new(this.data.activeStatus); - }, - resetData: function() { - this.data.comments = null, this.data.currentPage = 1, this.data.is_no_more=0, a.resetConfig(); - }, - /*-----评论-----*/ - comment: function(t) { - for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++); - if (!(s >= a.length)) { - var n = "?order_id=" + a[s].order_id; - n += "&goods_id=" + a[s].goods_id, n += "&price=" + a[s].goods_price; - wx.navigateTo({ - url: "/pages/user/add_comment/add_comment" + n - }); - } - }, - - //图片失败,默认图片 - bind_bnerr2: function(e) { - var th = this; - var _errImg = e.currentTarget.dataset.errorimg; - var _errObj = {}; - _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif"; - th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; - }, - //预览图片 - previewImg: function(e) { - var index = e.currentTarget.dataset.index; - var sindex = e.currentTarget.dataset.sindex; - var name = e.currentTarget.dataset.name; - var imgArr = this.data.comments; - var image = null; - if (name == "img") { - image = imgArr[index].img[sindex]; - } else { - image = imgArr[index].weapp_img[sindex]; - } - wx.previewImage({ - current: image, - //当前图片地址 - urls: imgArr[index].weapp_img, //所有要预览的图片的地址集合 数组形式 - }) - }, - //跳到首页 - goto: function(ee) { - wx.navigateTo({ - url: '/pages/index/index/index', - }) - }, - -}); \ No newline at end of file diff --git a/pages/user/comment/comment.json b/pages/user/comment/comment.json deleted file mode 100644 index 2b3db22..0000000 --- a/pages/user/comment/comment.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "我的评价" -} \ No newline at end of file diff --git a/pages/user/comment/comment.wxml b/pages/user/comment/comment.wxml deleted file mode 100644 index 4e77fe1..0000000 --- a/pages/user/comment/comment.wxml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - {{item.name}} - - - - - - - - - - 当前暂无评价 - - - 去首页逛逛 - - - - - - - - - - - 订单编号:{{item.order_sn}} - - {{item.comment_id>0?'已评价':'待评价'}} - - - - - - - - - - - - - - {{item.goods_name}} - - - {{item.goods_color+item.goods_spec.length>-1?item.goods_color+item.goods_spec:'规格1'}} - - - - - - - - {{filter.toFix(item.goods_price,2)}} - - x{{item.goods_num}} - - - - - - - - - 评价: - - - - - - {{item.content.length>0?item.content:'此用户没有填写评论'}} - - - - - - - - - - 店家回复: - - {{r_item.content}} - - - - - - {{item.comment_addtime}} - - - - - - - 共{{item.goods_num}}件商品 - - - 合计: - - - {{filter.toFix(item.goods_price,2)}} - - - - - - 查看订单 - - - - 查看评价 - - - - 去评价 - - - - - - - 已经加载到底部 - - \ No newline at end of file diff --git a/pages/user/comment/comment.wxss b/pages/user/comment/comment.wxss deleted file mode 100644 index 3ca00d8..0000000 --- a/pages/user/comment/comment.wxss +++ /dev/null @@ -1,215 +0,0 @@ -.padding { - padding: 0rpx 27rpx; -} - -.container { - background-color: rgb(255, 255, 255); -} - -.type-navbar { - white-space: nowrap; - display: flex; - height: 80rpx; - background-color: #fff; - border-top: 2rpx solid rgb(221, 221, 221); - justify-content: space-between; - color: rgb(51, 51, 51); -} - -.type-box { - box-sizing: border-box; - line-height: 76rpx; - text-align: center; - display: inline-block; - overflow: hidden; -} - -.type-navbar-item { - border-bottom: 4rpx solid #fff; -} - -.type-item-on { - /* width: 146rpx; */ - border-bottom: 7rpx solid #e64340; -} - -.border_bottom { - border-bottom: 3rpx solid rgb(245, 245, 245); -} - -/* 无评价 */ - -.noCollection image { - width: 329rpx; - height: 229rpx; - margin-top: 202rpx; -} - -.noCollection .xc-ash { - margin-top: 10rpx; - font-weight: 600px; -} - -.noCollection navigator { - margin-top: 60rpx; - border-radius: 40rpx; -} - -.noCollection navigator view { - width: 247rpx; - height: 56rpx; - background-color: rgb(255, 72, 72); - border-radius: 40rpx; -} - -/* 待评价栏 */ - -.Commodity_number { - height: 70rpx; - border-top: 13rpx solid rgb(245, 245, 245); -} - -/* 文字基线对齐 */ - -.baseline { - display: flex; - align-items: baseline; -} - -/* 单个商品框架 */ - -.detail_commodity { - height: 231rpx; -} - -.detail_commodity image { - width: 185rpx; - height: 185rpx; -} - -.detail_commodity .goods_name { - width: 485rpx; - /* height: 75rpx; */ - line-height: 37rpx; -} - -.Commodity_content { - height: 185rpx; - margin-left: 21rpx; -} - -.Commodity_content .Commodity_goods { - height: 150rpx; -} - -.Commodity_content .Commodity_money { - font-size: 16rpx; -} - -/* 商品评价按钮框架 */ - -.commodity_evaluate { - height: 110rpx; - padding-top: 15rpx; -} - -.commodity_evaluate .commodity_smy .commodity_money { - margin-left: 29rpx; - letter-spacing: 1rpx; -} - -.commodity_evaluate .commodity_To_evaluate { - width: 128rpx; - height: 39rpx; - border-radius: 9rpx; -} - -.commodity_evaluate .commodity_To_evaluate view { - height: 39rpx; - line-height: 39rpx; -} - -.commodity_evaluate .comment_go { - margin-left: 20rpx; - background-color: rgb(211, 28, 52); - color: rgb(255, 255, 255); - border: 2rpx solid rgb(211, 28, 52); -} - -.Commodity_spec { - width: 106rpx; - background-color: rgb(236, 236, 236); - border-radius: 7rpx; - font-size: 18rpx; - margin-top: 10rpx; -} - -.Commodity_spec view { - height: 28rpx; - align-items: center; -} - -.Commodity_evaluation .Comment_content { - color: rgb(153, 153, 153); - letter-spacing: 1rpx; -} - -.Commodity_evaluation .starss { - height: 58rpx; - /* // line-height: 58rpx; */ - align-items: center; -} - -.Commodity_evaluation .commen { - height: 58rpx; - line-height: 58rpx; -} - -.Commodity_evaluation .starss .stars { - line-height: 58rpx; -} - -.Commodity_evaluation .starss .stars image { - width: 29rpx; - height: 26rpx; - margin-right: 5rpx; -} - -.Commodity_evaluation .Comment_images image { - width: 100rpx; - height: 100rpx; - margin-right: 8rpx; - margin-top: 18rpx; - border-radius: 6rpx; - border: 2rpx solid rgb(245, 245, 245); - margin-left: 15rpx; -} - -.commodity_evaluate .View_evaluation { - border: 2rpx solid rgb(179, 179, 179); - color: rgb(0, 0, 0); - background-color: rgb(255, 255, 255); -} - -.comment_addtime { - height: 50rpx; -} - -.title_width { - width: 146rpx; - text-align: center; -} - -.shop-font { - color: rgb(153, 153, 153); -} - -.reply { - margin-top: 10rpx; -} - -.get_bottom { - text-align: center; - color: #999; - margin-bottom: 20rpx; -} diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 96e2a61..fe55e2c 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -595,7 +595,7 @@ Page({ switch (no) { case "01": - getApp().goto("/pages/user/user_coupon/user_coupon?img=" + + getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" + url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); break; case "02": diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml index b9c7899..a048d97 100644 --- a/pages/user/order_detail/order_detail.wxml +++ b/pages/user/order_detail/order_detail.wxml @@ -164,9 +164,9 @@ 评价 + url="/packageB/pages/user/comment/comment?status=0&order_id={{order.order_id}}">评价 去评价 + url="/packageB/pages/user/add_comment/add_comment?goods_id={{order.order_goods[0].goods_id}}&order_id={{order.order_id}}}">去评价 diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index fa867eb..d6799c5 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -183,9 +183,9 @@ 评价 + url="/packageB/pages/user/comment/comment?status=0&order_id={{item.order_id}}">评价 评价 + url="/packageB/pages/user/add_comment/add_comment?goods_id={{item.order_goods[0].goods_id}}&order_id={{item.order_id}}&price={{item.order_goods[0].member_goods_price}}">评价 diff --git a/pages/user/user_coupon/c_filter.wxs b/pages/user/user_coupon/c_filter.wxs deleted file mode 100644 index b1d896d..0000000 --- a/pages/user/user_coupon/c_filter.wxs +++ /dev/null @@ -1,63 +0,0 @@ -var filters = { - toFix:function(val,count){ - return val.toFixed(count) - }, - format_time:function(ts,isFull) { - var d = getDate(ts*1000) - var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); - if(isFull==1) - fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') - return fm; - }, - setcolor:function(ind){ - if(ind==0) return "red"; - if(ind==1) return "green"; - if(ind==2) return "blue"; - if(ind==11) return "green"; - if(ind==12) return "blue"; - return ""; - }, - setbgcolor: function (ind) { - if (ind == 0) return "#ffa1b9"; - if (ind == 1) return "#59e1d2"; - if (ind == 2) return "#a3bcff"; - if (ind == 11) return "#59e1d2"; - if (ind == 12) return "#a3bcff"; - return ""; - }, - - get_type:function(ind){ - if (ind == 0) return "全场通用"; - if (ind == 1) return "品牌"; - if (ind == 2) return "品类"; - if (ind == 11) return "用途"; - if (ind == 12) return "分类1"; - return ""; - }, - get_type_card:function(ind){ - if (ind == 0) return "全场通用"; - if (ind == 1) return "指定品牌"; - if (ind == 2) return "指定品类"; - if (ind == 11) return "指定用途"; - if (ind == 12) return "指定分类1"; - return ""; - }, - format_huiche:function (text) { - if (!text) { - return ""; - } - var reg = getRegExp('\\\\n', 'g') - return text.replace(reg, '\n') - } -} - -module.exports = { - toFix: filters.toFix, - format_time:filters.format_time, - setcolor:filters.setcolor, - setbgcolor: filters.setbgcolor, - get_type: filters.get_type, - get_split_name: filters.get_split_name, - get_type_card: filters.get_type_card, - format_huiche: filters.format_huiche, -} \ No newline at end of file diff --git a/pages/user/user_coupon/filter.wxs b/pages/user/user_coupon/filter.wxs deleted file mode 100644 index c0e8d13..0000000 --- a/pages/user/user_coupon/filter.wxs +++ /dev/null @@ -1,11 +0,0 @@ -var format = function (text) { - if (!text) { - return - } - var reg = getRegExp('\\\\n', 'g') - return text.replace(reg, '\n') -} - -module.exports = { - format: format -} diff --git a/pages/user/user_coupon/user_coupon.js b/pages/user/user_coupon/user_coupon.js deleted file mode 100644 index cb47790..0000000 --- a/pages/user/user_coupon/user_coupon.js +++ /dev/null @@ -1,160 +0,0 @@ -// pages/user/user_coupon/user_coupon.js -var e = getApp(),os = e.globalData.setting; -var utils = require('../../../utils/util.js'); -var regeneratorRuntime = require('../../../utils/runtime.js'); - -Page({ - /** - * 页面的初始数据 - */ - data: { - judge:0, - quan_list:null, - iurl:os.imghost, - h_pic:null, - GradeId:null, - FormId:null, - now:'', - }, - clik_coupon:function(){ - this.setData({ - judge:1 - }) - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - console.log("onLoad"); - console.log(options); - var h_pic=options.img; - - if(h_pic.indexOf("http")==-1){ - h_pic= os.imghost+h_pic; - } - - var FormId=options.FormId; - var GradeId=options.gradeId; - var now=utils.gettimestamp(); - this.setData({h_pic:h_pic,GradeId:GradeId,FormId:FormId,now:now}); - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow:async function () { - var th = this,q_list=null; - - //--获取列表-- - await getApp().request.promiseGet("/api/weshop/users/grade/wechat/cash/page", { - data:{ storeId:os.stoid,FormId:th.data.FormId,GradeId:th.data.GradeId,userId:getApp().globalData.user_id} - }).then(res => { - q_list = res.data.data.pageData; - }) - //取分类最后一级 - for(var i in q_list){ - var name=q_list[i].UseObjectName; - var arr=name.split("\\") - q_list[i].UseObjectName=arr[arr.length-1]; - q_list[i].Remark = q_list[i].Remark.replace(/\n/g, "\n") - } - th.setData({quan_list:q_list}); - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - //获取券 - get_quan:function (e) { - var th=this,index=e.currentTarget.dataset.ind; - var item = this.data.quan_list[index]; - var can_get = item.ObtainTimes; - var Obtain = item.Obtain; - var Id = item.Id; - - if (!Obtain || Obtain == undefined) Obtain = 0; - - getApp().request.post("/api/weshop/users/grade/cash/insert",{ - data:{ - privilegeId:Id, - storeId:os.stoid, - userId:getApp().globalData.user_id, - }, - success:function (e) { - if(e.data.code==0){ - var txt="quan_list["+index+"].ObtainTimes" - var obj={};obj[txt]=can_get-1; - - var text = "quan_list[" + index + "].Obtain"; Obtain++; - obj[text] = Obtain; - th.setData(obj); - getApp().my_warnning("您已成功领取该券",1,th); - } - } - }) - }, - - //点击核销券 - get_out:function (e) { - var qt_txt = this.selectComponent("#pop_txt"); //组件的id - var ob={title:"温馨提示",content:"当前优惠券已领取,点击二维码可立即使用"}; - qt_txt.open(ob); - - }, - - clik_coupon:function (e) { - var ind=e.currentTarget.dataset.ind; - var is_open=this.data.quan_list[ind].is_open; - if(is_open==1) is_open=0; - else is_open=1; - - var txt="quan_list["+ind+"].is_open" - var obj={};obj[txt]=is_open; - this.setData(obj); - }, - - //--显示核销券-- - show_quan:function (e) { - var ind=e.currentTarget.dataset.ind; - var item=this.data.quan_list[ind]; - var pId=this.data.quan_list[ind].Id; - var th=this; - var validay = item.Validay; - var now = e.currentTarget.dataset.now; - - getApp().request.get("/api/weshop/users/grade/cash/code/get",{ - data:{ - storeId:os.stoid, - privilegeId:pId, - userId:getApp().globalData.user_id, - }, - success:function (e) { - console.log(e); - console.log('/code/get'); - var name= e.data.data.UseObjectName; - - //--获取成功的时候-- - if(e.data.code==0){ - var no=e.data.data.CashRepNo; - var qc_com = th.selectComponent("#qc_com"); //组件的id - var obj={val:no,content:"请将二维码展示给核销员,抵券更快捷",now: now, validay: validay, name: name,is_quan:1}; - qc_com.open(obj) - - }else{ - var qt_txt = this.selectComponent("#pop_txt"); //组件的id - var ob={title:"温馨提示",content:"您暂时还没有该券"}; - qt_txt.open(ob); - } - - } - }) - - - } - -}) \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.json b/pages/user/user_coupon/user_coupon.json deleted file mode 100644 index 31d3bbc..0000000 --- a/pages/user/user_coupon/user_coupon.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "navigationBarTitleText": "我的优惠券", - "usingComponents": { - "qr_code": "/components/qr_code/qr_code", - "pop_txt": "/components/userqy_pop_up/userqy_pop_up", - "warn": "/components/long_warn/long_warn" - } -} \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.wxml b/pages/user/user_coupon/user_coupon.wxml deleted file mode 100644 index 7b6df4a..0000000 --- a/pages/user/user_coupon/user_coupon.wxml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - x{{item.ObtainTimes}} - - - - - - {{item.CashSum}} - - - - 无使用门槛 - - - 满{{item.BuySum}}元可用 - - - - - - - - - - - - - - - {{filter.get_type_card(item.UseObjectType)}} - - {{item.PrivilegeName}} - - - - {{filter.format_time(now)}}至{{item.Validay}} - - - - - - - - - - - 立即领取 - 已领取 - - - - - 优惠券使用说明 - - - - - - - - - - - - {{util.format(item.Remark)}} - - - - - - - - - - - - - - - - - - - - diff --git a/pages/user/user_coupon/user_coupon.wxss b/pages/user/user_coupon/user_coupon.wxss deleted file mode 100644 index 53b47d6..0000000 --- a/pages/user/user_coupon/user_coupon.wxss +++ /dev/null @@ -1,181 +0,0 @@ -.xc-coupon-img{ - width: 100%; - height: 330rpx; -} -.xc-coupon-frame{ - width: 710rpx; - height:auto; - margin: 0 auto; - -} -.xc-coupon-frame .coupon-frame{ - width: 100%; - height: 200rpx; - margin-top:10rpx; - -} -.xc-coupon-frame .coupon-frame .coupon-left{ - width: 215rpx; - height:100%; - overflow: hidden; -} -.xc-money-frame{ - width:96%; - margin-top: -10px; -} - -.xc-rmb-symbol{ - font-size:36rpx; - font-weight: bold -} - -.xc-rmb-val{ - font-size:78rpx; - font-weight: bolder -} -.coupon-explain{ - font-size:25rpx; -width:100%; - - -} -.xc-valuer{ - margin-top:39rpx; - margin-left:28rpx; - font-size:25rpx; -} -.coupon-frame .oval{ - width:155rpx; - height:83rpx; - border-radius: 50%; - right:-78rpx; - top:-37rpx; -} -.coupon-right{ - width:490rpx; - height: 99%; - border-top: 1rpx solid #eaeaea; - border-bottom: 1rpx solid #eaeaea; - border-right: 1rpx solid #eaeaea; - -} -.coupon-annotation{ - width: 95%; - height: 100%; - -} -.xc-brand{ - width:100rpx; - height:35rpx; - line-height: 35rpx; - font-size:21rpx; - border-radius:10rpx; position: relative; top:-1px; -} -.top-frame{ - width:82%; - height: 75rpx; - margin-top:10rpx; - -} -.top-frame .coupon-wode{ - font-size: 25rpx; - margin-left:10rpx; - width:340rpx; - height:88rpx; -} -.coupon-code{ - width:60rpx; - height:60rpx; - margin-top:5rpx; - -} -.frame{ - width: 100% -} -.coupon-time{ - font-size: 23rpx; - line-height:33rpx; - color: #7d7d7d; -} - -.clik-get{ - width:125rpx; - height:45rpx; - border-radius: 25rpx; - line-height: 45rpx; - font-size:25rpx; - bottom:67rpx; - right:6px; -} - -.code-img{ - margin-left:20rpx; -} -.bottmo-explain{ -top:145rpx; -width:94%; -border-top:1rpx dashed #eee; -padding-top:8rpx; -height:38rpx; -line-height: 51rpx; - -} -.font-word{ - font-size: 22rpx; -} -.circle-size{ - background: #a0a0a0; - width: 26rpx; - height: 26rpx; - margin-top:13rpx; -margin-left:8rpx; - - -} -.xc-jiantou{ - width: 10rpx; - height: 10rpx; - border-top: 2rpx solid #fff; - border-right: 2rpx solid #fff; - transform: rotate(133deg); - display:inline-block; - margin-left: 8rpx; - margin-top:6rpx; - -} -.xc-buttom{ - width:700rpx; -min-height:76rpx; -height:auto; -line-height:40rpx; -border-left:1rpx solid #eee; -border-right:1rpx solid #eee; -border-bottom:1rpx solid #eee; -margin:0 0rpx 0 22rpx; - - -} -.explain-coupon{ - - font-size:25rpx; - -} -.circle-frame{ - width: 20rpx; - height: auto; - z-index:1; - left:210rpx; - -} -.circle-sawtooth{ - width: 11rpx; - height: 11rpx; - background: #fff; -} - -.red{background-color: #fe7496;} -.green{ background-color: #22c7c1;} -.blue{background-color:#5e82e3;} -.g_gray{background-color: #aaaaaa} - -.f_text{text-align: center; height:96rpx; } \ No newline at end of file diff --git a/pages/user/userqy/userqy.js b/pages/user/userqy/userqy.js index 4257cd2..9a244d0 100644 --- a/pages/user/userqy/userqy.js +++ b/pages/user/userqy/userqy.js @@ -190,7 +190,7 @@ Page({ switch (no) { case "01": - getApp().goto("/pages/user/user_coupon/user_coupon?img=" + getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" +url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); break; case "02": diff --git a/pages/user/view_comment/view_comment.js b/pages/user/view_comment/view_comment.js deleted file mode 100644 index 95e3fc3..0000000 --- a/pages/user/view_comment/view_comment.js +++ /dev/null @@ -1,127 +0,0 @@ -var i = require("../../../utils/util.js"), - ut = i; -var e = getApp(), - a = e.globalData.setting, - os = a, - t = e.request, - d = e.globalData; -Page({ - - /** - * 页面的初始数据 - */ - data: { - url: a.url, - iurl: a.imghost, - comment: [], //用户单个评价的内容 - goods_id: "", //商品id - order_id: "", //订单id - is_act: 0, //是否开启活动 - actId: "", //活动id - giftBagId: "", //礼包id - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function(options) { - var th = this; - th.setData({ - goods_id: options.goods_id, - order_id: options.order_id - }) - th.query_comment(); - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { - - }, - query_comment: function() { - var th = this; - wx.showLoading({ - title: '加载中' - }) - var url = "/api/weshop/comment/list"; - getApp().request.promiseGet(url, { - data: { - store_id: a.stoid, - userId: d.user_id, - goods_id: th.data.goods_id, - order_id: th.data.order_id - } - }).then(res => { - wx.hideLoading(); - if (res.data.code == 0) { - var data = res.data.data.pageData; - if (data[0].img) data[0].img = ut.unserialize(data[0].img); - if (data[0].weapp_img) data[0].weapp_img = JSON.parse(data[0].weapp_img); - th.setData({ - comment: data - }) - th.judge_act(); //判断是否开启评价有礼 - } else { - getApp().my_warnning("系统繁忙,请稍后再试", 0, th); - } - }) - }, - //评价有礼判断 - judge_act: function() { - var th = this; - var url = "/api/weshop/marketing/comment/act/judge"; - getApp().request.promiseGet(url, { - data: { - orderGoodsId: th.data.goods_id, - orderNumber: th.data.order_id, - orderType: 1, - storeId: a.stoid, - userId: d.user_id - } - }).then(res => { - if (res.data.code == 0) { - var id = res.data.data.id; - var giftbagid = res.data.data.giftbagid; - th.setData({ - is_act: 1, - actId: id, - giftBagId: giftbagid - }) - } else { - - } - }) - }, - //预览图片 - previewImg: function(e) { - var th = this; - var index = e.currentTarget.dataset.index; - var sindex = e.currentTarget.dataset.sindex; - var imgArr = th.data.comment; - var image = imgArr[0].weapp_img; - var imagename = ""; - var iurl = th.data.iurl; - if (image != "") { - image = imgArr[0].weapp_img[index]; - wx.previewImage({ - current: iurl + image, - //当前图片地址 - urls: imgArr[0].weapp_img, //所有要预览的图片的地址集合 数组形式 - }) - } else { - image = imgArr[0].img[index]; - wx.previewImage({ - current: iurl + image, - //当前图片地址 - urls: imgArr[0].img, //所有要预览的图片的地址集合 数组形式 - }) - } - }, - goto: function(e) { - var th = this; - var url = e.currentTarget.dataset.url; - getApp().goto(url); - } - -}) \ No newline at end of file diff --git a/pages/user/view_comment/view_comment.json b/pages/user/view_comment/view_comment.json deleted file mode 100644 index eacc6fa..0000000 --- a/pages/user/view_comment/view_comment.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "navigationBarTitleText": "查看评价", - "usingComponents": { - "warn": "/components/long_warn/long_warn", - "my_confirm": "/components/my_confirm/my_confirm" - } -} \ No newline at end of file diff --git a/pages/user/view_comment/view_comment.wxml b/pages/user/view_comment/view_comment.wxml deleted file mode 100644 index 793444c..0000000 --- a/pages/user/view_comment/view_comment.wxml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - {{item.goods_name}} - - - - - - {{item.goods_price}} - - - - - x - {{item.goods_num}} - - - - - - - - - - - - {{item.content}} - - - - - - - - - - - - - - - - - - - - - - - - 宝贝评分 - - - - - - 描述相符 - - - - - - - - - 物流服务 - - - - - - - - 服务态度 - - - - - - - - - - - - - - - - 评价其他 - - - 点击领取礼品 - - - - - - \ No newline at end of file diff --git a/pages/user/view_comment/view_comment.wxss b/pages/user/view_comment/view_comment.wxss deleted file mode 100644 index ed974d5..0000000 --- a/pages/user/view_comment/view_comment.wxss +++ /dev/null @@ -1,170 +0,0 @@ -page{ - overflow-x: hidden; -} -/* 商品详情和评价 */ -.commoditymax{ - overflow-x: hidden; -} -.commodity { - border-top: 6rpx solid rgb(245, 245, 245); - border-bottom: 6rpx solid rgb(245, 245, 245); - padding: 0rpx 30rpx; - padding-bottom:10rpx; -} - -.commodity .information { - height: 286rpx; -} - -.commodity .information image { - width: 186rpx; - height: 186rpx; -} - -.information .goods_name { - width: 480rpx; - margin-left: 25rpx; - height: 186rpx; -} - -.information .goods_name .ellipsis-2 { - line-height: 40rpx; - height: 80rpx; -} - -.information .goods_name .jc_sb { - margin-top: 60rpx; - color: rgb(212, 28, 52); - margin-right: 7rpx; -} - -.information .goods_name .jc_sb .fs32 { - line-height: 40rpx; -} - -.information .goods_name .jc_sb .sum { - margin-right: 5rpx; -} - -.balin { - align-items: baseline; -} - -.addComment { - width: 690rpx; - padding: 32rpx 0rpx 21rpx 0rpx; -} - -.addComment textarea { - padding: 0rpx 18rpx; - max-height: 100rpx; - width: 654rpx; -} - -.addComment .addimages { - padding: 0rpx 18rpx; - margin-top: 20rpx; - align-items: flex-end; - width: 652rpx; - margin-bottom: 15rpx; -} -.comment{ - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 3; -} -.addComment .addimages .images { - height: 140rpx; -} - -.addComment .addimages .images .rel { - width: 140rpx; - height: 100%; - overflow: visible; - margin-right: 15rpx; -} - -.addComment .addimages .images image .abs { - width: 30rpx; - height: 30rpx; - top: -7rpx; - right: -7rpx; -} - -.addComment .addimage { - width: 139rpx; - height: 139rpx; - border: 2rpx dashed rgb(196, 196, 196); - font-size: 16rpx; - margin-left: 6rpx; -} - -.addComment .addimage image { - width: 60rpx; - height: 58rpx; -} - -.Grade { - width: 100%; - height: 310rpx; - border-bottom: 6rpx solid rgb(245, 245, 245); - padding-left: 45rpx; -} - -.Grade .title { - width: 100%; - height: 105rpx; -} - -.Grade .title .column { - height: 30rpx; - border-left: 6rpx solid rgb(211, 27, 58); - margin-right: 12rpx; -} - -.Grade .score-item { - height: 55rpx; - line-height: 55rpx; -} - -.Grade .score-item .stars { - margin-left: 83rpx; -} -.Grade .score-item .stars view{ - width: 60rpx; - height: 55rpx; -} - -.Grade .score-item .stars image { - width: 35rpx; - height: 35rpx; -} -.Whether { - padding:0rpx 31rpx; -} -.Whether .flex-right-vertical { - height: 67rpx; -} - -.Whether .flex-right-vertical .radio { - margin-right: 15rpx; -} - -.Whether .Submission { - margin: 40rpx 0 40rpx 0; -} - -.Whether .white { - width: 364rpx; - height: 58rpx; - background-color: rgb(212, 28, 52); - border-radius: 40rpx; - line-height: 58rpx; -} -.Whether .receive{ - background-color: rgb(255, 176, 63); -} - - -- libgit2 0.21.4