Commit df12f2e8b7371fd90fe4fd70bc8d70e91be7c6d6

Authored by yvan.ni
1 parent ec12e1ac

pos销售评价

app.json
@@ -154,7 +154,9 @@ @@ -154,7 +154,9 @@
154 "pages/user/view_comment/view_comment", 154 "pages/user/view_comment/view_comment",
155 "pages/user/add_comment/add_comment", 155 "pages/user/add_comment/add_comment",
156 "pages/user/user_coupon/user_coupon", 156 "pages/user/user_coupon/user_coupon",
157 - "pages/user/buyDetails/buyDetails" 157 + "pages/user/buyDetails/buyDetails",
  158 + "pages/evaluate/evaluate",
  159 + "pages/evaluate_list/evaluate_list"
158 ] 160 ]
159 161
160 } 162 }
packageB/pages/evaluate/evaluate.js 0 → 100644
  1 + var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a,
  4 + t = e.request,
  5 + d = e.globalData;
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + url: a.url, //接口网址
  13 + iurl: a.imghost,
  14 + defimgurl: "/miniapp/images/no-head.jpg",
  15 + stars_index: -1, //当前点击的星星下标
  16 + labels: [], //星级标签数组
  17 + sub_evaluate: 0, //是否评价成功
  18 + proposal: "", //用户输入的建议
  19 + proposal_size: 100, //评价意见和建议限定字数
  20 + number: "", //订单单号
  21 + beautician: "", //美容师信息
  22 + fromType: "服务评价", //评价来源
  23 + arrangeTime: "", //服务日期
  24 + is_evaluate: 0, //是否评价
  25 + EvaluateDatetime: "", //评价时间
  26 + is_act:0, //是否能购获取图片
  27 + actId:0, //活动ID
  28 + giftBagId:0, //礼包ID
  29 +
  30 + },
  31 + //点击星级
  32 + check_stars: function(e) {
  33 + var th = this;
  34 + var is_evaluate = th.data.is_evaluate; //0可点击
  35 + if (is_evaluate == 0) {
  36 + var index = e.currentTarget.dataset.index;
  37 + var stars_index = th.data.stars_index;
  38 + if (index != stars_index) {
  39 + var url = "/api/weshop/marketing/reservation/star/label/list";
  40 + getApp().request.promiseGet(url, {
  41 + data: {
  42 + Star: index + 1,
  43 + storeId: a.stoid
  44 + }
  45 + }).then(res => {
  46 + if (res.data.code == 0) {
  47 + th.setData({
  48 + labels: res.data.data
  49 + })
  50 + } else {
  51 + getApp().my_warnning(res.data.msg, 0, th);
  52 + return;
  53 + }
  54 + })
  55 + th.setData({
  56 + stars_index: index
  57 + })
  58 + }
  59 + }
  60 + },
  61 + //输入评价意见和建议
  62 + input_proposal: function(e) {
  63 + var th = this;
  64 + var value = e.detail.value;
  65 + th.setData({
  66 + proposal: value
  67 + })
  68 + },
  69 + //图片失败,默认图片
  70 + bind_bnerr1: function (e) {
  71 + var th = this;
  72 + var _errImg = e.target.dataset.errorimg;
  73 + var _Img = e.target.dataset.img;
  74 + if (_Img != undefined) {
  75 + var _errObj = {};
  76 + _errObj[_errImg] = "/miniapp/images/no-head.jpg";
  77 + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  78 + }
  79 + },
  80 + //选择标签
  81 + check_label: function(e) {
  82 + var th = this;
  83 + var evaluate = th.data.is_evaluate; //0为未评价,未评价才可点击标签
  84 + if (evaluate == 0) {
  85 + var index = e.currentTarget.dataset.index;
  86 + var label_id = th.data.labels[index].check;
  87 + var labels = 'labels[' + index + '].check';
  88 + if (label_id) {
  89 + label_id = 0
  90 + } else {
  91 + label_id = 1
  92 + }
  93 + th.setData({
  94 + [labels]: label_id
  95 + })
  96 + }
  97 + },
  98 +
  99 + //查询美导信息
  100 + query_bea: function() {
  101 + var th = this;
  102 + var url = "/api/weshop/order/pagePosOrder";
  103 + var number = th.data.number; //订单编号
  104 + getApp().request.promiseGet(url, {
  105 + data: {
  106 + store_id: a.stoid,
  107 + user_id: d.user_id,
  108 + No: number
  109 + }
  110 + }).then(res => {
  111 + if (res.data.code == 0) {
  112 + var data = res.data.data.pageData;
  113 + var arrangeTime = data[0].ArrangeTime;
  114 + th.setData({
  115 + beautician: data,
  116 + arrangeTime: arrangeTime
  117 + })
  118 + } else {
  119 + getApp().my_warnning(res.data.msg, 0, th);
  120 + }
  121 + })
  122 + },
  123 +
  124 + //获取预约评价
  125 + evaluate_get: function() {
  126 + var th = this;
  127 + var url = "/api/weshop/evaluation/evaluate/get";
  128 + getApp().request.promiseGet(url, {
  129 + data: {
  130 + number: th.data.number,
  131 + storeId: a.stoid
  132 + }
  133 + }).then(res => {
  134 + if (res.data.code == 0) {
  135 + var list=[];
  136 + res.data.data.BillDate=res.data.data.BillDate.replace(".0",'');
  137 + list.push(res.data.data);
  138 +
  139 + th.setData({
  140 + stars_index: res.data.data.Star-1,
  141 + labels: res.data.data.EvaluationList,
  142 + proposal: res.data.data.Remark,
  143 + EvaluateDatetime: res.data.data.EvaluateDatetime.substring(0, 19),
  144 + beautician:list,
  145 + })
  146 + } else {
  147 + getApp().my_warnning(res.data.msg, 0, th);
  148 + }
  149 + })
  150 + },
  151 + //提交评价
  152 + evaluate_save: function() {
  153 + var th = this;
  154 + var stars = th.data.stars_index; //评价星级
  155 + var proposal = th.data.proposal;
  156 + //判断是否评级
  157 + if (stars < 0) {
  158 + getApp().my_warnning("请进行评分", 0, th);
  159 + return false;
  160 + } else if (proposal == "") {
  161 + getApp().my_warnning("给点建议呗", 0, th);
  162 + return false;
  163 + }
  164 + wx.showLoading({
  165 + title: '加载中',
  166 + })
  167 + var labels = th.data.labels; //星级标签数组
  168 + var evaLabList = []; //用户选择的评价标签
  169 + // 查询评价标签
  170 + for (var i = 0; i < labels.length; i++) {
  171 + if (labels[i].check) {
  172 + evaLabList.push(labels[i].LabelName);
  173 + }
  174 + }
  175 + var url = th.data.url + "/api/weshop/evaluation/evaluate/insert";
  176 + var posNo = th.data.number; //收银单号
  177 + var proposal = th.data.proposal; //用户建议内容
  178 + var fromType = th.data.fromType; //评价来源
  179 + var json = {
  180 + "evaLabList": evaLabList,
  181 + "fromType": 1,
  182 + "number": posNo,
  183 + "remark": proposal,
  184 + "star": stars + 1,
  185 + "storeId": a.stoid
  186 + };
  187 + var data = JSON.stringify(json); //转换成json格式
  188 + wx.request({
  189 + url: url,
  190 + data: data,
  191 + method: 'POST',
  192 + header: {
  193 + 'content-type': 'application/json'
  194 + }, // 设置请求的 header
  195 + success: function(res) {
  196 + wx.hideLoading();
  197 + if (res.data.code == 0) {
  198 + getApp().my_warnning("评价成功", 1, th);
  199 + var namber=th.data.number;
  200 + setTimeout(function() {
  201 + wx.redirectTo({
  202 + url: "/packageB/pages/evaluate_list/evaluate_list?IsEvaluate=1"
  203 + });
  204 + }, 2000);
  205 + } else {
  206 + getApp().my_warnning(res.data.msg, 0, th);
  207 + }
  208 + }
  209 + })
  210 + },
  211 +
  212 + /**
  213 + * 生命周期函数--监听页面加载
  214 + */
  215 + onLoad: function(options) {
  216 + var th = this;
  217 + th.setData({
  218 + number: options.number,
  219 + //is_evaluate: options.evaluate
  220 + })
  221 + //th.query_bea();
  222 + //th.judge_act();
  223 + var userinfo=getApp().globalData.userInfo;
  224 + console.log("userinfo",userinfo)
  225 +
  226 + if(!userinfo){
  227 + getApp().goto("/pages/togoin/togoin");
  228 + }
  229 +
  230 +
  231 + },
  232 +
  233 + /**
  234 + * 生命周期函数--监听页面显示
  235 + */
  236 + onShow: function() {
  237 + //var th = this;
  238 + //var is_evaluate = th.data.is_evaluate;
  239 + //if (is_evaluate == 1) {
  240 + // th.evaluate_get();
  241 + //}
  242 + //判断有没有评价
  243 + this.check_is_pj();
  244 + },
  245 +
  246 +
  247 + //评价其他跳转
  248 + evaluate_qt:function(e){
  249 + var status=e.currentTarget.dataset.status;
  250 + if(!status) status=0;
  251 + wx.redirectTo({
  252 + url: "/packageB/pages/evaluate_list/evaluate_list?IsEvaluate="+status
  253 + });
  254 + },
  255 +
  256 +
  257 +
  258 + //点击领取礼包
  259 + clike_lb:function(){
  260 +
  261 + var id=this.data.actId;
  262 + var gifbagid = this.data.gifbagid;
  263 + console.log(id,"订单", this.data.number),
  264 + wx.redirectTo({
  265 + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType=2&orderNumber="+this.data.number
  266 + });
  267 +
  268 + },
  269 +
  270 + //--评价有礼判断---
  271 + judge_act: function () {
  272 + var th = this;
  273 + var url = "/api/weshop/marketing/comment/act/judge";
  274 + getApp().request.promiseGet(url, {
  275 + data: {
  276 + orderNumber: th.data.number,
  277 + orderType: 2,
  278 + storeId: a.stoid,
  279 + userId: d.user_id
  280 + }
  281 + }).then(res => {
  282 + if (res.data.code == 0) {
  283 + var id = res.data.data.id;
  284 + var giftbagid = res.data.data.giftbagid;
  285 + th.setData({
  286 + is_act: 1,
  287 + actId: id,
  288 + giftBagId: giftbagid
  289 + })
  290 + } else{
  291 + th.setData({
  292 + is_act:0
  293 + })
  294 + }
  295 + })
  296 + },
  297 +
  298 + //判断是不是已经评价了
  299 + check_is_pj:function(){
  300 + var th=this;
  301 + var chekc_data={};
  302 + chekc_data['storeId'] = a.stoid;
  303 + chekc_data['number'] =this.data.number;
  304 + getApp().request.get("/api/weshop/evaluation/evaluate/check",{
  305 + data:chekc_data,
  306 + success:function(res){
  307 + if(res.data.code==0){
  308 + //没有评价的情况下
  309 + if(res.data.data==='0'){
  310 + th.query_bea();
  311 + th.setData({is_get:1})
  312 + }else if(res.data.data==="1"){
  313 + th.evaluate_get();
  314 + th.setData({is_evaluate:1,is_get:1})
  315 + }
  316 + }else{
  317 + getApp().my_warnning(res.data.msg, 0, th);
  318 + }
  319 + }
  320 + })
  321 +
  322 + },
  323 +
  324 + //跳转到链接地址
  325 + goto:function(e){
  326 + var url=e.currentTarget.dataset.url;
  327 + getApp().goto(url);
  328 + },
  329 +
  330 + //弹出显示商品
  331 + show_goods:function(e){
  332 + var index=e.currentTarget.dataset.index;
  333 + var item=this.data.beautician[index];
  334 + var show_goods_list=item.list;
  335 + this.setData({
  336 + show_goods_list:show_goods_list,
  337 + sh_pop:1
  338 + })
  339 + },
  340 +
  341 + //关闭弹出
  342 + close_pop:function(){
  343 + this.setData({
  344 + show_goods_list:null,sh_pop:0
  345 + })
  346 + }
  347 +
  348 +})
0 \ No newline at end of file 349 \ No newline at end of file
packageB/pages/evaluate/evaluate.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "导购评价",
  3 + "usingComponents": {
  4 + "qr_code": "/components/qr_code/qr_code",
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageB/pages/evaluate/evaluate.wxml 0 → 100644
  1 +<view class="container" wx:for="{{beautician}}" wx:if="{{index<1}}" wx:for-item="it">
  2 + <!-- 头像 -->
  3 + <view class="flex-center head">
  4 + <image class="headimg" src="{{!it.PhotoUrl || it.PhotoUrl==''?iurl+defimgurl:it.PhotoUrl}}" lazy-load="true"
  5 + data-errorimg="beautician[{{index}}].PhotoUrl"
  6 + binderror="bind_bnerr1" data-img="beautician[{{index}}].PhotoUrl"></image>
  7 + </view>
  8 +
  9 + <!-- 姓名 -->
  10 + <view class="flex-level item">
  11 + <view class="itemlf flex-level-right">
  12 + <view class="fs32">导购名称:</view>
  13 + </view>
  14 + <view class="itemlr fs30 ellipsis-1">{{it.StaffName?it.StaffName:'无'}}</view>
  15 + </view>
  16 +
  17 + <!-- 项目 -->
  18 + <view class="flex-center item" bindtap="show_goods" data-index="{{index}}">
  19 + <view class="itemlf fs32 flex-level-right">购买商品:</view>
  20 + <view class="itemlr fs30 ellipsis-1 go_right">{{it.list[0].WareName}}</view>
  21 + </view>
  22 +
  23 + <!-- 时间 -->
  24 + <view class="flex-center item">
  25 + <view class="itemlf fs32 flex-level-right">购买时间:</view>
  26 + <view class="itemlr fs30">{{it.BillDate}}</view>
  27 + </view>
  28 +
  29 + <!-- 评价时间 -->
  30 + <view class="flex-center" wx:if="{{is_evaluate==1}}">
  31 + <view class="itemlf fs32 flex-level-right">评价时间:</view>
  32 + <view class="itemlr fs30">{{EvaluateDatetime}}</view>
  33 + </view>
  34 +
  35 + <!-- 设置虚线 -->
  36 + <view class="flex-center">
  37 + <view class="starss">
  38 + <image class="stars" src="{{iurl}}{{key<=stars_index?'/miniapp/images/StarsredCk.png':'/miniapp/images/StarswhiteUnCk.png'}}" wx:for="{{5}}" bindtap="check_stars" data-index="{{key}}" wx:for-index="key"></image>
  39 + </view>
  40 + </view>
  41 + <view class="tea_labs">
  42 + <view class="flex-center fs26">
  43 + <block wx:if="{{is_evaluate==0}}">
  44 + <textarea class="rel textarea" placeholder="写其他意见和建议" placeholder-class="fs24" maxlength="{{proposal_size}}" bindinput="input_proposal" value="{{proposal}}">
  45 + <!-- 提示已输入多少数字 -->
  46 + <view if="{{is_evaluate==0}}" class="proposal abs">{{proposal.length}}/{{proposal_size}}</view>
  47 + </textarea>
  48 + </block>
  49 + <block wx:else>
  50 + <view wx:if="{{proposal!=''}}" class="textarea">
  51 + {{proposal}}
  52 + </view>
  53 + </block>
  54 + </view>
  55 +
  56 + <view wx:if="{{labels.length>0 && is_evaluate==0}}" class="labels flex fs24 ellipsis-3">
  57 + <view class="label {{item.check==1?'checklabel':''}} flex-center" wx:for="{{labels}}" bindtap="check_label" data-index="{{key}}" wx:for-index="key">
  58 + <view class="ellipsis-1">{{item.LabelName}}</view>
  59 + </view>
  60 +
  61 + </view>
  62 + <view wx:if="{{labels.length>0 && is_evaluate==1}}" class="{{labels.length==1 || labels.length==2?'flex-center':''}}" style="width:100%;">
  63 + <view class="labels flex fs24 ellipsis-3">
  64 + <view class="label checklabel flex-center" wx:for="{{labels}}" bindtap="check_label" data-index="{{key}}" wx:for-index="key">
  65 + <view class="ellipsis-1">{{item.LabelName}}</view>
  66 + </view>
  67 +
  68 + </view>
  69 + </view>
  70 +
  71 + </view>
  72 +
  73 + <view wx:if="{{is_evaluate==0}}" class="feedback flex-center fs28">
  74 + <view>满意的话请打五星噢,谢谢您的支持!</view>
  75 + </view>
  76 +
  77 + <block wx:if="{{sub_evaluate}}">
  78 + <view class="subSuccess">
  79 + <view class="flex-center">
  80 + <image class="Success" src="{{iurl}}/miniapp/images/yyservice/Success.png"></image>
  81 + </view>
  82 + <view class="fs36 flex-center">
  83 + <view>评价成功</view>
  84 + </view>
  85 + </view>
  86 + </block>
  87 +</view>
  88 +
  89 +<block wx:if="{{is_get}}">
  90 +<navigator wx:if="{{is_evaluate==0}}" class="Subs fs32 flex-center">
  91 + <view class="Submission flex-center" bindtap="evaluate_save">
  92 + <view>确认提交</view>
  93 + </view>
  94 +</navigator>
  95 +<view wx:else>
  96 +
  97 +
  98 + <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt">
  99 + <view>评价其他</view>
  100 + </view>
  101 + <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt" data-status="1">
  102 + <view>查看已评价的订单</view>
  103 + </view>
  104 +
  105 + <!-- 显示来个图标 -->
  106 + <view class="show_icon" style="margin-top: 60rpx;">
  107 + <view class="icon_item" bindtap="goto" data-url="/pages/index/index/index">
  108 + <view>
  109 + <image style="width: 60rpx; height: 50rpx;" src="{{iurl}}/miniapp/images/evaluate/store.png"></image>
  110 + <view>溜街</view>
  111 + </view>
  112 + </view>
  113 + <view class="icon_item" bindtap="goto" data-url="/packageA/pages/quan_list/quan_list">
  114 + <view>
  115 + <image style="width: 70rpx; height: 50rpx;" src="{{iurl}}/miniapp/images/evaluate/lq.png"></image>
  116 + <view>领券</view>
  117 + </view>
  118 + </view>
  119 + </view>
  120 +
  121 + <view style="height: 60rpx;"></view>
  122 + <view wx:if="{{is_act==1}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb">
  123 + <view>点击领取礼品</view>
  124 + </view>
  125 + </view>
  126 +<warn id="warn"></warn>
  127 +</block>
  128 +
  129 +
  130 +<view hidden="{{!sh_pop}}">
  131 + <view class="cover-layer" bindtap="close_pop"></view>
  132 + <view class="show_pop_div">
  133 + <view class="title">商品详情</view>
  134 + <view style="padding: 0 20rpx;">
  135 + <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}">
  136 + <view>{{item.WareName}}</view>
  137 + <view>{{item.Qty}}</view>
  138 + </view>
  139 + </view>
  140 + </view>
  141 +</view>
  142 +
packageB/pages/evaluate/evaluate.wxss 0 → 100644
  1 +.container {
  2 + border-top: 7rpx solid rgb(245, 245, 245);
  3 + padding-bottom: 100rpx;
  4 + background-color: rgb(255, 255, 255);
  5 +}
  6 +
  7 +.head {
  8 + height: 270rpx;
  9 +}
  10 +
  11 +.headimg {
  12 + width: 190rpx;
  13 + height: 190rpx;
  14 + border-radius: 50%;
  15 +}
  16 +
  17 +.item {
  18 + margin-bottom: 20rpx;
  19 +}
  20 +
  21 +.itemlf {
  22 + width: 195rpx;
  23 +}
  24 +
  25 +.itemlr {
  26 + width: 360rpx;
  27 +}
  28 +
  29 +.starss {
  30 + margin-top: 15rpx;
  31 + border-top: 3rpx dashed rgb(203, 203, 203);
  32 + padding-top: 25rpx;
  33 + padding-left: 15rpx;
  34 +}
  35 +
  36 +.stars {
  37 + width: 50rpx;
  38 + height: 50rpx;
  39 + margin-right: 20rpx;
  40 +}
  41 +
  42 +.datetime {
  43 + width: 190rpx;
  44 +}
  45 +
  46 +.tea_labs {
  47 + padding: 0rpx 56rpx;
  48 + margin-top: 20rpx;
  49 +}
  50 +
  51 +.proposal {
  52 + right: 20rpx;
  53 + bottom: 20rpx;
  54 + color: rgb(152, 152, 152);
  55 +}
  56 +
  57 +.textarea {
  58 + width: 100%;
  59 + height: 200rpx;
  60 + margin-top: 70rpx;
  61 + border: 2rpx solid rgb(203, 203, 203);
  62 + border-radius: 13rpx;
  63 + padding-top: 25rpx;
  64 + padding-left: 30rpx;
  65 + margin-bottom: 30rpx;
  66 + padding-right: 15rpx;
  67 + padding-bottom: 20rpx;
  68 +}
  69 +
  70 +.labels {
  71 + display: inline-block;
  72 + max-height: 240rxp;
  73 + line-height: 50rpx;
  74 + padding-left: 15rpx;
  75 +}
  76 +
  77 +.label {
  78 + padding: 0rpx 10rpx;
  79 + height: 48rpx;
  80 + line-height: 48rpx;
  81 + border: 2rpx solid rgb(218, 218, 218);
  82 + color: rgb(152, 152, 152);
  83 + border-radius: 5rpx;
  84 + margin-right: 20rpx;
  85 + width: 165rpx;
  86 + display: inline-block;
  87 + text-align: center;
  88 + margin-bottom: 10rpx;
  89 +}
  90 +
  91 +/* 选择标签的样式 */
  92 +
  93 +.checklabel {
  94 + border: 2rpx solid rgb(214, 1, 33);
  95 + background-color: rgb(255, 231, 235);
  96 + color: rgb(214, 1, 33);
  97 +}
  98 +
  99 +.feedback {
  100 + color: rgb(152, 152, 152);
  101 + margin-bottom: 70rpx;
  102 +}
  103 +
  104 +.Subs {
  105 + background-color: rgb(255, 255, 255);
  106 + position: fixed;
  107 + width: 100%;
  108 + bottom: 40rpx;
  109 +}
  110 +
  111 +.Submission {
  112 + width: 400rpx;
  113 + height: 65rpx;
  114 + border-radius: 60rpx;
  115 + background-color: rgb(214, 1, 33);
  116 + color: rgb(255, 255, 255);
  117 +}
  118 +.Submission.yellow-b{
  119 + background-color: #ffb03f;
  120 +
  121 +}
  122 +
  123 +.clonri {
  124 + margin: 0rpx;
  125 +}
  126 +
  127 +.subSuccess {
  128 + position: fixed;
  129 + z-index: 3;
  130 + top: 435rpx;
  131 + left: 66rpx;
  132 + background-color: #a6a6a6a4;
  133 + width: 615rpx;
  134 + height: 315rpx;
  135 + border-radius: 20rpx;
  136 + color: rgb(255, 255, 255);
  137 +}
  138 +
  139 +.Success {
  140 + width: 110rpx;
  141 + height: 110rpx;
  142 + margin-top: 50rpx;
  143 + margin-bottom: 45rpx;
  144 +}
  145 +
  146 +.show_icon{
  147 + width: 50%;
  148 + margin: 0 auto;
  149 + display: flex; justify-content: space-between;
  150 +}
  151 +
  152 +.icon_item{
  153 + display: flex;align-items: center; justify-content: center; font-size: 26rpx; text-align: center;
  154 + width: 140rpx; height: 140rpx; border: 1rpx solid #eee; border-radius: 50%; line-height: 34rpx;
  155 +}
  156 +
  157 +.go_right::after{
  158 + content: '';
  159 + display: inline-block;
  160 + width: 20rpx;
  161 + height: 20rpx;
  162 + border-top:1rpx solid #999 ;
  163 + border-right: 1rpx solid #999;
  164 + transform: rotate(45deg);
  165 +}
  166 +
  167 +.show_pop_div{
  168 + position: fixed; max-height:50%; left: 0;top:50%; transform: translateY(-50%); overflow-y: auto;
  169 + background-color: #fff; text-align: center; z-index: 100000; width: 100%; min-height: 300rpx;
  170 +}
  171 +
  172 +.show_pop_div .title{
  173 + height: 100rpx; line-height: 100rpx; border-bottom: 1rpx solid #eee; font-size: 34rpx;
  174 +}
packageB/pages/evaluate_list/evaluate_list.js 0 → 100644
  1 + var e = getApp(),
  2 + os = e.globalData.setting,
  3 + t = e.request,
  4 + d = e.globalData;
  5 +Page({
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + url: os.url, //接口网址
  11 + iurl: os.imghost,
  12 + defimgurl: "/miniapp/images/no-head.jpg",
  13 + list:[],
  14 + },
  15 +
  16 + //图片失败,默认图片
  17 + bind_bnerr1: function (e) {
  18 + var th = this;
  19 + var _errImg = e.target.dataset.errorimg;
  20 + var _Img = e.target.dataset.img;
  21 + if (_Img != undefined) {
  22 + var _errObj = {};
  23 + _errObj[_errImg] = "/miniapp/images/no-head.jpg";
  24 + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  25 + }
  26 + },
  27 +
  28 + /**
  29 + * 生命周期函数--监听页面加载
  30 + */
  31 + onLoad: function(options) {
  32 + var th=this;
  33 + getApp().getConfig(function(e){
  34 + th.setData({img:e.store_logo});
  35 + })
  36 +
  37 + var IsEvaluate=options.IsEvaluate?options.IsEvaluate:0;
  38 + this.setData({IsEvaluate:parseInt(IsEvaluate) });
  39 + this.get_list();
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面显示
  44 + */
  45 + onShow: function() {
  46 +
  47 + },
  48 +
  49 + get_list:function(){
  50 + var th=this;
  51 + var req={
  52 + storeId:os.stoid,
  53 + VIPId:getApp().globalData.userInfo.erpvipid,
  54 + IsEvaluate:0
  55 + }
  56 + if(parseInt(this.data.IsEvaluate)){
  57 + req.IsEvaluate=1;
  58 + }
  59 +
  60 + var url="/api/weshop/evaluation/FormListNew/page"; //获取评价列表
  61 + getApp().request.get(url,{
  62 + data:req,
  63 + success:function(res){
  64 + console.log(res);
  65 + th.setData({is_get:1});
  66 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  67 + th.setData({list:res.data.data.pageData});
  68 + }
  69 + },
  70 + })
  71 + },
  72 +
  73 + go_evaluate(e){
  74 + var idx=e.currentTarget.dataset.index;
  75 + var item=this.data.list[idx];
  76 + var posno=item.PosNo;
  77 + getApp().goto("/packageB/pages/evaluate/evaluate?number="+posno);
  78 + },
  79 +
  80 + //弹出显示商品详情
  81 + show_pop:function(e){
  82 + var idx=e.currentTarget.dataset.index;
  83 + var item=this.data.list[idx];
  84 + var posno=item.PosNo;
  85 + var th=this;
  86 + //获取商品详情
  87 + var url="/api/weshop/evaluation/Evaluatewares/page";
  88 + getApp().request.get(url,{
  89 + isShowLoading:true,
  90 + data:{storeId:os.stoid,POSNo:posno},
  91 + success:function(res){
  92 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  93 + th.setData({show_goods_list:res.data.data.pageData,sh_pop:1});
  94 + }
  95 + }
  96 + })
  97 + },
  98 +
  99 + //关闭弹出
  100 + close_pop:function(){
  101 + this.setData({
  102 + show_goods_list:null,sh_pop:0
  103 + })
  104 + }
  105 +
  106 +
  107 +
  108 +
  109 +
  110 +})
0 \ No newline at end of file 111 \ No newline at end of file
packageB/pages/evaluate_list/evaluate_list.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "评价列表",
  3 + "usingComponents": {
  4 + "qr_code": "/components/qr_code/qr_code",
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageB/pages/evaluate_list/evaluate_list.wxml 0 → 100644
  1 +
  2 +<block wx:if="{{list.length==0 && is_get}}">
  3 + <view class="fs30" style="text-align: center;">
  4 + <image mode="widthFix" style="width: 360rpx;" src="{{iurl}}/miniapp/images/user/nodistribut.png"></image>
  5 + <view style="margin-top: 30rpx;">暂无订单或未设置评价信息</view>
  6 + </view>
  7 +</block>
  8 +<block wx:else>
  9 + <view class="item flex fs26 ai-center" style="line-height: 34rpx;" wx:for="{{list}}">
  10 + <view class="show_img" style="width: 26%; text-align: center;">
  11 + <image class="logo" mode="aspectFit" src="{{iurl+img}}"></image>
  12 + </view>
  13 + <view style="width: 74%; padding-right: 6rpx;padding-left: 18rpx;">
  14 + <view>
  15 + <view class="line_item flex ai-center fs28">
  16 + <image style="width: 60rpx;" mode="widthFix" src="{{iurl}}/miniapp/images/evaluate/idcard.png"></image>
  17 + <image style="width: 30rpx; height: 30rpx; margin-left: 20rpx; margin-right: 10rpx;" src="{{iurl}}/miniapp/images/evaluate/starlit.png"></image>4.9
  18 + </view>
  19 + <view class="line_item flex jc_sb ai-center" style="margin-top: 18rpx;">
  20 + <view class="ellipsis-1" style="max-width: 90%;">{{item.WareName}}</view>
  21 + <view bindtap="show_pop" data-index="{{index}}" class="go_right"></view>
  22 + </view>
  23 + <view class="line_item flex jc_sb ai-center" style="margin-top: 14rpx;">
  24 + <view class="fs24" style="color: #999;">消费时间:{{item.BillDate}}</view>
  25 + <view bindtap="go_evaluate" data-index="{{index}}" wx:if="{{IsEvaluate}}" class="btn">查看评价</view>
  26 + <view bindtap="go_evaluate" data-index="{{index}}" wx:else class="btn">去评价</view>
  27 + </view>
  28 +
  29 + </view>
  30 + </view>
  31 + </view>
  32 +
  33 +
  34 +</block>
  35 +
  36 +
  37 +<warn id="warn"></warn>
  38 +<!-- 显示商品列表 -->
  39 +<view hidden="{{!sh_pop}}">
  40 + <view class="cover-layer" bindtap="close_pop"></view>
  41 + <view class="show_pop_div">
  42 + <view class="title">商品详情</view>
  43 + <view style="padding: 0 20rpx;">
  44 + <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}">
  45 + <view>{{item.WareName}}</view>
  46 + <view>{{item.Qty}}</view>
  47 + </view>
  48 + </view>
  49 + </view>
  50 +</view>
  51 +
packageB/pages/evaluate_list/evaluate_list.wxss 0 → 100644
  1 +.item{ padding:10rpx 20rpx; border-bottom: 20rpx solid #ebeced}
  2 +.line_item{ height: 36rpx;}
  3 +.logo{
  4 + width: 160rpx; height: 160rpx; border-radius: 50%; border: 1rpx solid #eee;
  5 +}
  6 +.go_right{position: relative;top:-10rpx;right: 10rpx;}
  7 +.go_right::after{
  8 + content: '';
  9 + display: inline-block;
  10 + width: 20rpx;
  11 + height: 20rpx;
  12 + border-top:1rpx solid #333 ;
  13 + border-right: 1rpx solid #333;
  14 + transform: rotate(45deg);
  15 +}
  16 +.btn{
  17 + padding: 10rpx 16rpx; border: 1rpx solid #c4182e; color: #c4182e; border-radius: 8rpx;
  18 +}
  19 +
  20 +
  21 +.show_pop_div{
  22 + width: 96%; margin-left: 2%; position: fixed; max-height:50%; left: 0;top:50%; transform: translateY(-50%); overflow-y: auto;
  23 + background-color: #fff; text-align: center; z-index: 100000; min-height: 300rpx;
  24 +}
  25 +
  26 +.show_pop_div .title{
  27 + height: 100rpx; line-height: 100rpx; border-bottom: 1rpx solid #eee; font-size: 34rpx;
  28 +}