1
jyy
2021-01-11 f864fb0eee3bdde078768786f3c2dce0a41f36d4
1
1 files modified
278 files added
24199 ■■■■■ changed files
.gitignore 34 ●●●●● patch | view | raw | blame | history
.vscode/settings.json 5 ●●●●● patch | view | raw | blame | history
app.js 95 ●●●●● patch | view | raw | blame | history
app.json 104 ●●●●● patch | view | raw | blame | history
app.wxss 379 ●●●●● patch | view | raw | blame | history
common/css/common.wxss 427 ●●●●● patch | view | raw | blame | history
common/css/refund.wxss 259 ●●●●● patch | view | raw | blame | history
components/search/index.js 81 ●●●●● patch | view | raw | blame | history
components/search/index.json 7 ●●●●● patch | view | raw | blame | history
components/search/index.wxml 20 ●●●●● patch | view | raw | blame | history
components/search/index.wxss 78 ●●●●● patch | view | raw | blame | history
components/skuList/skuList.js 96 ●●●●● patch | view | raw | blame | history
components/skuList/skuList.json 4 ●●●● patch | view | raw | blame | history
components/skuList/skuList.wxml 51 ●●●●● patch | view | raw | blame | history
components/skuList/skuList.wxss 203 ●●●●● patch | view | raw | blame | history
icon/iconfont.wxss 164 ●●●●● patch | view | raw | blame | history
image/11.png patch | view | raw | blame | history
image/2.png patch | view | raw | blame | history
image/24.png patch | view | raw | blame | history
image/3.png patch | view | raw | blame | history
image/56.png patch | view | raw | blame | history
image/587.png patch | view | raw | blame | history
image/60.png patch | view | raw | blame | history
image/61.png patch | view | raw | blame | history
image/62.png patch | view | raw | blame | history
image/arrow-bottom_01.png patch | view | raw | blame | history
image/arrow-bottom_02.png patch | view | raw | blame | history
image/arrow-top_01.png patch | view | raw | blame | history
image/arrow-top_02.png patch | view | raw | blame | history
image/avatar.jpg patch | view | raw | blame | history
image/bg.png patch | view | raw | blame | history
image/card-bg.png patch | view | raw | blame | history
image/card1.png patch | view | raw | blame | history
image/card2.png patch | view | raw | blame | history
image/card3.png patch | view | raw | blame | history
image/cart.png patch | view | raw | blame | history
image/cart_grey.png patch | view | raw | blame | history
image/consult.png patch | view | raw | blame | history
image/fail.png patch | view | raw | blame | history
image/fh.png patch | view | raw | blame | history
image/goIndex.png patch | view | raw | blame | history
image/gwc.png patch | view | raw | blame | history
image/head-bg.png patch | view | raw | blame | history
image/head-bg2.png patch | view | raw | blame | history
image/head.png patch | view | raw | blame | history
image/home.png patch | view | raw | blame | history
image/home_active.png patch | view | raw | blame | history
image/icon_cj.png patch | view | raw | blame | history
image/icon_share.png patch | view | raw | blame | history
image/icon_zp.png patch | view | raw | blame | history
image/jia.png patch | view | raw | blame | history
image/jian.png patch | view | raw | blame | history
image/logo.png patch | view | raw | blame | history
image/nocoupon.png patch | view | raw | blame | history
image/pocon.png patch | view | raw | blame | history
image/qb.png patch | view | raw | blame | history
image/share.png patch | view | raw | blame | history
image/shopping.png patch | view | raw | blame | history
image/shopping_active.png patch | view | raw | blame | history
image/spa.png patch | view | raw | blame | history
image/spa_active.png patch | view | raw | blame | history
image/star1.png patch | view | raw | blame | history
image/star2.png patch | view | raw | blame | history
image/tc.png patch | view | raw | blame | history
image/time.png patch | view | raw | blame | history
image/time_active.png patch | view | raw | blame | history
image/tp.png patch | view | raw | blame | history
image/type.png patch | view | raw | blame | history
image/type_active.png patch | view | raw | blame | history
image/user.png patch | view | raw | blame | history
image/user_active.png patch | view | raw | blame | history
image/w-bg.png patch | view | raw | blame | history
image/wx.png patch | view | raw | blame | history
image/zwjl1.png patch | view | raw | blame | history
models/address.js 14 ●●●●● patch | view | raw | blame | history
models/swiper.js patch | view | raw | blame | history
pages/ads/showAdPage.js 153 ●●●●● patch | view | raw | blame | history
pages/ads/showAdPage.json 3 ●●●●● patch | view | raw | blame | history
pages/ads/showAdPage.wxml 65 ●●●●● patch | view | raw | blame | history
pages/ads/showAdPage.wxss 41 ●●●●● patch | view | raw | blame | history
pages/applyRefund/applyRefund.js 302 ●●●●● patch | view | raw | blame | history
pages/applyRefund/applyRefund.json 3 ●●●●● patch | view | raw | blame | history
pages/applyRefund/applyRefund.wxml 69 ●●●●● patch | view | raw | blame | history
pages/applyRefund/applyRefund.wxss 194 ●●●●● patch | view | raw | blame | history
pages/article/article.js 84 ●●●●● patch | view | raw | blame | history
pages/article/article.json 7 ●●●●● patch | view | raw | blame | history
pages/article/article.wxml 2 ●●●●● patch | view | raw | blame | history
pages/article/article.wxss 11 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordInfo.js 136 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordInfo.json 7 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordInfo.wxml 84 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordInfo.wxss 180 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordList.js 113 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordList.json 4 ●●●● patch | view | raw | blame | history
pages/checkRecord/recordList.wxml 7 ●●●●● patch | view | raw | blame | history
pages/checkRecord/recordList.wxss 43 ●●●●● patch | view | raw | blame | history
pages/customerCenter/customerCenter.js 117 ●●●●● patch | view | raw | blame | history
pages/customerCenter/customerCenter.json 6 ●●●●● patch | view | raw | blame | history
pages/customerCenter/customerCenter.wxml 106 ●●●●● patch | view | raw | blame | history
pages/customerCenter/customerCenter.wxss 302 ●●●●● patch | view | raw | blame | history
pages/customerCoupons/customerCoupons.js 165 ●●●●● patch | view | raw | blame | history
pages/customerCoupons/customerCoupons.json 3 ●●●●● patch | view | raw | blame | history
pages/customerCoupons/customerCoupons.wxml 118 ●●●●● patch | view | raw | blame | history
pages/customerCoupons/customerCoupons.wxss 115 ●●●●● patch | view | raw | blame | history
pages/editAddress/editAddress.js 143 ●●●●● patch | view | raw | blame | history
pages/editAddress/editAddress.json 3 ●●●●● patch | view | raw | blame | history
pages/editAddress/editAddress.wxml 33 ●●●●● patch | view | raw | blame | history
pages/editAddress/editAddress.wxss 110 ●●●●● patch | view | raw | blame | history
pages/enterShopcoupon/enterShopcoupon.js 80 ●●●●● patch | view | raw | blame | history
pages/enterShopcoupon/enterShopcoupon.json 6 ●●●●● patch | view | raw | blame | history
pages/enterShopcoupon/enterShopcoupon.wxml 30 ●●●●● patch | view | raw | blame | history
pages/enterShopcoupon/enterShopcoupon.wxss 119 ●●●●● patch | view | raw | blame | history
pages/groupbuy/allPt.js 102 ●●●●● patch | view | raw | blame | history
pages/groupbuy/allPt.json 7 ●●●●● patch | view | raw | blame | history
pages/groupbuy/allPt.wxml 19 ●●●●● patch | view | raw | blame | history
pages/groupbuy/allPt.wxss 34 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupDetails.js 878 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupDetails.json 3 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupDetails.wxml 352 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupDetails.wxss 730 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupList.js 226 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupList.json 3 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupList.wxml 32 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupList.wxss 92 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupOrder.js 448 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupOrder.json 3 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupOrder.wxml 92 ●●●●● patch | view | raw | blame | history
pages/groupbuy/groupOrder.wxss 396 ●●●●● patch | view | raw | blame | history
pages/groupbuy/invited.js 67 ●●●●● patch | view | raw | blame | history
pages/groupbuy/invited.json 3 ●●●●● patch | view | raw | blame | history
pages/groupbuy/invited.wxml 41 ●●●●● patch | view | raw | blame | history
pages/groupbuy/invited.wxss 36 ●●●●● patch | view | raw | blame | history
pages/index-back/index.js 105 ●●●●● patch | view | raw | blame | history
pages/index-back/index.json 3 ●●●●● patch | view | raw | blame | history
pages/index-back/index.wxml 34 ●●●●● patch | view | raw | blame | history
pages/index-back/index.wxss 69 ●●●●● patch | view | raw | blame | history
pages/index/index.js 191 ●●●●● patch | view | raw | blame | history
pages/index/index.json 3 ●●●●● patch | view | raw | blame | history
pages/index/index.wxml 70 ●●●●● patch | view | raw | blame | history
pages/index/index.wxss 60 ●●●●● patch | view | raw | blame | history
pages/logistics/logistics.js 125 ●●●●● patch | view | raw | blame | history
pages/logistics/logistics.json 3 ●●●●● patch | view | raw | blame | history
pages/logistics/logistics.wxml 91 ●●●●● patch | view | raw | blame | history
pages/logistics/logistics.wxss 89 ●●●●● patch | view | raw | blame | history
pages/miaosha/msDetails.js 508 ●●●●● patch | view | raw | blame | history
pages/miaosha/msDetails.json 3 ●●●●● patch | view | raw | blame | history
pages/miaosha/msDetails.wxml 279 ●●●●● patch | view | raw | blame | history
pages/miaosha/msDetails.wxss 730 ●●●●● patch | view | raw | blame | history
pages/miaosha/msList.js 248 ●●●●● patch | view | raw | blame | history
pages/miaosha/msList.json 3 ●●●●● patch | view | raw | blame | history
pages/miaosha/msList.wxml 64 ●●●●● patch | view | raw | blame | history
pages/miaosha/msList.wxss 125 ●●●●● patch | view | raw | blame | history
pages/miaosha/msOrder.js 380 ●●●●● patch | view | raw | blame | history
pages/miaosha/msOrder.json 3 ●●●●● patch | view | raw | blame | history
pages/miaosha/msOrder.wxml 90 ●●●●● patch | view | raw | blame | history
pages/miaosha/msOrder.wxss 396 ●●●●● patch | view | raw | blame | history
pages/order/order.js 312 ●●●●● patch | view | raw | blame | history
pages/order/order.json 4 ●●●● patch | view | raw | blame | history
pages/order/order.wxml 78 ●●●●● patch | view | raw | blame | history
pages/order/order.wxss 131 ●●●●● patch | view | raw | blame | history
pages/orderDetails/orderDetails.js 258 ●●●●● patch | view | raw | blame | history
pages/orderDetails/orderDetails.json 3 ●●●●● patch | view | raw | blame | history
pages/orderDetails/orderDetails.wxml 154 ●●●●● patch | view | raw | blame | history
pages/orderDetails/orderDetails.wxss 44 ●●●●● patch | view | raw | blame | history
pages/payOrder/payError.js 3 ●●●●● patch | view | raw | blame | history
pages/payOrder/payError.json 1 ●●●● patch | view | raw | blame | history
pages/payOrder/payError.wxml 9 ●●●●● patch | view | raw | blame | history
pages/payOrder/payError.wxss 31 ●●●●● patch | view | raw | blame | history
pages/payOrder/payOrder.js 17 ●●●●● patch | view | raw | blame | history
pages/payOrder/payOrder.json 3 ●●●●● patch | view | raw | blame | history
pages/payOrder/payOrder.wxml 19 ●●●●● patch | view | raw | blame | history
pages/payOrder/payOrder.wxss 85 ●●●●● patch | view | raw | blame | history
pages/payOrder/paySuccess.js 142 ●●●●● patch | view | raw | blame | history
pages/payOrder/paySuccess.json 1 ●●●● patch | view | raw | blame | history
pages/payOrder/paySuccess.wxml 15 ●●●●● patch | view | raw | blame | history
pages/payOrder/paySuccess.wxss 28 ●●●●● patch | view | raw | blame | history
pages/phone/phone.js 81 ●●●●● patch | view | raw | blame | history
pages/phone/phone.json 3 ●●●●● patch | view | raw | blame | history
pages/phone/phone.wxml 17 ●●●●● patch | view | raw | blame | history
pages/phone/phone.wxss 54 ●●●●● patch | view | raw | blame | history
pages/productEvaluate/productEvaluate.js 135 ●●●●● patch | view | raw | blame | history
pages/productEvaluate/productEvaluate.json 4 ●●●● patch | view | raw | blame | history
pages/productEvaluate/productEvaluate.wxml 29 ●●●●● patch | view | raw | blame | history
pages/productEvaluate/productEvaluate.wxss 23 ●●●●● patch | view | raw | blame | history
pages/refund/refund.js 148 ●●●●● patch | view | raw | blame | history
pages/refund/refund.json 4 ●●●● patch | view | raw | blame | history
pages/refund/refund.wxml 23 ●●●●● patch | view | raw | blame | history
pages/refund/refund.wxss 42 ●●●●● patch | view | raw | blame | history
pages/refundOrder/refundOrder.js 184 ●●●●● patch | view | raw | blame | history
pages/refundOrder/refundOrder.json 4 ●●●● patch | view | raw | blame | history
pages/refundOrder/refundOrder.wxml 40 ●●●●● patch | view | raw | blame | history
pages/refundOrder/refundOrder.wxss 116 ●●●●● patch | view | raw | blame | history
pages/service/details.js 590 ●●●●● patch | view | raw | blame | history
pages/service/details.json 3 ●●●●● patch | view | raw | blame | history
pages/service/details.wxml 325 ●●●●● patch | view | raw | blame | history
pages/service/details.wxss 582 ●●●●● patch | view | raw | blame | history
pages/service/service.js 204 ●●●●● patch | view | raw | blame | history
pages/service/service.json 3 ●●●●● patch | view | raw | blame | history
pages/service/service.wxml 38 ●●●●● patch | view | raw | blame | history
pages/service/service.wxss 137 ●●●●● patch | view | raw | blame | history
pages/service/service2.js 319 ●●●●● patch | view | raw | blame | history
pages/service/service2.json 5 ●●●●● patch | view | raw | blame | history
pages/service/service2.wxml 83 ●●●●● patch | view | raw | blame | history
pages/service/service2.wxss 243 ●●●●● patch | view | raw | blame | history
pages/service/shopOrder.js 404 ●●●●● patch | view | raw | blame | history
pages/service/shopOrder.json 3 ●●●●● patch | view | raw | blame | history
pages/service/shopOrder.wxml 154 ●●●●● patch | view | raw | blame | history
pages/service/shopOrder.wxss 396 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongDetail.js 160 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongDetail.json 5 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongDetail.wxml 76 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongDetail.wxss 922 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongList.js 156 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongList.json 5 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongList.wxml 18 ●●●●● patch | view | raw | blame | history
pages/shalong/shalongList.wxss 45 ●●●●● patch | view | raw | blame | history
pages/shopCar/shopCar.js 230 ●●●●● patch | view | raw | blame | history
pages/shopCar/shopCar.json 3 ●●●●● patch | view | raw | blame | history
pages/shopCar/shopCar.wxml 83 ●●●●● patch | view | raw | blame | history
pages/shopCar/shopCar.wxss 226 ●●●●● patch | view | raw | blame | history
pages/showAddress/showAddress.js 188 ●●●●● patch | view | raw | blame | history
pages/showAddress/showAddress.json 3 ●●●●● patch | view | raw | blame | history
pages/showAddress/showAddress.wxml 90 ●●●●● patch | view | raw | blame | history
pages/showAddress/showAddress.wxss 119 ●●●●● patch | view | raw | blame | history
pages/webView/webView.js 68 ●●●●● patch | view | raw | blame | history
pages/webView/webView.json 3 ●●●●● patch | view | raw | blame | history
pages/webView/webView.wxml 5 ●●●●● patch | view | raw | blame | history
pages/webView/webView.wxss 4 ●●●● patch | view | raw | blame | history
pages/welcome/welcome.js 99 ●●●●● patch | view | raw | blame | history
pages/welcome/welcome.json 3 ●●●●● patch | view | raw | blame | history
pages/welcome/welcome.wxml 9 ●●●●● patch | view | raw | blame | history
pages/welcome/welcome.wxss 36 ●●●●● patch | view | raw | blame | history
pages/yuyue/chose.js 66 ●●●●● patch | view | raw | blame | history
pages/yuyue/chose.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/chose.wxml 2 ●●●●● patch | view | raw | blame | history
pages/yuyue/chose.wxss 1 ●●●● patch | view | raw | blame | history
pages/yuyue/choseMasseuse.js 100 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseMasseuse.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseMasseuse.wxml 32 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseMasseuse.wxss 74 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseService.js 137 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseService.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseService.wxml 34 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseService.wxss 76 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseShop.js 116 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseShop.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseShop.wxml 23 ●●●●● patch | view | raw | blame | history
pages/yuyue/choseShop.wxss 62 ●●●●● patch | view | raw | blame | history
pages/yuyue/khyuyue.js 401 ●●●●● patch | view | raw | blame | history
pages/yuyue/khyuyue.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/khyuyue.wxml 105 ●●●●● patch | view | raw | blame | history
pages/yuyue/khyuyue.wxss 222 ●●●●● patch | view | raw | blame | history
pages/yuyue/order.js 201 ●●●●● patch | view | raw | blame | history
pages/yuyue/order.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/order.wxml 61 ●●●●● patch | view | raw | blame | history
pages/yuyue/order.wxss 131 ●●●●● patch | view | raw | blame | history
pages/yuyue/shopOrder.js 66 ●●●●● patch | view | raw | blame | history
pages/yuyue/shopOrder.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/shopOrder.wxml 2 ●●●●● patch | view | raw | blame | history
pages/yuyue/shopOrder.wxss 1 ●●●● patch | view | raw | blame | history
pages/yuyue/yuyue.wxml patch | view | raw | blame | history
pages/yuyue/yyInfo.js 208 ●●●●● patch | view | raw | blame | history
pages/yuyue/yyInfo.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/yyInfo.wxml 74 ●●●●● patch | view | raw | blame | history
pages/yuyue/yyInfo.wxss 46 ●●●●● patch | view | raw | blame | history
pages/yuyue/yySuccess.js 74 ●●●●● patch | view | raw | blame | history
pages/yuyue/yySuccess.json 3 ●●●●● patch | view | raw | blame | history
pages/yuyue/yySuccess.wxml 9 ●●●●● patch | view | raw | blame | history
pages/yuyue/yySuccess.wxss 28 ●●●●● patch | view | raw | blame | history
project.config.json 224 ●●●●● patch | view | raw | blame | history
sitemap.json 9 ●●●●● patch | view | raw | blame | history
utils/Enum.js patch | view | raw | blame | history
utils/bmap-wx.min.js 1 ●●●● patch | view | raw | blame | history
utils/common-request.js 87 ●●●●● patch | view | raw | blame | history
utils/constance.js 15 ●●●●● patch | view | raw | blame | history
utils/dataFilter.wxs 21 ●●●●● patch | view | raw | blame | history
utils/service-api.js 189 ●●●●● patch | view | raw | blame | history
utils/shopcart.js 181 ●●●●● patch | view | raw | blame | history
utils/util.js 582 ●●●●● patch | view | raw | blame | history
.gitignore
@@ -1,23 +1,15 @@
# Compiled class file
*.class
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
.idea/
# Log file
*.log
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Node.js
node_modules/
.vscode/settings.json
New file
@@ -0,0 +1,5 @@
{
    "editor.fontSize": 14,
    "files.autoSave": "afterDelay",
    "editor.cursorStyle": "line-thin"
}
app.js
New file
@@ -0,0 +1,95 @@
//app.js
var util = require('utils/util.js')
var api = require('utils/service-api.js');
App({
      baseUrl: "https://xcxhive2.jyymatrix.cc",
  //  baseUrl : "http://localhost:8080",
  //登录后获得的token
  loginToken: "",
  //判断用户是否登录
  isLogin: false,
  //最近门店
  shopInfo: {},
  //所有门店
  shopList: [],
  onLaunch: function(options) {
    this.getShop();
    if (options.scene == 1044) {
      wx.getShareInfo({
        shareTickets: options.shareTickets,
        success: function(res) {
          console.log("onLaunchoptions转发成功")
          console.log(res)
          var encryptedData = res.encryptedData;
          var iv = res.iv
        }
      })
    }
  },
  /**
   * 获取门店
   */
  getShop: function() {
    const app = this;
    wx.getLocation({
      type: 'wgs84',
      success(res) {
        const latitude = res.latitude;
        const longitude = res.longitude;
        app.doGgetShopList(longitude, latitude);
      },
      fail(res) {
        console.log("用户拒绝授权");
        app.doGgetShopList(0, 0);
      }
    })
  },
  doGgetShopList: function(longitude, latitude) {
    util.request({
      api: api.yuyue.getShopList + "/" + longitude + "/" + latitude,
      callback: function(data) {
        let shopInfo = data.mapInfo.shopInfo;
        if (getApp().shopInfo.id == null) {
          getApp().shopInfo = shopInfo;
          wx.setNavigationBarTitle({
            title: shopInfo.shopShortName
          });
        }
        getApp().shopList = data.rows;
      },
    });
  },
  checkAuthorize(scope) {
    wx.getSetting({
      success: (res) => {
        console.log(res.authSetting[scope])
        if (!res.authSetting[scope]) {
          wx.showModal({
            title: '用户未授权',
            content: '拒绝授权将不能体验小程序完整功能,点击确定开启授权',
            success: (res) => {
              console.log(res)
              if (res.confirm) {
                wx.openSetting({})
              }
            }
          })
        }
      }
    })
  }
})
app.json
New file
@@ -0,0 +1,104 @@
{
  "pages": [
    "pages/index/index",
    "pages/service/service",
    "pages/groupbuy/groupDetails",
    "pages/customerCenter/customerCenter",
    "pages/yuyue/khyuyue",
    "pages/yuyue/choseShop",
    "pages/yuyue/choseService",
    "pages/yuyue/chose",
    "pages/yuyue/choseMasseuse",
    "pages/yuyue/yyInfo",
    "pages/yuyue/yySuccess",
    "pages/service/details",
    "pages/article/article",
    "pages/welcome/welcome",
    "pages/phone/phone",
    "pages/yuyue/order",
    "pages/service/shopOrder",
    "pages/editAddress/editAddress",
    "pages/showAddress/showAddress",
    "pages/order/order",
    "pages/orderDetails/orderDetails",
    "pages/payOrder/paySuccess",
    "pages/payOrder/payError",
    "pages/payOrder/payOrder",
    "pages/logistics/logistics",
    "pages/refundOrder/refundOrder",
    "pages/refund/refund",
    "pages/applyRefund/applyRefund",
    "pages/productEvaluate/productEvaluate",
    "pages/webView/webView",
    "pages/service/service2",
    "pages/shopCar/shopCar",
    "pages/enterShopcoupon/enterShopcoupon",
    "pages/customerCoupons/customerCoupons",
    "pages/groupbuy/groupList",
    "pages/groupbuy/allPt",
    "pages/groupbuy/invited",
    "pages/miaosha/msList",
    "pages/groupbuy/groupOrder",
    "pages/checkRecord/recordList",
    "pages/checkRecord/recordInfo",
    "pages/shalong/shalongList",
    "pages/shalong/shalongDetail",
    "pages/ads/showAdPage",
    "pages/miaosha/msDetails",
    "pages/index-back/index",
    "pages/miaosha/msOrder",
    "pages/yuyue/shopOrder"
  ],
  "window": {
    "backgroundTextStyle": "light",
    "navigationBarTitleText": "肽妍",
    "navigationBarTextStyle": "black",
    "navigationBarBackgroundColor": "#fff"
  },
  "tabBar": {
    "color": "#999999",
    "selectedColor": "#0CBF86",
    "borderStyle": "white",
    "backgroundColor": "#ffffff",
    "list": [
      {
        "pagePath": "pages/index/index",
        "iconPath": "image/home.png",
        "selectedIconPath": "image/home_active.png",
        "text": "首页"
      },
      {
        "pagePath": "pages/yuyue/khyuyue",
        "iconPath": "image/time.png",
        "selectedIconPath": "image/time_active.png",
        "text": "预约"
      },
      {
        "pagePath": "pages/service/service2",
        "iconPath": "image/spa.png",
        "selectedIconPath": "image/spa_active.png",
        "text": "商城"
      },
      {
        "pagePath": "pages/shopCar/shopCar",
        "iconPath": "image/shopping.png",
        "selectedIconPath": "image/shopping_active.png",
        "text": "购物车"
      },
      {
        "pagePath": "pages/customerCenter/customerCenter",
        "iconPath": "image/user.png",
        "selectedIconPath": "image/user_active.png",
        "text": "我的"
      }
    ]
  },
  "sitemapLocation": "sitemap.json",
  "permission": {
    "scope.userLocation": {
      "desc": "您的位置信息将用于收货地址"
    }
  }
}
app.wxss
New file
@@ -0,0 +1,379 @@
/**app.wxss**/
@import "./icon/iconfont.wxss";
@import "./common/css/common.wxss";
page{background: #f7f7f7}
.container {
  /* height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 200rpx 0;
  box-sizing: border-box; */
}
.price{color: #e74b74}.threeblack{color: #333333}.iprice{color: #FE2448}
.price-f{color: #e74b74;font-size: 34rpx;font-weight:bold;}
.grey{font-size: 26rpx;color: #999}
.name{font-size: 30rpx;color: #333;}
.section{padding-bottom: 50rpx}
.radius{border-radius: 10rpx}
.goods-container {
   display: flex;
   flex-wrap: wrap;
   width: 97%;
   padding-left: 19rpx;
   margin: 30rpx 0;
}
.goods-item {
    width: 45%;
    background: #fff;
    border-radius: 20rpx;
    margin: 0 5rpx 10rpx 5rpx;
    text-align: center;
    padding: 20rpx 10rpx;
}
.goods-item image {
  height: 221rpx;
}
.goods-title {
  font-size: 28rpx;
  text-align: left;
  padding: 2rpx 0;
  margin-right: 24rpx;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goods-container .volume{
  text-align: left;
  margin-left: 39rpx
}
.goods-container .price {
  color: #fe0b0b;
  text-align: left;
  font-size: 34rpx;
  margin-top: 16rpx;
  font-weight: bold;
}
.coupons-container{
  margin-left: 32rpx;
  margin-top: 25rpx;
}
.coupons{
  background-image: url("http://file.micromall.xczhyf.cn/wxxcx/image/17.png");
  background-size:100% 100%;
  width: 676rpx;
  height:190rpx;
  margin-top: 10rpx;
  display: flex;
}
.coupons .coupons-explain{
  font-size: 24rpx;
  color: #fff;
  width: 24rpx;
  padding-top: 52rpx;
  padding-left:20rpx;
  float:left;
}
.clr{clear: both}
.counpons-list .money{
  width:20%;
  float:left;
  margin-left: 40rpx;
  margin-right: 40rpx;
  margin-top: 36rpx;
}
.counpons-list .money::after{
  content: "";
  width:1rpx;
  height:160rpx;
  background: #eee;
  display: block;position: absolute;left: 243rpx;top: 9%
}
.counpons-list .money-num{
  color: #e74b74;
  padding-left: 10rpx;
}
.counpons-list .money-info{
  color: #898A8D;
  font-size: 24rpx;
  white-space: nowrap
}
.counpons-list .content{
  padding-top: 32rpx;
  width: 41%;
}
.counpons-list .content-title{
  font-size: 34rpx;
  color: #333;overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;width: 79%;
}
.counpons-list .content-info{
  color: #949494;
  font-size: 26rpx;
  margin-top: 14rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;width: 79%;
}
.counpons-list .content-time{
  color: #BDBDBD;
  font-size: 22rpx;
  margin-top: 24rpx;
  width: 79%;
  white-space: nowrap;
}
.draw{
  font-size: 22rpx;
  background-color: #FF5806;
  color: #fff;
  text-align: center;
  margin-top: 72rpx;
  margin-right: 30rpx;
  width:110rpx;
  height:38rpx;
  line-height: 38rpx
}
.right{
  float:right;
}
/*选择 */
.choice {
  width: 686rpx;
  margin: auto;
  color: #999;
  display: flex;
  align-items: center;
  padding-top: 28rpx;
}
.choice .title {
  width: 96%;
  font-size: 26rpx;
  display: block;
}
/* 弹窗 */
.popup-container{width: 100%;height: 100%;position: fixed;bottom: 0;z-index: 99}
/* 收货人 */
.orders-address-name{font-size: 30rpx}
/* 置顶 */
.toTap{
  width: 59rpx;
  height: 59rpx;
  line-height: 59rpx;
  text-align: center;
  background: #00C085;
  border-radius: 50%;
  position: fixed;
  z-index: 999;
  right: 26rpx;
  bottom: 90rpx;
}
.toTap .iconfont{
  color: #fff
}
/* 搜索框 */
.header {
  width: 100%;
  margin: auto;
  top: 0;
  left: 0;
  height: 70rpx;
  background: #f7f7f7;
}
.header-box {
  width: 100%;
  top: 0;
  z-index: 99;
  height: 70rpx;
  background: #f7f7f7;
  padding-bottom: 10rpx;
}
.box {
  width: 95%;
  display: flex;
  align-items: center;
  font-size: 26rpx;
  color: #b2b2b2;
  height: 70rpx;
  background: #fff;
  /* border: 1px solid #e6e6ea; */
  border-radius: 10rpx;
  margin: 10rpx auto;
}
.marked {
  padding-left: 10rpx;
}
/* 划线价 */
.goods-group{
  display: flex;
  align-items: center;
}
.original_iprice{
  text-decoration:line-through;
  margin-left: 10rpx
}
/*小购物车*/
.litel_car{
  color: #00C085;
  margin-left:10px;
}
.scale {
  transform: scale(1.5);
}
.dot{
  width: 20rpx;
  height: 20rpx;
  border-radius: 10rpx;
  background: red;
  position: fixed;
top: 530px;
left: 210px;
z-index: 1000000000000000;
}
.coupon-lable{
  background: #fff0e1;
border: 1px solid #d9b289;
border-radius: 3px;
line-height: 25rpx;
padding: 0rpx 10rpx;
font-size: 20rpx;
text-align: center;
color:#d9b289;
}
.hidden{
  visibility: hidden;
}
/*==========弹出购物车================*/
.norms-box {
  display: flex;
  flex-wrap: wrap;
}
.norms-content .title {
  white-space: nowrap;
}
.norms-content  .title {
  font-size: 30rpx;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.norms-content .price {
  font-size: 32rpx;
  font-weight: bold;
  margin-top: 20rpx;
}
.norms-content {
  margin-top: 30rpx;
  width: 60%;
}
.norms-detail {
  padding: 40rpx 0 60rpx 0;
}
.norms-box {
  padding: 10rpx 0;
}
.norms-item-list {
  display: flex;
  flex-wrap: wrap;
}
.norms-select {
  margin-bottom: 20rpx;
}
.norms-number {
  display: flex;
  padding: 20rpx 0 50rpx 0;
}
.cart-count-box {
  width: 92%;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  /* align-items: flex-end */
}
.icon-jia {
  color: #666;
}
.cart-count-down {
  color: #b3b3b3;
}
.cart-count-box text {
  display: inline-block;
  text-align: center;
  width: 46rpx;
  height: 45rpx;
  line-height: 45rpx;
}
.cart-count-down {
  margin-right: 12rpx;
}
.cart-count-add {
  margin-left: 12rpx;
}
.close {
  font-size: 40rpx;
  color: #9b9b9b;
}
.norms-footer {
  width: 100%;
  height: 106rpx;
  font-size: 30rpx;
  display: flex;
  line-height: 106rpx;
  color: #fff;
}
.norms-footer>view {
  flex: 1;
  text-align: center;
}
.norms-join {
  background: #00C085;
}
.norms-pay {
  background: #ff5806;
}
.nodata{
  color: #999;
  font-size: 30rpx;
  text-align: center;
}
common/css/common.wxss
New file
@@ -0,0 +1,427 @@
view,text,navigator{
  font-size: 14px;
}
/*浮动布局*/
.fl{
  float: left;
}
.fr{
  float: right;
}
.clr{
  clear: both;
}
/*浮动布局END*/
/*字体*/
/*超大*/
.font-20{
  font-size: 20pt;
}
/*大*/
.font-18{
  font-size: 18pt;
}
/*较大*/
.font-13{
  font-size: 13pt;
}
/*常规*/
.font-12{
  font-size: 12pt;
}
/*小字*/
.font-10{
  font-size: 10pt;
}
.font-9{
  font-size: 9pt;
}
.text-center{
  text-align: center;
}
.icon-size-1{
  font-size: 45rpx;
}
/*字体END*/
/*边框与边距*/
.mt-5{
  margin-top: 5rpx;
}
.mb-5{
  margin-top: 5rpx;
}
.ml-5{
  margin-left: 5rpx;
}
.ml-15{
  margin-left: 15rpx;
}
.mr-5{
  margin-right: 5rpx;
}
.mt-10{
  margin-top: 10rpx;
}
.mb-10{
  margin-bottom: 10rpx;
}
.ml-10{
  margin-left: 10rpx;
}
.ml-20{
  margin-left: 20rpx;
}
.mr-10{
  margin-right: 10rpx;
}
.pd-5{
  padding: 5rpx;
}
.pd-10{
  padding: 10rpx;
}
.pd-20{
  padding: 20rpx;
}
.pdrl-10{
  padding: 0 10rpx;
}
/*边框与边距END*/
/*颜色*/
.color_red {
    color: #e02e24;
}
.color_gray{
   color: #aeaeae;
}
.color_vip{
  color:#f2bf00;
}
.bg-gray{
  background:  #bababa;
}
.color-white{
  color: white;
}
/*颜色END*/
/*自定义布局元素*/
/**列表基础样式*/
.item-line{
  height: 100rpx;
  clear: both;
  line-height: 98rpx;
  padding: 5rpx 20rpx;
  background: #ffffff;
  border-bottom: 1px solid #efefef;
}
/*列表样式组合*/
.item-box{
  clear: both;
}
/*列表不限高度*/
.item-warp{
  clear: both;
  padding: 5rpx 20rpx;
  overflow: hidden;
}
/**分割线*/
.line{
   width: 100%;
   height: 2rpx;
   background: #f4f4f4;
   clear: both;
   overflow: hidden;
 }
.line-weight{
  width: 100%;
  height: 8rpx;
  background: #f4f4f4;
  clear: both;
  overflow: hidden;
}
/*自定义布局元素END*/
image{
    width:100%;
  vertical-align: middle;
}
.cl-btn{
  background: white;
  border: 0px ;
}
/*小的商品展示图*/
.min-active-img{
  float: left;
  width: 200rpx;
  height: 180rpx;
}
.del_line{
    text-decoration:line-through;
}
/*头像*/
.slide-image-head{
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  vertical-align: middle
}
/* 底部按钮 */
.option-buttom{
    height: 100rpx;
    width: 100%;
    position: fixed;
    bottom: 0;
    border-top:1rpx solid #efefef;
    background: #ffffff;
}
.option-icon-box{
  width: 120rpx;
}
.option-icon-box text{
  display: block;
  margin: 0 auto;
  width: 50rpx;
}
.option-btn{
   background-color: #1AAD19;
   color: #fff;
   text-align: center;
   width: 390rpx;
  height: 100rpx;
  line-height: 100rpx;
}
/* 底部按钮介绍 */
/*测试用边框*/
.bd{
  border: 1px springgreen solid;
}
.spitem{
  padding: 20rpx 10rpx;
  overflow: hidden;
}
/* 标签*/
.main-item-lable{
  font-size: 25rpx;
  color: #629e64;
  width: 40px;
  height: 30px;
  background: #edfbec;
  padding: 3rpx 8rpx;
  margin-left: 10rpx;
  font-weight:lighter;
  border-radius: 3rpx;
}
.flex-box{
  display:-webkit-box;
  display:-webkit-flex;
  display:-ms-flexbox;
  display:flex;
}
.flex-item{
  -webkit-box-flex:1;
  -webkit-flex:1;
  -ms-flex:1;
  flex:1;
}
.flex-align-center {
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.flex-pack-center {
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}
.flex-pack-justify {
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
}
.flex-v{
    -webkit-box-orient:vertical;
    -webkit-flex-direction:column;
    -ms-flex-direction:column;
    flex-direction:column;
}
.input-group{
  margin-top: 15px;
  font-size: 12pt;
  padding: 0 40rpx;
  position: relative;
}
.input-group input{
  border: 1px solid #ddd;
  margin-top: 10px;
  padding: 10px 10px;
  font-size: 12pt;
  border-radius: 4px;
}
.input-group picker{
  border: 1px solid #ddd;
  margin-top: 10px;
  padding: 10px 10px;
  font-size: 12pt;
  border-radius: 4px;
}
button.border-red{
  border: 1px solid #e02e24!important;
  color: #e02e24!important;
}
.btn-red{
  background: #e02e24;
  color: #fff;
  line-height: 46px;
  font-size: 12pt;
}
/* 空图标 */
.empty{
  margin-top: 200rpx;
}
.empty-font{
   font-size: 200rpx;
}
.footer{
  margin-top: 25px;
  width: 100%;
  text-align: center;
  padding:20rpx 40rpx;
  box-sizing: border-box
}
.footer button{
  height: 42px;
  line-height: 42px;
  font-size: 11pt;
}
.footer .btn{
  height: 42px;
  line-height: 42px;
  font-size: 11pt;
}
page{
    font-family: "Helvetica Neue","Hiragino Sans GB","Microsoft YaHei","\9ED1\4F53",Arial,sans-serif;
}
.navigator-hover{
    background: none;
}
.popup{position: fixed;top: 0;bottom: 0;width: 100%;height: 100%;background: rgba(0,0,0,.7)}
/*按钮*/
.bgbtn{
   width: 90%;
    background-color: #00c085;
    border-radius: 10px;
    height: 40px;
    margin: 10px auto;
    border: 1px solid #00c085;
    color: #fff;
    text-align: center;
    line-height: 40px;
}
navigator{
  overflow: hidden;
}
/**分割线*/
.line{
   width: 100%;
   height: 2rpx;
   background: #f4f4f4;
   clear: both;
   overflow: hidden;
 }
.line-weight{
  width: 100%;
  height: 8rpx;
  background: #f4f4f4;
  clear: both;
  overflow: hidden;
}
.item-line{
  height: 100rpx;
  clear: both;
  line-height: 98rpx;
  padding: 5rpx 20rpx;
}
.item-box{
  background: #ffffff;
}
.lables{
  padding: 5rpx 10rpx;
  background: #e02e24;
  color: white;
  font-size: 20rpx;
  border-radius: 5rpx;
  margin-right: 5rpx;
}
common/css/refund.wxss
New file
@@ -0,0 +1,259 @@
.button-hover {
  background-color: #fff;
  color: #00c085;
}
button {
  line-height: auto;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  font-size: 26rpx;
  padding-left: 0;
  padding-right: 0;
  color: #00c085;
  justify-content: center;
}
button:after {
  border: 0px;
  color: #00c085;
}
.order-footer .footer-text {
  border: 1rpx solid #b3b3b3;
  color: #999;
  margin-left: 18rpx;
}
.goods {
  border: 1rpx solid #ff4606;
  color: #ff4606;
  margin-right: 50rpx;
  margin-left: 15rpx;
}
.order-list {
  margin: 20rpx;
}
.order-text {
  background: #fff;
  margin-bottom: 10rpx;
  padding: 26rpx 30rpx;
}
.order-list-info, .order-detail {
  background: #fff;
  margin-bottom: 10rpx;
  padding: 26rpx 14rpx;
}
.order-info {
  background: #fff;
  padding: 26rpx 14rpx 0 14rpx;
  margin-bottom: 130rpx;
}
.order-text>text {
  display: block;
}
.order-text .order-explain {
  font-size: 34rpx;
  color: #ff3f3a;
}
.order-text .grey {
  margin-top: 10rpx;
  color: #666;
}
.order-logistics {
  display: flex;
  padding-bottom: 20rpx;
  border-bottom: 1rpx solid #f3f3f3;
  margin-bottom: 20rpx
}
.order-logistics text {
  color: #ff4606;
  display: block;
  white-space: nowrap;
}
.order-logist-top {
  padding: 0 16rpx;
  width: 90%;
}
.order-logistics .order-logist-text {
  font-size: 26rpx;
}
.order-logistics .order-logist-add {
  font-size: 22rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: -8rpx;
}
.icon-youbian {
  width: 5%;
  text-align: right;
  margin-top: 11rpx;
  font-size: 56rpx;
  color: #999;
}
.orders-address {
  position: relative;
  display: flex;
  font-size: 14px;
  line-height: 25px;
  color: #adadad;
}
.orders-address-detail {
  font-size: 22rpx;
  color: #666;
  line-height: 30rpx;
  width: 459rpx;
}
.default {
  width: 44rpx;
  height: 23rpx;
  font-size: 14rpx;
  border-radius: 9rpx;
  color: #fff;
  display: block;
  text-align: center;
  line-height: 23rpx;
  background-color: #ff4606;
  margin-right: 5rpx;
}
.orders-no-address {
  font-size: 26rpx;
  position: relative;
  color: #666;
  text-align: center;
}
.orders-address-item {
  display: flex;
  align-items: center;
}
.icon-address {
  color: #00c085;
  font-size: 40rpx;
  margin: 25rpx 22rpx 0 0;
}
.order-address {
  margin-top: 20rpx;
}
.order-image {
  width: 167rpx;
  height: 159rpx;
  margin-right: 30rpx;
}
.order-detail-top {
  display: flex;
  padding: 0 16rpx;
}
.order-detail-top>view {
  display: flex;
  flex-direction: column;
}
.order-detail-info {
  width: 50%;
}
.order-detail-info text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-detail .order-detail-top .price {
  width: 20%;
  text-align: right;
  margin-top: 10rpx;
  color: #333;
  font-size: 28rpx;
}
.order-detail-info .name {
  margin: 10rpx 0 16rpx 0;
}
.order-detail-info .norms {
  margin-bottom: 15rpx;
}
.order-detail-middle>view {
  display: flex;
  line-height: 80rpx;
}
.goods-total {
  line-height: 20rpx;
}
.goods-total {
  margin-top: 40rpx;
}
.order-left {
  width: 30%;
}
.order-right {
  width: 70%;
  text-align: right;
}
.order-total {
  border-bottom: 1rpx solid #f3f3f3;
}
.real-totala {
  margin-bottom: -20rpx;
}
.order-info>view {
  display: flex;
}
.icon-kefu1 {
  margin-right: 17rpx;
}
.goods-total, .freight, .order-total, .real-total, .deliver-time, .order-number,
.create-time, .pay-time, .deliver-time {
  padding: 0 16rpx;
}
.order-number, .create-time, .pay-time, .deliver-time {
  margin-bottom: 30rpx;
}
.service {
  border-top: 1rpx solid #f3f3f3;
  color: #00c085;
  padding: 10rpx 0
}
.goIndex{width: 100%;height: 106rpx;line-height: 106rpx;position: fixed;background:#FF5806;color: #fff;font-size: 26rpx;text-align: center;bottom: 0 }
components/search/index.js
New file
@@ -0,0 +1,81 @@
var util = require('../../utils/util.js');
Component({
    data: {
    history: [],
    content:'',
    hint:'',
  },
  methods: {
    // 返回上一级
    onCancel(e){
      this.triggerEvent('cancel', {}, {}) //给cancel绑定事件
    },
    // 搜索
    search(e){
      var _this = this;
      var content = _this.data.content;
      if (content == undefined || content.replace(/\s*/g, "") == ''){
        content = _this.data.hint;
      }
      wx.navigateTo({
        url: '../../pages/shopTypeSecond/shopTypeSecond?content=' + content,
      })
    },
    // 数据绑定搜索框
    formName: function (e) {
      this.setData({
        content: e.detail.value
      })
    },
    jumpGoods(e) {
      var content = e.currentTarget.dataset.content;
      wx.navigateTo({
        url: '../../pages/shopTypeSecond/shopTypeSecond?content=' + content,
      })
    },
    // 删除历史
    cleanHistory() {
      var _this = this;
      // 删除历史
      util.request("GET", '/wxapi/shopUserSearchRecord/deleteSearchRecord', {}, function (data) {
        if (data.status == '200') {
          _this.searchHistory();
        }
      }, true);
    },
    // 搜索历史
    searchHistory() {
      var _this = this;
      util.request("GET", '/wxapi/shopUserSearchRecord/getSearchRecordList', {}, function (data) {
        console.log(data.rows);
        _this.setData({
          history: data.rows
        })
      }, true);
    }
  },
  attached() {
    var _this = this;
    // 默认搜索
    util.request("GET", '/wxapi/Advertising/getByType/index_search', {}, function (data) {
      _this.setData({
        hint: data.rows[0].title
      })
    }, true);
    // _this.searchHistory();
    util.request("GET", '/wxapi/shopUserSearchRecord/getSearchRecordList', {}, function (data) {
      console.log(data.rows);
      _this.setData({
        history: data.rows
      })
    }, true);
  }
})
components/search/index.json
New file
@@ -0,0 +1,7 @@
{
  "navigationBarBackgroundColor": "#f7f7f7",
  "navigationBarTitleText": "搜索",
  "component": true,
  "usingComponents": {}
}
components/search/index.wxml
New file
@@ -0,0 +1,20 @@
<view class="container">
  <view class="header">
    <view class="iconfont icon-fanhui" bind:tap='onCancel'></view>
    <view class="search_container">
       <view class="iconfont icon-xiazai17"></view>
       <input value='{{content}}' bind:confirm="onConfirmEvent" placeholder-class="in-bar" placeholder='{{hint}}' class='bar' auto-focus="true"  bindinput='formName'/>
       <view class='iconfont icon-shanchu cancel-img' bind:tap="onDelete" class=""></view>
    </view>
    <view class='search_text' bindtap='search'>搜索</view>
  </view>
  <view class="history">
    <view class="search-history">搜索历史<text class="iconfont icon-lajitong" bindtap="cleanHistory"></text></view>
    <view class="history-content">
      <view wx:for="{{history}}" wx:key="ids">
        <view class="history-content-name" bindtap='jumpGoods' data-content="{{item}}">{{item}}</view>
      </view>
    </view>
  </view>
</view>
components/search/index.wxss
New file
@@ -0,0 +1,78 @@
@import "../../icon/iconfont.wxss";
page {
  background-color: #f7f7f7;
}
.header {
  display: flex;align-items: center;
  margin: 10rpx 0;
}
.icon-fanhui{color: #B2B2B2;font-size: 30rpx;margin-left: 20rpx;cursor: pointer}
.search_container {
  height: 56rpx;
  /* width: 75%; */
  width: 561rpx;
  background-color:#FFf;
  border: 2rpx solid #F7F7F7;
  border-radius: 10rpx;
  display: flex;
  align-items: center;
  /* margin: 16rpx; */
  margin:0 32rpx 0 31rpx
}
.search_text {
  color: #00C085;
  /* line-height: 94rpx; */
  font-size: 32rpx;
  margin-right: 21rpx;
  white-space:nowrap;
}
.bar{
  font-size:26rpx;
  color: #000;
  padding: 10rpx;
  font-family: PingFangSC-Regular;
  width:100%;
}
.icon-xiazai17{
  padding-left: 18rpx;
}
.history{
  margin-top:14rpx;
  background-color: #FFF;
  width: 710rpx;
  height:366rpx;
  margin-left: 22rpx;
  border-radius: 10rpx;
}
.search-history{
  color:#B3B3B3;
  font-size: 24rpx;
  padding-top: 20rpx;
  padding-left: 20rpx;
}
.icon-lajitong{
  float:right;
  margin-top: -4rpx;
  margin-right:20rpx;
  font-size: 38rpx;
}
.history-content{
  margin-top: 30rpx;
  display: flex;
  flex-wrap: wrap;
  margin-left: 36rpx;
}
.history-content-name{
  color: #666666;
  margin-top: 16rpx;
  border: 2rpx #AAAAAA solid;
  border-radius: 10rpx;
  font-size:24rpx;
  height: 22rpx;
  line-height:24rpx;
  padding: 20rpx 36rpx;
  margin-right: 40rpx;
}
components/skuList/skuList.js
New file
@@ -0,0 +1,96 @@
var comReq = require('../../utils/common-request.js');
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    goodsInfo:Object,
    normsList: Object,
    normspopup: Boolean,
    currentSku:Object,
  },
  /**
   * 组件的初始数据
   */
  data: {
    num:1,
  },
  /**
   * 组件的方法列表
   */
  methods: {
    insertCar(){
      console.log("多规格加入购物车");
      comReq.addShoppingCar(this.data.currentSku.id, this.data.num);
      this.setData({
        normspopup: false,
      });
      wx.showToast({
        title: '加入购物车成功',
      })
      this.triggerEvent('refresh', {},{})
    },
    //规格选择
    norms(e) {
      var sku = e.currentTarget.dataset.sku;
      this.setData({
        currentSku: sku,
      })
    },
    //取消领券弹窗选择
    popupTap(e) {
      this.setData({
        normspopup: false,
      })
    },
    /**
  * 绑定加数量事件
  */
    addCount(e) {
      var _this = this;
      let num = _this.data.num;
      num = num + 1;
      this.setData({
        num: num
      });
    },
    /**
     * 绑定减数量事件
     */
    minusCount(e) {
      var _this = this;
      let num = _this.data.num;
      if (num <= 1) {
        return false;
      }
      num = num - 1;
      this.setData({
        num: num
      });
    },
  }
})
components/skuList/skuList.json
New file
@@ -0,0 +1,4 @@
{
  "component": true,
  "usingComponents": {}
}
components/skuList/skuList.wxml
New file
@@ -0,0 +1,51 @@
<!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{normspopup}}"    >
    <view class='popup' bind:tap="popupTap"></view>
    <view class='norms-container'>
      <view class="norms-list">
        <view>
          <view class='norms-detail'>
              <view class='norms-item'>
                <image src='{{currentSku.imgPath}}'></image>
                <view class='norms-content'>
                  <text class='title'>{{goodsInfo.title}}</text>
                  <text class='stock grey'>库存:{{currentSku.stock}}</text>
                  <text class='price'>¥{{currentSku.price}}</text>
                </view>
              </view>
            <view class='close iconfont icon-quxiao' bind:tap="cancelNorms"></view>
          </view>
        </view>
        <view class='norms-select'>
          <text class='threeblack'>规格</text>
          <view>
            <view class='norms-box'>
              <block wx:for="{{normsList}}" wx:key="ids">
                <view class='norms-box-item {{currentSku.id == item.id?"selectedNorms":""}}'
                 bindtap="norms"
                 data-sku="{{item}}">{{item.name}}</view>
              </block>
            </view>
          </view>
        </view>
        <view class='norms-number'>
          <text class='threeblack'>数量</text>
          <view class="cart-count-box">
            <!-- iconfont icon-jian -->
            <view class="cart-count-down" bindtap="minusCount" data-obj="{{obj}}" data-index="{{index}}">
              <image src='/image/jian.png'></image>
            </view>
            <text class="cart-count-num">{{num}}</text>
            <view class="cart-count-add" bindtap="addCount" data-index="{{index}}">
              <image src='/image/jia.png'></image>
            </view>
          </view>
        </view>
      </view>
      <view class='norms-footer'>
        <view class='norms-join' bindtap='insertCar'>加入购物车</view>
      </view>
    </view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择END\\\\\\\\\\\\\\\\\   -->
components/skuList/skuList.wxss
New file
@@ -0,0 +1,203 @@
/*==========弹出购物车================*/
/* 弹窗 */
.popup-container{width: 100%;height: 100%;position: fixed;bottom: 0;z-index: 99}
.popup{position: fixed;top: 0;bottom: 0;width: 100%;height: 100%;background: rgba(0,0,0,.7)}
.norms-box {
  display: flex;
  flex-wrap: wrap;
}
.norms-content .title {
  white-space: nowrap;
}
.norms-content  .title {
  font-size: 30rpx;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.norms-content {
  margin-top: 30rpx;
  width: 60%;
}
.norms-detail {
  padding: 40rpx 0 60rpx 0;
}
.norms-box {
  padding: 10rpx 0;
}
.norms-item-list {
  display: flex;
  flex-wrap: wrap;
}
.norms-select {
  margin-bottom: 20rpx;
}
.norms-number {
  display: flex;
  padding: 20rpx 0 50rpx 0;
}
.cart-count-box {
  width: 92%;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  /* align-items: flex-end */
}
.icon-jia {
  color: #666;
}
.cart-count-down {
  color: #b3b3b3;
}
.cart-count-box text {
  display: inline-block;
  text-align: center;
  width: 46rpx;
  height: 45rpx;
  line-height: 45rpx;
}
.cart-count-down {
  margin-right: 12rpx;
}
.cart-count-add {
  margin-left: 12rpx;
}
.close {
  font-size: 40rpx;
  color: #9b9b9b;
}
.norms-footer {
  width: 100%;
  height: 106rpx;
  font-size: 30rpx;
  display: flex;
  line-height: 106rpx;
  color: #fff;
}
.norms-footer>view {
  flex: 1;
  text-align: center;
}
.norms-join {
  background: #ffb95f;
}
.norms-pay {
  background: #ff5806;
}
.norms-content .price {
  font-size: 32rpx;
  font-weight: bold;
  margin-top: 20rpx;
  color: #FF3F3A;
}
.stock{margin-top: 20rpx}
.norms-container {
  background: #fff;
  width: 750rpx;
  background: rgba(255, 255, 255, 1);
  border-radius: 10rpx 10rpx 0rpx 0rpx;
}
.grey {
  font-size: 26rpx;
  color: #999;
}
.norms-container {
  position: absolute;
  bottom: 0;
}
.norms-item image {
  width: 180rpx;
  height: 180rpx;
  margin-right: 35rpx;
}
.norms-item {
  display: flex;
  width: 96%;
}
.selectedNorms {
  color: #ff3f3a;
  background: #fff;
  border: 1px solid #ff3f3a;
}
.norms-detail {
  display: flex;
}
.norms-content {
  display: flex;
  flex-direction: column;
}
.norms-list {
  width: 90%;
  margin: auto;
}
.norms-list .threeblack {
  font-size: 26rpx;
}
.norms-box-item {
  font-size: 24rpx;
  background: #eee;
  color: #333;
  padding: 9rpx 30rpx;
  border-radius: 30rpx;
  text-align: center;
  margin-right: 20rpx;
  margin-top: 20rpx
}
.cart-list .cart-count-box{
    display: flex;align-items: center;
    margin-top:55rpx;
}
.cart-count-box image{width: 32rpx;height: 33rpx}
.cart-count-down,.cart-count-add{
    height: 100%;
}
.cart-count-num{
    background: #f9f9f9;
    font-size: 26rpx;
    border-radius:5rpx;
    color: #B3B3B3;
    text-align: center;
      width: 43rpx;
    height: 41rpx;
    line-height: 41rpx;
    margin-left: 15rpx;
    margin-right: 15rpx;
    margin-top: 8rpx
}
icon/iconfont.wxss
New file
@@ -0,0 +1,164 @@
@font-face {font-family: "iconfont";
  src: url('//at.alicdn.com/t/font_1571078_ry8www01gg.eot?t=1590463829403'); /* IE9 */
  src: url('//at.alicdn.com/t/font_1571078_ry8www01gg.eot?t=1590463829403#iefix') format('embedded-opentype'), /* IE6-IE8 */
  url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABZgAAsAAAAAKFAAABYQAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCIGAq6PK5NATYCJAOBGAtOAAQgBYRtB4NQG0shVQQ2DkBi2BeD7P8vCfQYp6Eqj5WVVbeNG4GbNqxcl4IhobcbO/K6VsQJkUP8kkakokduJKQ95N+lGveO/XZP/lEs+eVedSglD88fe8+Ln7GooNEoKQlGPpYJ39XP83P78959q2Qwag32EEb1aIP6DG1ybxu1fWLYzMDGj9WAhaL8+aPA+hiFUc3EqP+R/c/ahApVRJO4Tr2rtbta9pbm6UsoiIlrPozYTmhCJ1u+QfKUUZv/nw+c1GVJ9ub+X7IDM5KVHGL1BE1BhsAB8TZya7eChQAtHwEYmvYZwMHk3pJtmNwjqo1IY8RMS/QAgYr7GuCf/6nN5jOWurHVBV6Yny3MFAaLUv+n6TX/pzmahJXbuZ2W0ZTVMMaSODxbqORmc7O5NVlDHUKCVmiHkB51SzIp/teaZp6Mw2Ns1Y5cBT56GIU6NmHkRw1NQtemc+mhOioH6CpKE5zycWYoAHpMUwsyk3ZpU9BjJbBGoGjnRfhvIvHJ/3z6T4KpB7JGATqsdzKpGOKewXLGnp3cRPQCtvZ0PPREwTkq+VlYl54kyCfnXOqKfj6RPHFtWzUOpG9owY07KQUfQwwXJFy0XHkqHXt269md5+6XfkYRgJ4/BV5ABdS7FHrjaCy5dmPPvwV3IBGk7mzUf8cDWxYtG1lzYGrTira5ia4dS5IFVVasG2vp2DbQNNS3b9eqPTM9GxqkJsDJfUhf5PABAQyyRWCQRQKHLBMIMiIYkDWCFWgjzAPIlOBDNgkBZIUQQtqEG2ROuFO4sBdAuoQ3ZIeQQJYIKSQRCsgCoYJUwgeSiSGQQqipdsN+ABkTwyEtIgjSIUIh20QYZECEQ5pENGRI5EL6RB4lR7gSILvEMcgqcYuSO3wHIDO+3SE9vqWQDb5nnKUBDt1ungF8gs46/S7QfemYa8r5YC2yhjbTs6ZbXlSQkkjOoWAjHN/Q0uOf843H8cxvtOzgep+MiIVdlQAbww5U+m6ARKtggixFRRT5thVDsCyTT8IbJlFWh5k1MpwIyPhOdCgGcOpyVbXPJDEgJOIeKy0REi0LINrq/HhZlH3AsDQ5k1sNRfsZN74U4r8LvsZ6rn82FkY/XUb3+gvl+7gnvjivq3JhZfdQRtNQx5KmOMl5JfAECVypiLi+igSnHnItEmOABGeoM5exhhBrHSoHDRAXIxSEsMcdCoZMM8g64VoHKieaQk/Mq2bV3meg5eepzE4AJ4JA0uRrXuaSOAdKaaXvJesq445yLUvcWRiyKmOdeRqOr3Xa4TrWWRQ6lbWOmqvgxF3ap28v4KRESLNfgLE1tMVXk+Z8TssNMgN+Rm8d2yG5iJyd20WkQrZrp9JKpzt2qaZzskVfrCd+MxIYf8MEvbHgUViMkbV6Y3N8FXZi6gU6bvFieax/cPRTeHPUrnTYtni5jeiKo1C3aocdc5L1xWqTjPZxw76qI5TlF8efjd6QbOGe/ZzD6sP4Pr8XPdgWLgwNuCXy+9Wzl6BLPRe9vvX02R3EY8mtJKYF7aDaE+Y2XWvxfrB12LzYDsxAWzUqy3TA2+JGD9qk/pTxE3PnzSnnYjIbp/NJvlzJFtdFph6O+khmOygLXvgifApccpFoEmPAxFbQNFV768Rnjwsueyg/E8RSjqkZLq2ChnAeLvvPzMWStmusDQplPP75MNumZdHYguEvLTORqYdm7/Ub5fsrcOPhPLPywMUxJ0iFQ2rG8ByWBh0+hy3poWSk6E6GJJhMegZJzE3jZTAjIRmLcq3BnrKYFuS2V52dcOyz+PVFT80AqXvwHK2TSfkF2WbyWvy24hRc1tmtK9MRHQ8GXnGqZXNzASOoBtMzTmiGD1ZujxwFR8IG9SQnrghAcEpSmOKzPG5EKUdrlvNLNkKJoXZ1g75+GGRb1CtVdje3T2dJVdmMZb7SWWcY2HW4coe8ayefMhSJ2bFLiuPXg9tr1qjkrSFUalYAr702+1egSM3aeDXed/09AtAH+/XNH5+BZTJtvObSU8q23xx8MYtXP3n1duzK3wZdP3sLvprHHKSvu8wVX9gChl3TRJah4qgNTcur2sEHhOO7wlGKjfi3cehV2wIdU29LbYy4Q5IIsVVTz1csKOBR5xLXk8AN9KbtVogymtpq5wHg95aj0faCM/nk2icDGPscwbFmCljQEVR/MHejKKvwnJwBJpP1SABwAtlufjXD8S/R7Zp1GWoMc1brRq1MRHLlLWvV8Q8tfokbLCjIlMbOnlhSz0l16755u3Vz/xvrZqgarzA4bSB4ANSB4PqvOD9b72AcrVzpwrUfaDqT9z6yPM+bJ+uWaPIWtXUnbLsoCjMxjumxWeaPHKw+D+We3HaILNCBRUD3ZfGnk+yXU/UpqfGrztbpe5x4LdPOWrVlb956u2GU1WCQsnNEq4Q8EtehVGviAWF55NCI6gQ5Y9XVMwCs3PxoZpiOvY+8XFTKbv1IAM9Lt3jqTnyoB8wggQNfOWYt5OOBS5qXgPFqN8N1AdOMhWVEVorGa0MDhexo1/iDkcScCWpmA2vWeNbazVwNMZgYc+8FqZygtpVGnhszwWVBm8Zm97OPMlL9KdMKfjn6PVm1XpAUY4rLP9tWE8QG9ebVWjpP9uPmMQQwYPv3oSFKFvcgAF27N78wdv/nnpsPF0nhvqHUXN5db881+2AvXK7lGMgLq9S+uIy4NTDYBoEMuMCXzXaZXQp2hXca4mSkbxkwsglFfDD2dN/48J0VfATvC99dzjZJa+OTDqjtlftum/coIDI/7WQFPGQy4ywiLsHoahxLUBACdUfK6dIa4/bCUDM0l6SwQ0jPDmC6ys/t2s4k0RUjB7uUD2tHcO3+tuLnlBS/55Zb50xerF3avpnJ+rXz/cCCyPBdc3Q9YeXimd76hXldtlG+vSLwBv1a0y6Uz+3aGrwnbNiKFA/XYXADP6HYLc1Idg0fIkWIO7K52lmFgXUGzAJvdjuOGQ482WCv7tgYQRDXWgNFULqXzzyw98UdCKezavcJZRpTaaVnjVpg2I6aZw+B1/fU7g+A3rUdNoB9nZm1fjvzCOJ+wkmKo+BHDtNvP/P8JVliIEvkb1H6keYd19h/nRWeppITidxmNs3IH+ga/f5/3DbQSDLG08lGsJH08Qxy0AcPeCN06LF59NIn0Hpt8J9pLFZTg42l7+HvoUFKXl4qloINJD7hSsfG1tTAPr1VTM6ggyXdHGLr5LxQlsPNwcrLyGvqEfc05dW9yXV3WkYeeITm5wMYXN3Hi+nChuBf7Go26zYl9YCDG4R0cew/ji9Ums+Eo1G/+U4Qi2mOPbEIxvd43Sbd5pxE37vvv8dBE4t9J/wWddRnAo36xfFP+Kb16xvDvKgosFvnO5nOYB1QQSCoDrAY9EkDdN2BiOIdtlzTPMibglTdupDRT/q+QLDJPliSHpxKhaheg0BW5+5OCu8KSV/sJta7nBXmisUpTSz2nMAZd4Do60MHUGdHDhBZ838f0Wnyf5gc24Ku3yCaiZZQWxBghzZDHYAc1SBEaQFKSLIqjctd77lowXyNVem5zmL5+mW9h8YTYoR9vXcGhQX80GjrUXADhqrevXHE3/Pv59HjkkiW9YFWouVZhwYXcoqliQ8yZq/SRa9WdnpFsf16QySBfL/B+/MUndFLveTsDNMrQuzFXRhjK79JI4yMrIPUC2XQV52Uo8pWzpqlzFLp/ilkdJqzlTmqDt4hSwCynCiPy+3o9WtiP2FvYr9HKEB2tP+74P+lDBognRuK8hnmQebDq9wUAbeMkCge6iELFsTZfAb7sHZuMvzgpYn6mgaafzwEgQINU93T11CEvyGf5JmexoDNFT/tGiGRUK4BdfU14mqYzCm6dobg8YgzRMSORnAJoqNLYxEtvUSKhWLSkt1K0QUF5xRHwT3CvXMKmv0sbGDYszG01FOVlKShWo5YqKeiowJPb4qBZaB4e3b7BjPfQu05ruQ8IRIREs8HhlDoS8C/3edr9xl3COMfHJfN1vbdLlyPjJPtRw4Horh/YgiGDm8cvw7uQjhOdCUKTChBAKXdf1HN3jf2QFY7K9DOu9klGsYQ2YbZRFKn/e72WXXj6Y14I93spoZmWpq0JVWaIikvlyRL01oKGR30fYtUaUuaNFnQ0gmkyppVl63UqTpnd1ld3bzOZXV1SqcOsmbVqeI7kH9cQ+qOQp6W0VeSbZxfG7XEGrXGpPXzMZlDgaoa7ZIuHK38u0j8uOWHs7I5nLXa4cOZ2RIJPQyp5Cq/MemKUbKaGtkoRXp7IaPTPEqeLm8nIiJ29PR2+SsWeMrSFbniQ8T3fuIgcej790Nfmf3fibnY33/k7q9t+1PaR0Gwv2q3vYPlYHXYdx/ew3aw2q6ualIyHUxl0+4mjZfDS9PU2k3VrmYDgz1i1e36evf6O3O1vK+HNk+GD2ArhrFBRfsuFLff/oW2JgeTtjR7tFq35tfc1aPU13ksp3FhWtKqQwlmSIS4qNL81UktifW7/X7AKEG5N1blfEb1zfGK3JirVyeznG5Olgbk/7+bb4J/BrKzHMy9TEfTMcS1j179J6mgtTPXMb9nOlhQUFWYEfuwZQ13AzuNPp4Nztj8ZdyRyrhkSbLrz9S0Noc548KEkWf3hhoXrvlRqSFYNXtrX+JzN66Jba2CjVPmZkZ8hib2arbv/upEsjdLyQphXfCyEIV0ksKdlm08jVTD2+YslVQlxDK4iex4cCoyC9/XZXrXbuRMovpxuw4lRg+MRVzfqR8nKSfpHXF9kWV91yE/ruyU0ob/lVl4rnTQU+/du7Y/l+XvpBovGS9MPPJc8Y0s4tzQ/XsWwrohPtOOrZuHLcCOb1LNCFXoW2dZsAps5zRlUcpK8XNJ7QXsYmamJJuIGZU5KFNAyaYIMjFqLfUZa3FLJH7BwH7OMVzAjxSLErUWE06tpT2j1VLxONw7ipNcoLDfip0sM6hLpjBM2VHBpujNi8Aj/vLlWpFTVPvt20SfiQiE3V++nEK/5XaLLrosa+px62ki3QRwOlvcOF61lhtHbYjEnVmGOjuRxGUTQ4iksOoQ867oLpPDJFeuJPdYRSTIXVzt6OUJtBZyshuS/X/9vTTXYsdfnkRr0OrbR033GzJHnQYDj2kt2jLba60VtKxAE3PoHPWItfipXWhmZGDJPN74BwqJ4oHbvL7+PE85RR48Fd5KWFzHJJ88sbr0iMjLtCVS1ONiffKEBOdHUZ7B5V72PRfDLjDTKatnJL992//9be/du7rv/SdPajQrlVI1YtHCHOh/uEGRy4gbqcjlTjMhk1NuwCqTcVae6CIo6QKBBL+ct5w8dswgMgpIV/LYibNpragWal2nHOsSrajFrCKrAOfg3E9vhL/vNx5ppS0Wr7vYiGnjoTheK7Dc3yleKt55z8LXajFcG7/tSG9bXFvvnvg9WeCjleK9/0x6B2Mmo0PwD9No9JiFHVP/PW7XsQu7ChWWlfJoeoeggx499Fm3QcOHEAx/FKjY5dHjglphLvIdM3ToLTwN0FIK0/Hl1NUmW1N2ojo0PM2MqrAZKSGilsTBjm71A3Lv+OiP+CN9+73kA3V3QoJvlig1BGagqjRzeKg6KYFlslFXY8uL0se7YlqUGeMrQXEaFWYvlySOCishHgWMkP2q/kVcc4kIZzXRg9TokpW2f9gv8qsSPzhWAwNbs0iiWSRR5UTGP4J/GNHP733voUdn8e9ii/E7/Nvys/hirJtyE0i4bTU/Vw9WT0NUkBVNa1NQfq6oJUtAQsvsZsh9pp4+7YBMubzxlmHSxS0bt8yaXjC5YFa8P2/GojiX34vbfNsa2ga0NZFhnV87uHmws2nNQ3q377XkoWKUZ+G2y68s/1OKib642kfAtwFnoP8ETjJb6xXvMp2SuMgRE9moS3arDCwoG2aSx+UzKxbl7no/zbg0cnNDpNEyLdIyXeieq/84PXLjshdvHfMN7HzjvSma+lrNvZ0mG4K7KD9RQ6lE2Hbmz+xW9nnab5y3ZFhj2h5GUGm+P9kbuK28Bvtv9s28Vu7mHOEGvt5X30CoCc7eC5GzpljONioDlY2WE8QH2naiqATggvYi34mo6qKVjm+L+FYZlgP7lj+gbVypuCvy8eKdVV3i0nESGs+SWWRzyhvJ4OTb8NZ9eD2M1nYbHs5vd9pni9DjC5biRtzUmh6HDBNuTKq7SJwTiropgYh+8VHEH47e3wkiIrYLIYGq45YQxhxGiIWPY1jgGe0QDL92ArQD4ERqANHm//iJS8CRPAOMs9O/jVjmcoftZDW1WH7YpKh6XVoI4/5/A2Hyf09O56QNYYpCB4e8YL1AcgrkHOBMo6al5VvzdZD6zTrPwQFP8Jf3Y6IT8S/eG5ISx/31oZlnUIfpykrjqb9psJEjB8/8b1njsoYv05rSRizSLkgs1a26ZL03Ul1VOWwkMcNIWM+TipSA8Y3LJwS4vXZWkrKxgC9wqwV81IhvV2rrps2YWX3tp9Hp8wtMUOfsfqBdOD+yIYHTCQjAP1ueKA4/DOA85DCKAXAe5iCOnRMgG/u3UyiTrfcfms6u8QqVsO3OouRYq6sosS49Fl8DAB3AH5s9upAMWJutaDa71ktkit30N/LFZL5A2tgzo5GnlWlDsPylZuRahy/BZ/Hd+3GW3owvsMz32pAA2GuOokHlRxySmb3jd+QTa1KPCvqu6ULDnU+5rTm6lNs85+V3HMHE3juIv5Wpcini/UOvLeC9CtHk8aI+0Vn/92u89b5dx4PtnDEbAOiAA6WY5Pw/6xTCVsD0h95LKBnwIQGr5jqd4V8Fd7H1G5ByxQD4FzgmDgBM+xGAf+hVC+GeLrIrWvh3p+wacjjQQMIhoIMPIBYO4yjAgiCOCnSI5ZgwFFJ6Z4ELVAICjGAAwBCov3EY8OFnDgcuHOIQ8KEbEAvvchRwgx6OCnwMcUzIxVzSZMEAzMRMqNQXVOuL5YVT5aYicwVZB6qZ3qnZekNNWUFltIQX5+orq0yN8gA//+TRFH2FvrINjyqrQVNdTcrJSnO5PPk2PH1ZmVluqTSX6Iuq/YzV1ZaI4cNJkadfkbkcmJAAlaCHAqh21ywGORTC1K1NUARmqADy6dXATP3+bNCDAWqgDAqgsuCKb1vngh4qoQpMby+HAPADfwRIkSpQV5TFXgVWMIAGqi2dBDk7vxLMUA5ySLZ0PZTZMTPIwSJurQT0UATV4AfGGqYFImC4dScSK/n1L5dvJQkW31XpXB1A4yRZUTXdMC3bcT2fzeHy+AKhSCyRyuQKpUqt0er0BmNgWYHlI1bhW9p/1FFRMNFRGPxYoqAURR3ZvlA8+DiUJN+UvOR0Raz/yBRWP588mBb6jeH6B/Y9EkpGdz2ruPlp7Dp1ZLlj9oSiLypH++3ufNvvurn4zh8KUOuptOo/2agGTLtuU7b2DtWrSUwZl9bDeckbLrpYnKlQrzHKCJd2hRCbluVPA6bzzcSXxSrgYVr+wqtOAF2jr7HNqyi861jxGYW0KjwxhkQtFhRsc8GupW7Vqpf0Kiidn9YHozQg7X0qJqDdpqJRVAIAAA==') format('woff2'),
  url('//at.alicdn.com/t/font_1571078_ry8www01gg.woff?t=1590463829403') format('woff'),
  url('//at.alicdn.com/t/font_1571078_ry8www01gg.ttf?t=1590463829403') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
  url('//at.alicdn.com/t/font_1571078_ry8www01gg.svg?t=1590463829403#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.icongouwudaidaizishangcheng:before {
  content: "\e61e";
}
.iconyouhuiquan:before {
  content: "\e624";
}
.iconquxiao:before {
  content: "\e62a";
}
.iconweigouxuan:before {
  content: "\e623";
}
.icongouxuan-xuanzhong-yuankuang:before {
  content: "\e77c";
}
.icongouwuche2:before {
  content: "\e639";
}
.icongouwuche:before {
  content: "\e62f";
}
.icongouwuche1:before {
  content: "\e612";
}
.icondaohang1:before {
  content: "\e634";
}
.iconshouji:before {
  content: "\e61b";
}
.iconlianxiren2016921:before {
  content: "\e718";
}
.icondaohang:before {
  content: "\e656";
}
.iconshipin:before {
  content: "\e638";
}
.iconlaba:before {
  content: "\e63d";
}
.iconlocation1:before {
  content: "\e603";
}
.icontianjia:before {
  content: "\e62e";
}
.iconshoucang:before {
  content: "\e618";
}
.iconkefu:before {
  content: "\e60f";
}
.icontop:before {
  content: "\e6dc";
}
.iconshijian:before {
  content: "\e616";
}
.iconliaotian:before {
  content: "\e621";
}
.iconright:before {
  content: "\e601";
}
.icondown:before {
  content: "\e61d";
}
.iconleft:before {
  content: "\e602";
}
.iconfangxiang-zuo-:before {
  content: "\e611";
}
.iconguanbi:before {
  content: "\e6c5";
}
.icondaifahuo1:before {
  content: "\e609";
}
.icondianpu:before {
  content: "\e62d";
}
.iconrili:before {
  content: "\e71e";
}
.iconquanbudingdan:before {
  content: "\e610";
}
.iconlocation:before {
  content: "\e600";
}
.iconxiangmu:before {
  content: "\e637";
}
.icondaifahuo:before {
  content: "\e61c";
}
.iconyonghu:before {
  content: "\e672";
}
.icondaifahuo2:before {
  content: "\e6da";
}
.icondaifukuan:before {
  content: "\e65f";
}
.icondianhua:before {
  content: "\e60b";
}
image/11.png
image/2.png
image/24.png
image/3.png
image/56.png
image/587.png
image/60.png
image/61.png
image/62.png
image/arrow-bottom_01.png
image/arrow-bottom_02.png
image/arrow-top_01.png
image/arrow-top_02.png
image/avatar.jpg
image/bg.png
image/card-bg.png
image/card1.png
image/card2.png
image/card3.png
image/cart.png
image/cart_grey.png
image/consult.png
image/fail.png
image/fh.png
image/goIndex.png
image/gwc.png
image/head-bg.png
image/head-bg2.png
image/head.png
image/home.png
image/home_active.png
image/icon_cj.png
image/icon_share.png
image/icon_zp.png
image/jia.png
image/jian.png
image/logo.png
image/nocoupon.png
image/pocon.png
image/qb.png
image/share.png
image/shopping.png
image/shopping_active.png
image/spa.png
image/spa_active.png
image/star1.png
image/star2.png
image/tc.png
image/time.png
image/time_active.png
image/tp.png
image/type.png
image/type_active.png
image/user.png
image/user_active.png
image/w-bg.png
image/wx.png
image/zwjl1.png
models/address.js
New file
@@ -0,0 +1,14 @@
var util = require('../utils/util.js');
var api = require('../utils/service-api.js');
function newAddress(){
  util.request("GET", api.address.newaddress, {}, function (data) {
    console.log(data)
    _this.setData({
    });
  }, true);
}
module.exports = {
  newAddress: newAddress
}
models/swiper.js
pages/ads/showAdPage.js
New file
@@ -0,0 +1,153 @@
//index.js
//获取应用实例
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
Page({
  data: {
    adNodes: [],
    distance: 0,
    size: 30,
    step: 1,
    interval: 20,
  },
  onLoad: function(options) {
    var pageCode=options.pageCode;
    if(pageCode){
      this.getAdNodes(pageCode);
    }else{
      wx.showToast({
        title: '页面加载失败',
      });
    }
  },
  onShow: function() {
  },
  getAdNodes: function(pageCode) {
    console.log('加载广告');
    var _this = this;
    util.request({
      method: 'POST',
      api: api.ad.getAdPage,
      data: {
        "pageCode": pageCode,
      },
      callback: function(data) {
        let hasPmd = false;
        for (let i = 0; i < data.rows.length; i++) {
          let node = data.rows[i];
          //处理属性节点
          console.log(node.nodeAttribute);
          if (node.nodeAttribute != null) {
            node.nodeAttribute = JSON.parse(node.nodeAttribute);
          }
          if (node.nodeType == 5) {
            //处理跑马灯,一个页面只支持一个跑马灯
            var length = node.nodeValue.length * _this.data.size;
            _this.setData({
              length: length
            });
            hasPmd = true;
          }
        }
        _this.setData({
          adNodes: data.rows
        });
        if (hasPmd) {
          _this.scrollling();
        }
      }
    });
  },
  /**
   * 点击广告节点事件
   */
  clickAdnode(e) {
    var linkType = e.currentTarget.dataset.linktype;
    var linkUrl = e.currentTarget.dataset.linkurl;
    if (linkType == 1) {
      wx.switchTab({
        url: linkUrl,
        fail: function(e) {
          console.log(e);
        },
      });
    } else if (linkType == 2) {
      wx.navigateTo({
        url: linkUrl,
      })
    } else if (linkType == 3) {
      wx.navigateTo({
        url: "/pages/webView/webView?url=" + linkUrl,
      })
    }
  },
  scrollling: function() {
    var that = this;
    var interval = setInterval(function() {
      var maxscrollwidth = that.data.length;
      var left = that.data.distance;
      if (maxscrollwidth + left > 1) {
        that.setData({
          distance: left - that.data.step
        })
      } else {
        that.setData({
          distance: 0
        });
        clearInterval(interval);
        that.scrollling();
      }
    }, that.data.interval);
  },
  setShopTitle() {
    wx.setNavigationBarTitle({
      title: app.shopInfo.shopName
    });
  },
  //转发
  onShareAppMessage(res) {
  },
})
pages/ads/showAdPage.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/ads/showAdPage.wxml
New file
@@ -0,0 +1,65 @@
<!-- <navigator url="/pages/groupbuy/groupList">团购</navigator>
<navigator url="/pages/miaosha/msList">秒杀2</navigator>
-->
<block wx:for="{{adNodes}}" wx:key="ids">
  <!-- 图片展示 1.image  2.text 3.swiper 4.video -->
  <block wx:if="{{item.nodeType==1}}">
    <image data-linkUrl="{{item.linkUrl}}" data-linkType="{{item.linkType}}" bindtap="clickAdnode" style="{{item.nodeStyle}}" mode="{{item.nodeAttribute.mode}}" src="{{item.nodeValue}}"></image>
  </block>
<!-- 文字展示 -->
  <block wx:if="{{item.nodeType==2}}">
    <text data-linkUrl="{{item.linkUrl}}" data-linkType="{{item.linkType}}"  bindtap="clickAdnode" style="{{item.nodeStyle}}">{{item.nodeValue}}</text>
  </block>
<!-- 轮播图展示 -->
  <block wx:if="{{item.nodeType==3}}">
    <swiper autoplay  style="{{item.nodeStyle}}" interval="{{item.nodeAttribute.interval}}" circular='{{item.nodeAttribute.circular}}' previous-margin="{{item.nodeAttribute.previous-margin}}" next-margin="{{item.nodeAttribute.next-margin}}">
      <block wx:for="{{item.ads}}" wx:for-item="img" wx:key="ids2">
        <swiper-item>
            <image
              bindtap="clickAdnode"
               data-linkUrl="{{img.linkUrl}}"
               data-linkType="{{img.linkType}}"
               mode="{{item.nodeAttribute.mode}}"
               src="{{img.imgUrl}}"
               style="{{item.nodeStyle}}" />
        </swiper-item>
      </block>
    </swiper>
  </block>
<!-- 视频展示 -->
  <block wx:if="{{item.nodeType==4}}">
     <video data-linkUrl="{{item.linkUrl}}" bindtap="clickAdnode" style="{{item.nodeStyle}}"  id="myVideo"
      poster="{{item.nodeAttribute.poster}}" controls="true"
      src="{{item.nodeValue}}"
      object-fit="fill"></video>
  </block>
<!-- 跑马灯组件 -->
  <block wx:if="{{item.nodeType==5}}">
    <view class="notice">
        <text class="iconfont iconlaba" style="{{item.nodeAttribute.iconStyle}}"></text>
        <view class="content" >
            <text class="notice_text" style="left:{{distance}}rpx;{{item.nodeStyle}}"   >{{item.nodeValue}}</text>
        </view>
    </view>
  </block>
<!-- 滑块展示 -->
  <block wx:if="{{item.nodeType==6}}">
    <scroll-view scroll-x
     class="huakuai" style=" {{item.nodeAttribute.style}}" >
            <image  wx:for="{{item.ads}}" wx:for-item="img" wx:key="ids2"
              bindtap="clickAdnode"
               data-linkUrl="{{img.linkUrl}}"
               data-linkType="{{img.linkType}}"
               mode="{{item.nodeAttribute.mode}}"
               src="{{img.imgUrl}}"
               style="{{item.nodeStyle}}" />
    </scroll-view>
  </block>
</block>
pages/ads/showAdPage.wxss
New file
@@ -0,0 +1,41 @@
page {
  background: #efefef;
  width: 100%;
  overflow-x: hidden;
}
.notice {
  width: 100%;
  height: 80rpx;
  line-height: 60rpx;
  background: #fff;
}
.notice>.iconfont {
  color: #e64211;
  display: inline-block;
  overflow: hidden;
  line-height: 80rpx;
  width: 40rpx;
}
.notice>.content {
  color: #ee2929;
  white-space: nowrap;
  font-size: 20rpx;
  height: 80rpx;
  line-height: 80rpx;
  width: 660rpx;
  display: inline-block;
  overflow: hidden;
}
.notice_text {
  position: relative;
  font-size: 30rpx;
}
.huakuai {
  width: 100%;
  white-space: nowrap;
}
pages/applyRefund/applyRefund.js
New file
@@ -0,0 +1,302 @@
var util = require('../../utils/util.js');
Page({
  data: {
    refundList: [],
    key:0,
    refundchoice:false,
    goodsList:[],
    refundSelect:'',
    status:0, //退款类型(1:退款,2:退货退款)
    // content:'',
    money:'', //退款金额
    show:true,
    getBack:'',
    // hint:'对于本产品退款说明……',
    textContent:"",
    orderStatus:""
  },
  onLoad: function (options) {
    var getBack = options.getBack
    var goodsList = util.getOutStorage("model");
    var status = options.status;
    var orderStatus = options.orderStatus;
    console.log(options.orderStatus)
    this.setData({
      goodsList: goodsList,
      status: status,
      getBack: getBack,
      orderStatus: orderStatus,
      show:true
    })
    this.getMoney(goodsList[0].orderId);
    this.getCause()
  },
  refundChange(e) {
  },
  refund(e) {
    var _this = this;
    var value = e.currentTarget.dataset.name;
    var index = e.currentTarget.dataset.index;
    var refundList = _this.data.refundList;
    var key = _this.data.key;
    var changed = {};
    for (var i = 0; i < this.data.refundList.length; i++) {
      if (i == index) {
        changed['refundList[' + i + '].checked'] = true;
      } else {
        changed['refundList[' + i + '].checked'] = false
      }
    }
    _this.setData(changed)
    _this.setData({
      key: index,
      refundchoice: false,
      refundSelect: value,
      show: true
    })
  },
    cancelStore(e) {
    var _this = this;
    var value = e.currentTarget.dataset.storename;
    var index = e.currentTarget.dataset.index;
    var addressArray = _this.data.addressArray;
    var changed = {};
    for (var i = 0; i < this.data.addressArray.length; i++) {
      if (i == index) {
        changed['addressArray[' + i + '].checked'] = true;
      } else {
        changed['addressArray[' + i + '].checked'] = false
      }
    }
    _this.setData(changed)
    _this.setData({
      key: index,
      choice: false,
      selected: value,
      isShow: false,
      storeId: e.currentTarget.dataset.storeid
    })
  },
  //退款原因显示
  refundExplain(e){
    this.setData({
      refundchoice: true,
      show:false,
      // hint:''
    })
  },
  //弹窗隐藏
  popupTap(e){
    this.setData({
      refundchoice: false,
      // hint: '对于本产品退款说明……',
      show:true
    })
  },
  // 提交
  commit(){
    var _this = this;
    var refundCause = _this.data.refundSelect;
    var orderId = _this.data.goodsList[0].orderId;
    var refundMoney = _this.data.money;
    var refundType = _this.data.status;
    var orderStatus = _this.data.orderStatus;
    var textContent = _this.data.textContent;
    console.log(_this.data.goodsList)
    // 判断退款原因是否填写
    if (this.data.refundSelect == ''){
      wx.showToast({
        title: "请填写退款原因",
        icon: "none"
      });
      return;
    }
      wx.showModal({
        title: '提示',
        content: '确定提交退款信息吗?',
        success: function (sm) {
          if (sm.confirm) {
            util.request({
              method:'POST',
              api: "/wxapi/RefundRecord/saveRefundRecord",
              data: { "orderId": orderId, "refundCause": refundCause, "refundMoney": refundMoney, "remarks": textContent, "refundType": refundType },
              callback: function (data) {
              // console.log(refundType)
              console.log(orderStatus)
              if (data.status == 200 && orderStatus == 3) {
                wx.showModal({
                  title: '提示',
                  content: '您的退款已经提交请等待客服审核!',
                  success: function (sm) {
                    let pages = getCurrentPages();//当前页面
                    let prevPage = pages[pages.length - 2];//上一页面
                    var getBack = _this.data.getBack;
                    // 判断是否从详情进入
                    if (getBack == '1') {
                      prevPage = pages[pages.length - 3];
                    }
                    prevPage.setData({//直接给上移页面赋值
                      refresh: true
                    });
                    if (sm.confirm) {
                      if (getBack == '1'){
                        wx.navigateBack({
                          delta: 2
                        })
                      } else {
                        wx.navigateBack({
                          delta: 1
                        })
                      }
                    } else if (sm.cancel) {
                      if (getBack == '1') {
                        wx.navigateBack({
                          delta: 2
                        })
                      } else {
                        wx.navigateBack({
                          delta: 1
                        })
                      }
                    }
                  }
                })
              }else{
                wx.showModal({
                  title: '提示',
                  content: '订单取消成功',
                  success: function (sm) {
                    let pages = getCurrentPages();//当前页面
                    let prevPage = pages[pages.length - 2];//上一页面
                    var getBack = _this.data.getBack;
                    // 判断是否从详情进入
                    if (getBack == '1') {
                      prevPage = pages[pages.length - 3];
                    }
                    prevPage.setData({//直接给上移页面赋值
                      refresh: true
                    });
                    if (sm.confirm) {
                      if (getBack == '1') {
                        wx.navigateBack({
                          delta: 2
                        })
                      } else {
                        wx.navigateBack({
                          delta: 1
                        })
                      }
                    } else if (sm.cancel) {
                      if (getBack == '1') {
                        wx.navigateBack({
                          delta: 2
                        })
                      } else {
                        wx.navigateBack({
                          delta: 1
                        })
                      }
                    }
                  }
                })
              }
            }});
          } else if (sm.cancel) {
          }
        }
      })
  },
  // 数据绑定搜索框
  formName (e) {
    this.setData({
      textContent: e.detail.value
    })
  },
  bindTextAreaBlur(event) {
    var value = event.detail.value;
    this.setData({
      textContent: value,
    });
  },
  // 获取退款金额
  getMoney: function (id) {
    var _this = this;
    util.request({
      api: "/wxapi/RefundRecord/getRefundMoneyByOrderId/" + id,
      callback: function (data) {
      _this.setData({
        money: data.rows[0].refundMoney,
      });
    }});
  },
  // 查询退款原因
  getCause(){
    var _this = this;
    util.request({
      api: "/wxapi/RefundRecord/findRefundReason",callback: function (data) {
      _this.setData({
        refundList: data.rows
      });
      var changed = {};
      for (var i = 0; i < _this.data.refundList.length; i++) {
        if (i == 0) {
          changed['refundList[' + i + '].checked'] = true;
        } else {
          changed['refundList[' + i + '].checked'] = false
        }
      }
      _this.setData(changed)
    }});
  },
  // 进入商品页面
  intoGoods(e) {
    var id = e.currentTarget.dataset.id
    var status = e.currentTarget.dataset.status;
    var delflag = e.currentTarget.dataset.delflag;
    if (status == 2 || delflag == 1) {
      wx.showToast({
        title: "商品已失效",
        icon: "none"
      });
    } else {
      wx.navigateTo({
        url: '../service/details?id=' + id
      })
    }
  }
})
pages/applyRefund/applyRefund.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "申请退款"
}
pages/applyRefund/applyRefund.wxml
New file
@@ -0,0 +1,69 @@
<view class="main">
  <view class="refund-container">
      <view class='refund-top radius refund-list'>
       <view wx:for="{{goodsList}}" wx:key="ids" data-id="{{item.productId}}" data-status="{{item.status}}" data-delflag="{{item.delflag}}"  bindtap="intoGoods">
         <image src="{{item.imgMobile}}" class='refund-image'></image>
          <view class='refund-info'>
            <text class='name'>{{item.name}}</text>
            <text class='grey'>规格:{{item.sku}}</text>
          </view>
       </view>
      </view>
      <view class='refund-content radius refund-list'>
        <view bind:tap="refundExplain">
          <view class='name'>退款原因</view>
          <text class='refundSelect grey'>{{refundSelect}}</text>
          <view class="iconfont icon-youbian"></view>
        </view>
        <view>
          <text class='name'>
            <text>退款金额</text>
            <text class='price'>¥{{money}}</text>
          </text>
        </view>
         <view class='explain'>
          <text class='name'>退款说明</text>
          <view class="textarea">
            <!-- <textarea
              class="orders-bottom-text-input radius"
              bindblur="bindTextAreaBlur"
              bindinput="formName"
              placeholder="对于本产品退款说明……"
              value='{{textContent}}'
              wx:if="{{show}}"
              show-confirm-bar=""
              fixed
              />
            <view wx:if="{{!show}}" class="orders-bottom-text-input radius">{{textContent}}</view> -->
            <input class='orders-bottom-text-input radius' bindchange="bindTextAreaBlur" type='text' placeholder='对于本产品退款说明……'></input>
          </view>
        </view>
      </view>
    </view>
    <cover-view class='btn-area' bindtap='commit'>
      提交
    </cover-view>
<view class='popup-container'   wx:if="{{refundchoice}}">
  <view  class="popup" bind:tap="popupTap"></view>
  <view class='refund-explain'>
    <view class='name'>退款原因</view>
    <radio-group class="radio" bindchange="refundChange">
      <view class='label-2 {{key==index?"active":""}}' wx:for="{{refundList}}" bindtap="refund" wx:key="ids"
        data-index="{{index}}"
        data-id="{{item.id}}"
        data-name="{{item.value}}"
      >
        <label>
        <radio id="{{item.value}}"  value="{{item.value}}" checked="{{item.checked}}" hidden></radio>
        <view class='label-2__icon'>
            <view class="icon-checked" style="opacity:{{item.checked ? 1 : 0}}"></view>
        </view>
        <label class="value" for="{{item.value}}"><text>{{item.value}}</text></label>
      </label>
      </view>
    </radio-group>
  </view>
</view>
</view>
pages/applyRefund/applyRefund.wxss
New file
@@ -0,0 +1,194 @@
.refund-image {
  width: 120rpx;
  height: 80rpx;
}
.refund-container {
  padding-top: 20rpx;
}
.refund-list {
  background: #fff;
  margin: 0 20rpx 10rpx 20rpx;
}
.refund-content>view {
  display: flex;
  line-height: 80rpx;
  padding: 0 30rpx;
}
.iconfont {
  margin-top: 3rpx;
  color: #cacaca;
}
.name {
  white-space: nowrap;
  width: 30%;
}
.refund-top>view {
  padding: 30rpx;
  display: flex;
}
.refund-info>text {
  display: block;
  margin-left: 21rpx;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}
.refund-info{
  width: 76%;
}
.refund-info .grey {
  margin-top: 6rpx;
}
.orders-bottom-text-input {
  width: 91%;
  height: 30rpx;
  font-size: 26rpx;
  padding: 21rpx;
  line-height: 30rpx;
  overflow-y: hidden;
  text-align: right
}
.btn-area {
  width: 100%;
  height: 106rpx;
  line-height: 106rpx;
  position: fixed;
  bottom: 0;
  background: #ff5806;
  color: #fff;
  text-align: center;
  font-size: 36rpx;
}
.price {
  margin-left: 10rpx;
}
.refund-explain {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 688rpx;
  background: #fff;
  border-radius: 10px 10px 0px 0px;
}
.refund-explain text {
  font-size: 26rpx;
}
/* page{
  background-color: skyblue!important
} */
.choice {
  width: 686rpx;
  margin: auto;
  color: #999;
  display: flex;
  align-items: center;
  padding-top: 28rpx;
}
.choice .title {
  width: 96%;
  display: block;
}
.icon-quxiao {
  font-size: 38rpx;
}
.label-2 {
  font-size: 30rpx;
  line-height: 80rpx;
  border-bottom: 1rpx solid #eaeaea;
  margin-left: 10rpx
}
.label-2__icon {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 30rpx;
  height: 30rpx;
  border-radius: 50%;
  border: 1px solid #999;
  left: 88%;
}
.icon-checked {
  background-image: url(http://file.micromall.xczhyf.cn/wxxcx/image/20.png);
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
}
.active .label-2__icon {
  background: #00c085;
  border: none;
}
radio-group {
  height: 500rpx;
  overflow-y: scroll;
  margin-top: 29rpx;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  padding: 30rpx 0;
  height: 500rpx;
  overflow-y: hidden
}
.coupons-container{margin: 0;position: relative}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons .money::after{
left: 280rpx;
}
.coupons-list .coupons-container:last-child{padding-bottom: 106rpx}
.refund-explain .name{
  text-align: center;
  margin-top: 30rpx;
  width: 100%
}
.refundSelect{font-size: 26rpx;width: 70%;text-align: right}
/* button {
  line-height: 106rpx;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  font-size: 30rpx;
  padding-left: 0;
  padding-right: 0;
  color: #333;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden
}
.button-hover{
  /* color:#fff; */
  /* background-color: rgba(0,0,0,0);
}
button:after {
  border: 0px;
  color: #333;
} */
.popup{
  background: rgba(0,0,0,0.8)
}
.main{padding-bottom: 106rpx}
.textarea{width: 70%}
pages/article/article.js
New file
@@ -0,0 +1,84 @@
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    article:{}
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options);
    var _this=this;
    util.request({
      api: api.article.findArticById+options.id,
      mask:true,
      callback:function(data){
        data.rows[0].artContent=data.rows[0].artContent.replace(/<img /g, '<img class="rich_img" ');
        _this.setData({
          article: data.rows[0]
        });
        wx.setNavigationBarTitle({
          title: data.rows[0].artTitle
        })
      }
    });
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/article/article.json
New file
@@ -0,0 +1,7 @@
{
  "navigationBarBackgroundColor": "#ffffff",
  "navigationBarTextStyle": "black",
  "navigationBarTitleText": "",
  "backgroundColor": "#ffffff",
  "backgroundTextStyle": "light"
}
pages/article/article.wxml
New file
@@ -0,0 +1,2 @@
 <rich-text  class='pd-10'  nodes="{{article.artContent}}" bindtap="tap"></rich-text>
pages/article/article.wxss
New file
@@ -0,0 +1,11 @@
page{
  background: #fff;
}
.rich_img{
  max-width: 100%;
  margin: 0px;
}
rich-text p{
  padding: 5px;
}
pages/checkRecord/recordInfo.js
New file
@@ -0,0 +1,136 @@
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    record:{},
    isActive:1
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this = this;
    util.request({
      api:api.checkInfo.findById+"/"+options.id,
      callback: function(data) {
        console.log(data);
        _this.setData({
          record: data.rows[0],
          vipInfo:data.mapInfo.vipInfo
        });
      }
    });
  },
  /**
   * 跳转产品详情页面
   */
  goProduct(e){
      // 进入详情
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var service = e.currentTarget.dataset.service;
    if (service == 1) {
      this.checkUserInfoIsBuding()
      var index = e.currentTarget.dataset.index;
      var idx = e.currentTarget.dataset.idx;
      var product = this.data.record.skinDetails[index].shopProducts[idx];
      wx.setStorageSync('chooseService', product);
      wx.switchTab({
        url: '/pages/yuyue/khyuyue'
      });
    } else {
      wx.navigateTo({
        url: '/pages/service/details?id=' + id,
      })
    }
  },
    //检查用户信息是否绑定
    checkUserInfoIsBuding() {
      if (util.isBlank(getApp().userInfo.nickName)) {
        wx.navigateTo({
          url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
        })
      } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
        wx.navigateTo({
          url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
        })
      }
    },
  /**
   * 修改tab选项卡
   */
  changeTab(e){
    var index = e.currentTarget.dataset.index;
    this.setData({
      isActive:index,
    });
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/checkRecord/recordInfo.json
New file
@@ -0,0 +1,7 @@
{
  "navigationBarBackgroundColor": "#ffffff",
  "navigationBarTextStyle": "black",
  "backgroundColor": "#ffffff",
  "backgroundTextStyle": "light",
  "navigationBarTitleText": "皮肤检测记录"
}
pages/checkRecord/recordInfo.wxml
New file
@@ -0,0 +1,84 @@
<scroll-view>
    <view class="content_box" wx:if="{{isActive==1}}">
        <view class="img_box">
            <image class="main_img" src="{{record.ext1}}"></image>
            <text class="text">
    姓名:{{vipInfo.vipName}}   性别:{{vipInfo.sex}}
    </text>
            <text  class="text gray">
     生成日期 :{{record.createTime}}
    </text>
        </view>
        <view class="content_item">
            <text class="title" >AI 诊断结果(平均概率)</text>
            <text class="percentage" wx:for="{{record.analysisDetail}}" wx:key="ids" >
      <text  class="percentage_doc" ></text> {{item.symptom}}:{{item.percentage}}%
            </text>
        </view>
        <view class="content_item">
            <text class="title" >问题分析</text>
            <view wx:for="{{record.analysisDetail}}" class="qustion_box">
                <image mode="aspectFit" src="{{item.img}}"></image>
                <view class="qustion_content_box">
                    <text class="littel-title" >{{item.symptom}}</text>
                    <view class="item_box">
                        <text class="bold"  >症状描述:</text>
                        <text>{{item.analysis}}</text>
                    </view>
                </view>
            </view>
        </view>
    </view>
    <view class="content_box" wx:if="{{isActive==2}}">
        <view wx:for="{{record.skinDetails}}" class="qustion_annasy">
            <view class="title2"> {{item.symptom}} </view>
            <text class="title" >症状描述:</text>
            <view class="item_box2">
                <text>{{item.analysis}}</text>
            </view>
            <text class="title" >护理建议:</text>
            <view class="item_box2">
                <text>{{item.solution}}</text>
            </view>
            <text class="title" >建议使用产品:</text>
            <view class="item_box2">
                <view class="itemBox" wx:for="{{item.shopProducts}}" wx:for-index="idx" wx:for-item="product"
          bindtap="goProduct"
          data-id='{{product.id}}'
           data-service="{{product.isService}}"
           data-idx="{{idx}}"
            data-index="{{index}}">
                    <text class="iconfont icongouwudaidaizishangcheng" ></text>
                    <text class="product" >{{product.title}}</text>
                </view>
            </view>
        </view>
    </view>
    <view class="content_item">
        <view class="btn_box">
            <view bindtap="changeTab" data-index="1" class="left_btn btn {{isActive==1?'active':''}} ">问题分析</view>
            <view bindtap="changeTab" data-index="2" class="right_btn btn {{isActive==2?'active':''}} ">解决方案</view>
        </view>
    </view>
</scroll-view>
pages/checkRecord/recordInfo.wxss
New file
@@ -0,0 +1,180 @@
page{
  background: #fff;
}
.rich_img{
  max-width: 100%;
  margin: 0px;
}
rich-text p{
  padding: 5px;
}
.content_box{
  border-radius: 5rpx;
  margin: 20rpx;
  box-shadow: 0px 0px 5rpx 5rpx rgba(107, 107, 107, 0.2);
  padding-bottom: 50rpx;
}
.img_box{
  text-align: center;
}
.main_img{
  width: 200rpx;
    height: 200rpx;
    display: inline-block;
    border-radius: 100rpx;
    margin: 20rpx auto;
}
.text{
  line-height: 15rpx;
margin: 0rpx;
height: 43rpx;
display: block;
}
.content_item{
  margin-top:40rpx ;
}
.gray{
  color: #939393;
  font-size: 25rpx;
}
.title{
  display: block;
  border-left: 10rpx solid #000;
  width: 400rpx;
  margin-left: 20rpx;
  text-indent: 20rpx;
  font-weight: bold;
  height: 40rpx;
  overflow: hidden;
  line-height: 40rpx;
}
.percentage{
   margin-top:30rpx ;
   margin-left: 50rpx;
   display: inline-block;
}
.percentage_doc{
  width: 10rpx;
  height: 10rpx;
  background: #EF8B90;
  border-radius: 5rpx;
  display: inline-block;
}
.qustion_box{
  border-radius: 5rpx;
  border:1px solid #efefef;
  margin:20rpx auto;
  height: 210rpx;
  width: 650rpx;
  padding: 10rpx;
  display: flex;
  justify-content:space-around;
}
.qustion_box image{
  width: 180rpx;
  height: 200rpx;
}
.qustion_content_box{
  width: 500rpx;
  margin-left: 10rpx;
}
.littel-title{
  display: block;
border-left: 5rpx solid #6ACEDD;
width: 400rpx;
margin-left: 20rpx;
text-indent: 10rpx;
font-weight:bold;
height: 30rpx;
overflow: hidden;
font-size: 25rpx;
}
.bold{
  font-weight: bold;
}
.item_box{
  margin-left: 30rpx;
  margin-top: 10rpx;
  height: 135rpx;
  overflow: hidden;
}
.item_box text{
  font-size: 20rpx;
  display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.btn_box{
  width: 500rpx;
  margin: 20rpx auto;
  display: flex;
}
.btn{
  width: 250rpx;
  height: 80rpx;
  border: 3rpx solid #6ACEDD;
  text-align: center;
  line-height: 80rpx;
  font-size: 30rpx;
}
.left_btn{
  border-right:none;
  border-radius: 40rpx 0 0 45rpx;
}
.right_btn{
  border-left:none;
  border-radius: 0rpx  45rpx  45rpx 0rpx;
}
.active{
  background-color: #6ACEDD;
  color: #ffffff;
}
.qustion_annasy{
}
.title2{
  text-align: center;
  font-size: 40rpx;
  height: 80rpx;
  border-bottom: 1rpx solid #efefef;
  line-height: 80rpx;
  width: 80%;
  margin: 20rpx auto;
  color: #6ACEDD;
  font-weight: bold;
}
.item_box2{
  margin-left: 30rpx;
  margin-bottom: 20rpx;
  border-bottom: 1rpx solid #efefef;
  padding: 30rpx;
  color: #666666;
}
.product{
  margin-left: 10rpx;
}
.itemBox{
  height: 80rpx;
}
pages/checkRecord/recordList.js
New file
@@ -0,0 +1,113 @@
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    recordList: []
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var _this = this;
    util.request({
      api: api.checkInfo.recordList,
      data: {
        limit: 1000,
        offset: 0
      },
      callback: function(data) {
        console.log(data);
        _this.setData({
          recordList: data.rows,
        });
      }
    });
  },
  openLocation: function(e) {
  },
  call: function(e) {
  },
  chooseThis: function(e) {
    var index = e.currentTarget.dataset.index;
    var record=this.data.recordList[index];
    wx.navigateTo({
      url: '/pages/checkRecord/recordInfo?id='+record.id,
    });
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {
  }
})
pages/checkRecord/recordList.json
New file
@@ -0,0 +1,4 @@
{
  "usingComponents": {},
  "navigationBarTitleText": "皮肤检测记录"
}
pages/checkRecord/recordList.wxml
New file
@@ -0,0 +1,7 @@
<view class="info" bindtap="chooseThis" data-index="{{index}}"   wx:for="{{recordList}}" >
  <view class="shopName">皮肤检测记录</view>
  <view class="adds">检测人:{{item.checkUserName}}</view>
  <view class="adds">检测时间:{{item.checkTime}}</view>
</view>
pages/checkRecord/recordList.wxss
New file
@@ -0,0 +1,43 @@
.info{
  margin-top: 5px;
  padding: 20rpx;
  background: #ffffff;
}
.adds{
  font-size: 12px;
  color: #aeaeae;
  margin-top: 5px;
}
.footInfo{
  height: 40px;
  overflow: hidden;
  text-align: center;
   color: #aeaeae;
   font-size: 12px;
   line-height: 40px;
}
.tel{
  width: 49%;
  float: left;
  height: 40px;
  border-right: 1px solid #efefef;
}
.addnav{
 width: 50%;
 height: 40px;
  float: left;
}
.iconfont{
  line-height: 45px;
  margin-right: 10px;
}
pages/customerCenter/customerCenter.js
New file
@@ -0,0 +1,117 @@
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  data: {
    userInfo: {},
    hasName: false,
  },
  onLoad: function(options) {
    var _this = this
    var userInfo = getApp().userInfo;
    this.setData({
      userInfo: userInfo,
    });
    //判断用户名称是否已经授权
    if (util.isNotBlank(userInfo.nickName)) {
      this.setData({
        hasName: true,
      });
    }
    this.getOrderStatusCount();
  },
  /**
   * 获取订单数量
   */
  getOrderStatusCount(){
    var _this=this;
    util.request({
      method:'GET',
      api: api.order.getOrderStatusCount,
      callback: function (data) {
         let rows=data.rows;
         for(let i=0; i<rows.length ; i++){
           if (rows[i].orderStatus==1){
             _this.setData({ 'WAIT_PAY': rows[i].count });
           } else if (rows[i].orderStatus == 2) {
             _this.setData({ 'WAIT_SEND': rows[i].count });
           } else if (rows[i].orderStatus == 3) {
             _this.setData({ 'WAIT_RECEIVE': rows[i].count });
           } else if (rows[i].orderStatus == 6) {
             _this.setData({ 'APPLY_MONEYBACK': rows[i].count });
           }
         }
      },
    });
  },
  onShow: function() {
    var _this = this;
  },
  //登录
  login:function(){
    wx.navigateTo({
      url: '/pages/welcome/welcome?url=/pages/customerCenter/customerCenter',
    })
  },
    myCollect(e){
        wx.navigateTo({
            url: '/pages/yuyue/order?status=0',
        })
    },
  onStatusEvent(e) {
    var status = e.currentTarget.dataset.status;
    wx.navigateTo({
      url: '../order/order?status=' + status,
    })
  },
  addressJumpEvent(e) {
    wx.navigateTo({
      url: '../editAddress/editAddress',
    })
  },
  checkRecord(){
    wx.navigateTo({
      url: '/pages/checkRecord/recordList',
    })
  },
  refundStatus(e) {
    wx.navigateTo({
      url: '../refundOrder/refundOrder',
    })
  },
  // 查看个人信息
  lookUserInfo() {
    wx.navigateTo({
      url: '../personalInfo/personalInfo',
    })
  },
  // 进入我的优惠券
  intoCoupon() {
    wx.navigateTo({
      url: '../customerCoupons/customerCoupons',
    })
  },
})
pages/customerCenter/customerCenter.json
New file
@@ -0,0 +1,6 @@
{
  "navigationBarTitleText":"个人中心",
  "navigationBarBackgroundColor": "#00C085",
  "backgroundTextStyle": "light",
  "navigationBarTextStyle":"white"
}
pages/customerCenter/customerCenter.wxml
New file
@@ -0,0 +1,106 @@
<view class="user_container">
  <view class="user_header">
    <view>
      <image src='/image/bg.png' class='gbg'></image>
    </view>
    <view class="bg">
      <view class="user_box">
        <block wx:if="{{hasName}}">
          <view bindtap="lookUserInfo">
            <image class='avatarUrl' src='{{userInfo.avatarUrl}}'></image>
            <text class="user_name">{{userInfo.nickName}}</text>
          </view>
          <view class="modify_info" bindtap="lookUserInfo">
            <text>查看个人信息</text>
            <view class="iconfont icon-youbian"></view>
          </view>
        </block>
        <block wx:if="{{!hasName}}" >
          <view class="btn" bindtap="login" >登录授权</view>
        </block>
        <view class="user_order">
          <view class="wait_pay wait" bindtap="onStatusEvent" data-status="1">
            <text class="carts-icon-num" wx:if="{{WAIT_PAY>0}}" >{{WAIT_PAY}}</text>
            <image src='/image/qb.png' class='order-pay'></image>
            <text>待付款</text>
          </view>
          <view class='wait_delivery wait' bindtap="onStatusEvent" data-status="2">
          <text class="carts-icon-num" wx:if="{{WAIT_SEND>0}}" >{{WAIT_SEND}}</text>
            <image src='/image/fh.png' class='order-delivery'></image>
            <text>待配送</text>
          </view>
          <view class='wait_goods wait' bindtap="onStatusEvent" data-status="3">
          <text class="carts-icon-num" wx:if="{{WAIT_RECEIVE>0}}" >{{WAIT_RECEIVE}}</text>
            <image src='/image/gwc.png' class='order-goods'></image>
            <text>待收货</text>
          </view>
          <view class="refund wait" bindtap="refundStatus" data-status="3">
          <text class="carts-icon-num" wx:if="{{APPLY_MONEYBACK>0}}" >{{APPLY_MONEYBACK}}</text>
            <image src='/image/tc.png' class='order-refund'></image>
            <text>退款</text>
          </view>
        </view>
      </view>
    </view>
  </view>
  <view class='section'>
    <view class="collected form_groun" bindtap='myCollect'>
      <view class="iconfont iconshijian"></view>
      <text>我的预约</text>
      <view class="iconfont iconright"></view>
    </view>
   <view class="form_groun coupon" bindtap='intoCoupon' >
      <view class='iconfont iconyouhuiquan'></view>
      <text>我的优惠券</text>
      <view class="iconfont iconright"></view>
    </view>
     <view class="form_groun" bindtap='checkRecord'>
      <view class="iconfont iconxiangmu"></view>
      <text>检测记录</text>
      <view class=" iconfont iconright"></view>
    </view>
  <!--
    <view class="form_groun coupon" bind:tap="integral" wx:if="{{userInfo.userVip ==1}}">
      <view class='iconfont icon-wodejifen'></view>
      <text>我的积分</text>
      <view class="iconfont iconright"></view>
    </view>
    <view class="form_groun coupon" wx:if="{{userInfo.userVip ==1}}" bind:tap="myWallet">
      <view class='iconfont icon-credit1'></view>
      <text>积分兑换</text>
      <view class="iconfont iconright"></view>
    </view>-->
    <view class="address form_groun" bindtap='addressJumpEvent'>
      <view class="iconfont iconlocation1"></view>
      <text>收货地址</text>
      <view class="iconfont iconright"></view>
    </view>
    <view class='service form_groun'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          <text>在线客服</text>
          <view class="iconfont iconright"></view>
        </button>
      </view>
    </view>
    <!-- <view class=" form_groun" bind:tap="commonQuestion">
      <view class="iconfont icon-wenti-m"></view>
        常见问题
      <view class="iconfont icon-youbian"></view>
    </view> -->
    <view class="question">
      <block wx:for="{{questionList}}" wx:key="ids">
        <view class="form_groun question-container" data-artypeid="{{item.artypeId}}" bind:tap="questionEvent">
          <image src='{{item.artypeImgurl}}' class='qusetion-image'></image>
          <text class='threeblack'>{{item.artypeName}}</text>
          <view class='iconfont icon-youbian'></view>
        </view>
      </block>
    </view>
  </view>
</view>
pages/customerCenter/customerCenter.wxss
New file
@@ -0,0 +1,302 @@
/* @import "../../icon/iconfont.wxss";
@import "../../common/css/common.wxss"; */
.user_header {
  position: relative;
}
.bg {
  position: absolute;
  /* height: 378rpx; */
  width: 90%;
  left: 50%;
  top: 100%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.gbg {
  width: 100%;
  height: 356rpx;
}
.user_box {
  height: 378rpx;
  background: #fff;
  margin: auto;
  box-shadow:0rpx 17rpx 37rpx 1rpx rgba(133,133,133,0.23);
  border-radius: 20rpx;
}
.avatarUrl{
  width: 116rpx;
  height: 116rpx;
  border-radius: 50%;
}
.user_name {
  display: block;
  color: #414141;
  font-size: 34rpx;
  margin: 20rpx 0;
}
.avatarUrl {
  margin-top: -70rpx;
}
.modify_info {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bcbcbc;
  font-size: 26rpx;
  margin-left: 10rpx
}
.modify_info .iconright {
  width: auto;
}
.form_groun {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 10rpx solid #f7f7f7;
  padding: 12rpx 0;
  color: #333;
  padding-left: 40rpx;
  font-size: 30rpx;
  box-sizing: border-box;
  height: 100rpx;
}
.form_groun text {
  white-space: nowrap;
  width: 20%;
  /* border: 1px solid red; */
}
.quest-groun {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #f7f7f7;
  padding: 25rpx 0;
  color: #414141;
  padding-left: 40rpx;
  font-size: 30rpx;
  box-sizing: border-box;
  flex-direction: column;
}
.section .iconfont {
  margin-right: 15rpx;
  font-size: 40rpx;
}
.iconright {
  width: 67%;
  text-align: right;
  margin-top: 6rpx;
  color: #cacaca;
}
.icon-soucang {
  color: #fa4987;
}
.icon-fapiao {
  color: #49fadb;
}
.icon-dizhi {
  color: #fab949;
}
.icon-kefu1 {
  color: #768bfa;
}
.icon-wenti-m {
  color: #49b4fa;
}
.icon-31gouwuquan {
  color: #ff0b0b;
}
.icon-wodejifen{
  color: #D4237A
}
.icon-credit1{
  color: #00C085
}
.border-bottom {
  padding: 20rpx 0;
  background: #f7f7f7;
  width: 100%;
}
.section {
  padding-top: 210rpx;
}
.user_order {
  display: flex;
  margin-top: 50rpx;
  vertical-align: middle
}
.user_order>view {
  text-align: center;
}
.user_order>view {
  flex: 1;
}
.user_order .iconfont {
  /* 文字渐变 */
  background-image: -webkit-linear-gradient(180deg, rgba(21, 214, 155, 1), rgba(9, 164, 111, 1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wait{
  position:relative;
}
.user_order .wait .iconfont {
  font-size: 46rpx;
}
.user_order .wait text {
  margin-top: 17rpx;
}
.icon-huoche {
  font-size: 60rpx;
}
.icon-tuikuan {
  font-size: 65rpx;
}
.user_order text {
  font-size: 26rpx;
  color: #666;
}
.refund text {
  margin-top: 15rpx;
}
.user_order text {
  display: block;
}
button {
  line-height: 49rpx;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  font-size: 30rpx;
  padding-left: 0;
  padding-right: 0;
  color: #333;
}
button:after {
  border: 0px;
  color: #333;
}
.service {
  padding: 0;
  position: relative;
  width: 94%;
   height: 100rpx;
  padding-left: 40rpx;
  box-sizing: border-box;
}
.contact_list {
  width: 100%;
  position: absolute;
  height: 100%;
  z-index: 100;
  overflow: hidden;
  display: flex;
  white-space: nowrap;
  color: #333;
}
.button-hover {
  background-color: #fff;
  color: #333;
}
.contact_list .iconright {
  width: 69%;
}
.qusetion-image {
  width: 40rpx;
  height: 40rpx;
  margin-right: 15rpx;
  margin-top: 2rpx;
  /* margin-left: 5rpx; */
}
.question .iconright {
  width: 66%;
  text-align: right;
}
.question-container{
  padding: 15rpx 0;
  padding-left: 40rpx
}
.order-pay{width: 46rpx;height: 49rpx}
.order-delivery{width: 50rpx;height: 49rpx}
.order-goods{width: 60rpx;height: 49rpx}
.order-refund{width: 49rpx;height: 49rpx}
.user_order image{
 vertical-align: middle;
}
.contact_list text{margin-left: -12rpx;margin-top: 4rpx}
.btn{
width: 30%;
background-color: #00c085;
border-radius: 6px;
height: 30px;
margin: 10px auto;
border: 1px solid #00c085;
color: #fff;
text-align: center;
line-height: 30px;
top: 10px;
position: relative;
}
.carts-icon-num {
position: absolute;
left: 21px;
width: 28rpx;
height: 28rpx;
line-height: 27rpx;
top: -30rpx;
border-radius: 50%;
background: #f00;
color: #fff !important;
font-size: 18rpx !important;
text-align: center;
}
pages/customerCoupons/customerCoupons.js
New file
@@ -0,0 +1,165 @@
var util = require('../../utils/util.js');
const app=getApp();
Page({
  data: {
    couponsList:['待使用','已使用','已失效'],
    key:0,
    status: 2,  //1=已使用 2=未使用 3=过期
    text: [   ],
    isUsedCoupon:[],  // 已使用
    unUsedCoupon: [], // 待使用
    loseCoupon: [],  // 已失效
    couponShow:false,
    limit : 6,
    offset: 0,
    check:0 // 用来判断选择的下标
  },
  onLoad: function (options) {
    this.getCouponsList(1)
    this.getCouponsList(2)
    this.getCouponsList(3)
    this.goTap();
  },
  //一键回到顶部
  goTap() {
    util.goTap();
  },
  //获取滚动条当前位置
  onPageScroll: function (e) {
    // console.log(e)
    if (e.scrollTop > 400) {
      this.setData({
        floorstatus: true
      });
    } else {
      this.setData({
        floorstatus: false
      });
    }
  },
  // 选择优惠券类型
  coupons(e){
    var index = e.currentTarget.dataset.index;
    var status = 0;
    console.log(index);
    if (index == 0){
      status = 2
    } else if(index == 1){
      status = 1
    }else if (index == 2) {
      status = 3
    }
    this.setData({
      offset:0,
      key:index,
      status: status
    })
  },
  // 获取优惠券列表
  getCouponsList:function(status){
    var _this = this;
    var limit = _this.data.limit
    var offset = _this.data.offset
    util.request({
      method:"POST",
      api:"/wxapi/shopCoupon/getMyCouponInfoByStatus/"+app.shopInfo.id+"/"+status,
      data: {"limit":limit, "offset":offset},
      callback: function (data) {
      if (data.status == '200') {
        for (var i = 0; i < data.rows.length; i++){
          data.rows[i].endTimeWx = data.rows[i].endTimeWx.substring(0, 10);
        }
        if (status == 2){
          _this.setData({
            unUsedCoupon: data.rows
          })
        } else if (status == 1) {
          _this.setData({
            isUsedCoupon: data.rows
          })
        } else {
          _this.setData({
            loseCoupon: data.rows
          })
        }
      }
    }});
  },
  // 上拉加载
  onReachBottom: function () {
    var _this = this;
    var offset = _this.data.offset;
    var limit = _this.data.limit;
    var couponList = _this.data.unUsedCoupon;
    var status = _this.data.status
    if (status == 2) {
      couponList = _this.data.unUsedCoupon;
    } else if (status == 1) {
      couponList = _this.data.isUsedCoupon;
    } else {
      couponList = _this.data.loseCoupon;
    }
    _this.setData({
      offset: offset + limit
    });
    offset = _this.data.offset;
    util.request({
      method:"POST",
      api: "/wxapi/shopCoupon/getMyCouponInfoByStatus/" + status,
      data:{ "limit": limit, "offset": offset },
      callback:function (data) {
      for (var i = 0; i < data.rows.length; i++) {
        data.rows[i].endTimeWx = data.rows[i].endTimeWx.substring(0, 10);
        couponList.push(data.rows[i])
      }
      if (status == 2) {
        _this.setData({
          unUsedCoupon: couponList
        })
      } else if (status == 1) {
        _this.setData({
          isUsedCoupon: couponList
        })
      } else {
        _this.setData({
          loseCoupon: couponList
        })
      }
    }});
  },
//使用优惠券
  useCoupon(e){
    var coupon = e.currentTarget.dataset.coupon;
    wx.setStorageSync("queryKey", coupon);
    wx.switchTab({
      url: '/pages/service/service2',
    });
  },
})
pages/customerCoupons/customerCoupons.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "我的优惠券"
}
pages/customerCoupons/customerCoupons.wxml
New file
@@ -0,0 +1,118 @@
<view class="main"  wx:if="{{!couponShow}}">
  <view class='coupons-tabs'>
    <block wx:for="{{couponsList}}" wx:key="ids">
      <view class='coupons-item {{key==index?"active":""}}' bind:tap="coupons" data-index="{{index}}">{{item}}</view>
    </block>
  </view>
  <view wx:for="{{unUsedCoupon}}"  data-id="{{item.id}}" wx:key="ids" class='coupons-container {{key!=0?"hide":""}}'>
    <view class='coupons counpons-list'>
      <view class="coupons-explain ">
        <text>满减券</text>
      </view>
      <view class='money'>
        <view class='money-num'>
          <text style='font-size:34rpx'>¥</text>
          <text style='font-size:60rpx'>{{item.offsetAmount}}</text>
        </view>
        <view class='money-info'>
          <text>满{{item.minAmount}}元可用</text>
        </view>
      </view>
      <view class='content'>
        <view class="content-title">{{item.cName}}</view>
        <view class='content-info'></view>
        <view class='content-time'>有效期至{{item.endTimeWx}}</view>
      </view>
      <view class='right' >
        <view class='invalid' data-coupon="{{item.cName}}" bindtap="useCoupon"  >
          <text class="qsy" >去使用</text>
        </view>
      </view>
    </view>
</view>
 <view wx:for="{{isUsedCoupon}}"  data-id="{{item.id}}" wx:key="ids" class='coupons-container {{key!=1?"hide":""}}'>
    <view class='coupons-invalid counpons-list'>
      <view class="coupons-explain ">
        <text>满减券</text>
      </view>
      <view class='money'>
        <view class='money-num'>
          <text style='font-size:34rpx'>¥</text>
          <text style='font-size:60rpx'>{{item.offsetAmount}}</text>
        </view>
        <view class='money-info'>
          <text>满{{item.minAmount}}元可用</text>
        </view>
      </view>
      <view class='content'>
        <view class="content-title">{{item.cName}}</view>
        <view class='content-info'></view>
        <view class='content-time'>{{item.endTimeWx}}</view>
      </view>
      <view class='right'>
        <view class='invalid' data-index="{{index}}" >
          <text>已使用</text>
        </view>
      </view>
    </view>
  </view>
   <view wx:for="{{loseCoupon}}"  data-id="{{item.id}}" wx:key="ids" class='coupons-container {{key!=2?"hide":""}}'>
    <view class='coupons-invalid counpons-list'>
      <view class="coupons-explain ">
        <text>满减券</text>
      </view>
      <view class='money'>
        <view class='money-num'>
          <text style='font-size:34rpx'>¥</text>
          <text style='font-size:60rpx'>{{item.offsetAmount}}</text>
        </view>
        <view class='money-info'>
          <text>满{{item.minAmount}}元可用</text>
        </view>
      </view>
      <view class='content'>
        <view class="content-title">{{item.cName}}</view>
        <view class='content-info'></view>
        <view class='content-time'>{{item.endTimeWx}}</view>
      </view>
      <view class='right'>
        <view class='invalid' data-index="{{index}}" >
          <text>已失效</text>
        </view>
      </view>
    </view>
  </view>
 <view class="toTap" bind:tap="goTap" hidden='{{!floorstatus}}' >
  <view class="iconfont icon-zhiding1"></view>
</view>
  <view class='noCounpons' wx:if="{{unUsedCoupon.length==0 && key == 0}}">
    <view class='no-counpon'>
      <image src='/image/nocoupon.png'></image>
      <text class='no-text'>暂无可用优惠券</text>
      <text class='wait-active'>关注后续活动,更多好券等您来领</text>
    </view>
  </view>
   <view class='noCounpons' wx:if="{{isUsedCoupon.length==0 && key == 1}}">
    <view class='no-counpon'>
      <image src='/image/nocoupon.png'></image>
      <text class='no-text'>暂无已使用优惠券</text>
      <text class='wait-active'>关注后续活动,更多好券等您来领</text>
    </view>
  </view>
   <view class='noCounpons' wx:if="{{loseCoupon.length==0 && key == 2}}">
    <view class='no-counpon'>
      <image src='/image/nocoupon.png'></image>
      <text class='no-text'>暂无已失效优惠券</text>
      <text class='wait-active'>关注后续活动,更多好券等您来领</text>
    </view>
  </view>
</view>
pages/customerCoupons/customerCoupons.wxss
New file
@@ -0,0 +1,115 @@
.hr {
  height: 159rpx;
  border: 1rpx solid #eee;
  float: left;
  margin-left: 20rpx;
  margin-top: 15rpx;
}
.active {
  border-bottom: 6rpx solid #00c085;
  color: #00c085;
  font-size: 30rpx;
}
.coupons-tabs {
  display: flex;
  font-size: 26rpx;
  color: #999;
  line-height: 60rpx;
  padding-top: 15rpx;
  width: 90%;
  margin: auto;
}
.coupons-container {
  position: relative;
}
.no-counpon {
  text-align: center;
  font-size: 30rpx;
}
.qsy{
font-size: 24rpx;
color: #fff;
width: 120rpx;
height: 24px;
margin-top: 40rpx;
background: #00c085;
display: inline-block;
line-height: 24px;
border-radius: 3rpx;
}
.no-text {
  color: #060606;
  margin-bottom: 30rpx;
  display: flex;
  justify-content: center
}
.wait-active {
  color: #969696;
}
.no-counpon image {
  width: 226rpx;
  height: 200rpx;
  margin: 200rpx 0 109rpx 0;
}
.coupons-invalid {
  background-image: url("http://file.micromall.xczhyf.cn/wxxcx/image/50.png");
  background-size: 100% 100%;
  width: 676rpx;
  height: 190rpx;
  margin-top: 10rpx;
  display: flex;
}
.invalid {
  font-size: 22rpx;
  text-align: center;
  margin-top: 30rpx;
  margin-right: 30rpx;
  width: 110rpx;
  height: 38rpx;
  line-height: 38rpx;
  color: #999;
}
.main {
  padding-bottom: 20rpx;
}
.coupons-tabs>view {
  text-align: center;
  font-size: 26rpx;
  width: 33.3%;
}
.coupons-invalid  .content-time{color: #999}
.coupons-invalid  .coupons-explain{
  font-size: 24rpx;
  color: #999;
  width: 24rpx;
  padding-top: 52rpx;
  padding-left:20rpx;
  float:left;
}
.coupons-invalid .money-info{
  color: #999;
}
.coupons-invalid .money-num{
  color: #999;
}
.coupons-invalid .content-title{
  color: #999;
}
.hide{
  display: none
}
pages/editAddress/editAddress.js
New file
@@ -0,0 +1,143 @@
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  data: {
    editAddressList: [],
    limit:10,
    offset:0,
    refresh:false,
      noMoreData:false,
      pageScen:1,//1表示个人中心,2表示订单界面
  },
  onShow: function () {
    this.setData({
      "editAddressList": [],
    });
    this.loadAddress();
  },
    //加载收货地址
    loadAddress(){
    var _this=this;
        util.request({api:api.address.queryaddress,
        data:{"limit":_this.data.limit,"offset":_this.data.offset},
        callback: function (data) {
            _this.setData({
                noMoreData: data.rows.length == 0,
                "editAddressList": _this.data.editAddressList.concat(data.rows),
            });
        }});
    },
  onLoad: function (options) {
    var _this = this;
    var pageScen = this.options.pageScen;
    _this.setData({
      "pageScen": pageScen,
    });
  },
  //一键回到顶部
  goTap() {
    util.goTap();
  },
  //删除
  onDeleteTapEvent(e) {
    var _this = this;
    var index = e.currentTarget.dataset.index;
    var id = e.currentTarget.dataset.addrid;
    wx.showModal({
      title: '提示',
      content: '确定要删除该地址吗',
      success(res) {
        if (res.confirm) {
          util.request({api:api.address.deleteladdress + '/' + id, callback: function (data) {
              var deleteAddressList = _this.data.editAddressList;
              deleteAddressList.splice(index, 1);
              if(deleteAddressList.length<1){
                  _this.setData({
                      offset:0
                  });
                  _this.loadAddress();
              }else{
                  _this.setData({
                      editAddressList: deleteAddressList,
                  });
              }
          }});
        } else if (res.cancel) {
          console.log("用户点击取消")
        }
      }
    })
  },
    //新增地址
  newAddressEvent(e) {
      wx.navigateTo({
          url: '../showAddress/showAddress',
      })
  },
  // 点击地址,如果是从订单界面进入的则返回订单界面,如果是个人中心进入的则进入编辑界面
  editAddressTap(e) {
      debugger
      if(this.data.pageScen==2){
        var address = e.currentTarget.dataset.address;
        let pages = getCurrentPages();//当前页面
        let prevPage = pages[pages.length - 2];//上一页面
        prevPage.setAddress(address);
        wx.navigateBack({
          delta: 1
        })
      }else{
          var id = e.currentTarget.dataset.addrid;
          wx.navigateTo({
              url: '../showAddress/showAddress?id='+id,
          });
      }
  },
//编辑地址
  editAddress(e){
    var id = e.currentTarget.dataset.addrid;
    wx.navigateTo({
      url: '../showAddress/showAddress?id=' + id,
    });
  },
  // 上拉加载
  onReachBottom: function () {
    var _this = this;
    _this.setData({
      offset: _this.data.offset + _this.data.limit
    });
   _this.loadAddress();
  },
    //获取滚动条当前位置
    onPageScroll: function (e) {
        // console.log(e)
        if (e.scrollTop > 200) {
            this.setData({
                floorstatus: true
            });
        } else {
            this.setData({
                floorstatus: false
            });
        }
    },
})
pages/editAddress/editAddress.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "管理收货地址"
}
pages/editAddress/editAddress.wxml
New file
@@ -0,0 +1,33 @@
<view class="main">
  <block wx:for="{{editAddressList}}" wx:key="ids">
    <view class='editAddress-list'>
        <!-- <view class='query-list-item' data-index="{{index}}" bind:tap="editAddressTap" data-addrId="{{item.addrId}}"> -->
        <view class='query-list-item'  bindtap="editAddressTap"  data-addrId="{{item.addrId}}" data-address="{{item}}"  >
          <view class="iconfont icon-address"></view>
          <view class='query-list'>
            <view class='query-info'>
              <view class='query-name name'>{{item.addrLiaisonman}}</view>
              <view class='query-phone grey'>{{item.addrTelephone}}</view>
            </view>
            <view class='query-status'>
              <text wx:if="{{item.addrDefault==1}}" class="default">默认</text>
              <view class='query-detail'>{{item.addrDetailaddr}} - {{item.dormitory}}</view>
            </view>
          </view>
        </view>
        <view class='hr'></view>
        <view class='handle'>
          <text class='edit' bindtap="editAddress"  data-addrId="{{item.addrId}}" >编辑</text>
          <text class='delete' bindtap='onDeleteTapEvent' data-index= "{{index}}" data-addrId="{{item.addrId}}">删除</text>
        </view>
    </view>
</block>
<view class='new-address' bindtap='newAddressEvent'>
  <view class='iconfont icon-jia'></view>
  添加收货地址
</view>
</view>
<view class="toTap" bind:tap="goTap" hidden='{{!floorstatus}}' >
  <view class="iconfont icon-zhiding1"></view>
</view>
pages/editAddress/editAddress.wxss
New file
@@ -0,0 +1,110 @@
@import "../../icon/iconfont.wxss";
.editAddress-list {
  display: flex;
  background: #fff;
  margin: 10rpx 13rpx 10rpx 13rpx;
  padding: 20rpx 0;
  border-radius: 10rpx;
}
.query-name {
  color: #333;
  font-size: 34rpx
}
.query-phone {
  color: #999;
  margin-left: 18rpx;
  margin-top: 4rpx;
}
.query-detail {
  font-size: 26rpx;
  color: #666;
}
.handle {
  font-size: 30rpx;
  margin-top: 35rpx;
}
.edit {
  color: #00c085;
}
.hr {
  width: 2rpx;
  background: #b3b3b3;
  border-radius: 2rpx;
  margin-right: 20rpx;
  margin-left: 24rpx;
}
.icon-address {
  color: #00c085;
  font-size: 40rpx;
  margin-left: 26rpx;
  margin-right: 19rpx;
  margin-top: 15rpx;
}
.query-info {
  display: flex;
  align-items: center
}
.query-detail {
  width: 100%;
  margin-left: 8rpx;
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 30rpx;
}
.default {
  width: 44rpx;
  height: 23rpx;
  font-size: 14rpx;
  border-radius: 9rpx;
  color: #fff;
  display: block;
  text-align: center;
  line-height: 23rpx;
  background-color: #FF4606;
}
.query-status {
  display: flex;
  margin-top: 20rpx;
  align-items: center
}
.query-list {
  width: 77%;
}
.delete {
  margin-left: 34rpx;
  padding-right: 20rpx;
  color: #666;
}
.selected {
  background: #ff4606;
}
.new-address{
  position: fixed;bottom: 0;
  width: 100%;height: 106rpx;background: #FF5806;color: #fff;font-weight: bold;font-size: 26rpx;display: flex;justify-content: center;align-items: center}
  .new-address .iconfont{margin-right: 5rpx;font-size: 25rpx}
  .query-list-item{
    display: flex;width: 72%
  }
.main{padding-bottom: 107rpx}
.toTap{
  bottom: 250rpx
}
pages/enterShopcoupon/enterShopcoupon.js
New file
@@ -0,0 +1,80 @@
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
const app=getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    couponList:[],
  },
  onLoad: function (options) {
    this.getCouponList();
    this.getArrondiCouponList();
  },
  //获取专区优惠券
  getArrondiCouponList() {
    var _this = this;
    util.request({
      method: "GET",
      api: "/wxapi/shopCoupon/getCouponListByTag/" + app.shopInfo.id + "/zqyhq",
      callback: function (data) {
      console.log(data.rows)
      _this.setData({
        arrondiList: data.rows
      });
    }});
  },
  //获取优惠券
  getCouponList() {
    var _this = this;
    util.request({
      method: "GET",
      api: "/wxapi/shopCoupon/getCouponListByTag/" + app.shopInfo.id + "/gmyhq",
      callback: function (data) {
      _this.setData({
        couponList: data.rows
      });
    }});
  },
  checkUserInfoIsBuding() {
    if (util.isBlank(getApp().userInfo.nickName)) {
      wx.navigateTo({
        url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
      })
    } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
      wx.navigateTo({
        url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
      })
    }
  },
  getCoupon(e) {
    var _this = this;
    var index = e.currentTarget.dataset.index;
    var value = e.currentTarget.dataset.value;
    var couponList = _this.data.couponList;
    this.checkUserInfoIsBuding();
    util.request({
      method: "GET",
      api: "/wxapi/shopCoupon/receiveCoupon/" + value.id,
      callback: function (data) {
        console.log(value.id)
        if (data.status == '200') {
          wx.showToast({
            title: data.info,
            icon: 'success',
            duration: 2000
          })
        }
      }
    });
  }
})
pages/enterShopcoupon/enterShopcoupon.json
New file
@@ -0,0 +1,6 @@
{
  "navigationBarTitleText": "优惠券",
  "navigationBarBackgroundColor": "#E13121",
  "backgroundTextStyle": "light",
  "navigationBarTextStyle": "white"
}
pages/enterShopcoupon/enterShopcoupon.wxml
New file
@@ -0,0 +1,30 @@
<view class="mian">
  <image src="https://file.micromall.xczhyf.cn/wxxcx/image/101.png" class="advert-img"></image>
  <view class="section">
    <view class="coupon-box">
       <view class="arrondi-box">
        <block wx:for="{{arrondiList}}">
          <view class="arrondi-coupon" bindtap="getCoupon" data-value="{{item}}" data-index="{{index}}">
            <text class="title">{{item.cname}}</text>
            <text class="price-white">{{item.offsetAmount}}</text>
            <text class="price">{{item.offsetAmount}}</text>
          </view>
        </block>
       </view>
    </view>
    <view class="coupon-list">
      <image src="https://file.micromall.xczhyf.cn/wxxcx/image/102.png" class="section-img"></image>
      <view class="coupon-item">
        <block wx:for="{{couponList}}">
          <view class="coupon" bindtap="getCoupon" data-value="{{item}}" data-index="{{index}}">
            <text class="title">{{item.cname}}</text>
            <text class="price">{{item.offsetAmount}}</text>
            <view class="btn-area">立即领取</view>
          </view>
        </block>
      </view>
    </view>
  </view>
</view>
pages/enterShopcoupon/enterShopcoupon.wxss
New file
@@ -0,0 +1,119 @@
page{
  background-color: #E13121
}
.section{
  padding-bottom: 0
}
.advert-img{
  width: 750rpx;
  height: 568rpx
}
.coupon-box{
  text-align: center;
}
.section-img{
  width: 557rpx;
  height: 67rpx;
  margin: 75rpx 0 50rpx 0;
}
.explain{
  color: #6D170F;
  font-size: 24rpx;
  text-align: center;
  display: block;
  margin: 60rpx 0
}
.coupon-item{
  display: flex;
  flex-wrap: wrap;
  width: 600rpx;
  margin: auto;
  color: #FD3E16
}
.coupon-item .coupon{
  background: url("http://file.micromall.xczhyf.cn/wxxcx/image/103.png");
  width: 199rpx;
  height: 244rpx;
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 50rpx 47rpx;
}
.coupon-item .title{
  font-size: 22rpx;
  margin-top: 16rpx;
  width: 170rpx;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 40rpx;
}
.coupon-item .price{
  font-size: 58rpx;
  width: 143rpx;
  text-align: center;
  margin-top: 10rpx;
  margin-right: 10rpx;
}
.coupon image{
  width: 199rpx;
  height: 244rpx;
  margin-left: 81rpx;
  margin-top: 47rpx
}
.btn-area{
  width:111rpx;
  height:34rpx;
  line-height: 34rpx;
  text-align: center;
  background:#FEDC99;
  border-radius:15rpx;
  font-size: 19rpx;
  color: #EC5E26;
  margin-top: 72rpx;
}
.arrondi-box{
  width: 538rpx;
  margin: auto
}
.arrondi-coupon{
  background: url("http://file.micromall.xczhyf.cn/wxxcx/image/104.png");
  width: 538rpx;
  height: 262rpx;
  background-size: 100% 100%;
  position: relative;
  margin-bottom: 20rpx;
}
.arrondi-coupon text{
  position: absolute;
}
.coupon-list{
  text-align: center;
}
.arrondi-coupon .title{
right: 29rpx;
top: 23rpx;
font-size: 22rpx;
color: #fff;
width: 140rpx;
white-space: nowrap;
overflow: hidden;
}
.arrondi-coupon .price-white{
  left: 84rpx;
  top: 77rpx;
  font-size: 35rpx;
  color: #fff;
  width: 50rpx
}
.arrondi-coupon .price{
  left: 200rpx;
  top: 66rpx;
  color: #FC1717;
  font-size: 67rpx;
  font-weight: bold;
  width: 130rpx;
}
pages/groupbuy/allPt.js
New file
@@ -0,0 +1,102 @@
var util = require('../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    collages: [
      {
        avatarUrl: 'https://wx.qlogo.cn/mmopen/vi_32/EPQ0sC241zkbLm1wkIcpYTiaI6oibp2RGziaVg0StQN49mjxbKg4gKlew6KCDuGibM9jS7qwN67Kpz1uYYov2p7LgQ/132',
        nickName: '姜**',
        cinfoType: 3,
        hasNum: 2,
      },
      {
        avatarUrl: 'https://wx.qlogo.cn/mmopen/vi_32/EPQ0sC241zkbLm1wkIcpYTiaI6oibp2RGziaVg0StQN49mjxbKg4gKlew6KCDuGibM9jS7qwN67Kpz1uYYov2p7LgQ/132',
        nickName: '姜**',
        cinfoType: 3,
        hasNum: 2,
      }],
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this = this
    wx.getStorage({
      key: 'token',
      success: function (res) {
        //查询团信息
        wx.request({
          url: 'https://fcyx.xyzbaby.cn/do/wxapi/collage/queryDetail/ddfff27548f245978b4b2669be03c35e/1',
          header: {
            'token': res.data // token值
          },
          method: "POST",
          success: function (res) {
            var collages = res.data.rows;
            console.log('collages:', collages)
            _this.setData({
              collages: collages,
            });
          }
        });
      }
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/groupbuy/allPt.json
New file
@@ -0,0 +1,7 @@
{
  "navigationBarTitleText": "所有拼团",
  "backgroundColor": "#eeeeee",
  "backgroundTextStyle": "light"
}
pages/groupbuy/allPt.wxml
New file
@@ -0,0 +1,19 @@
<scroll-view class="pdb-10 morePt">
  <view class='item-box font-10 '>
    <view class="item-line" wx:for="{{collages}}">
      <view class="slide-item fl">
        <image src="{{item.avatarUrl}}" class="headimg" />
        <text class='name'>{{item.nickName}}</text>
      </view>
  <view class="slide-item cllist ">
        <text class='count'>{{item.cinfoType}}人团(还差{{item.cinfoType-item.hasNum}}人)</text>
        <navigator url="/pages/createOrder/createOrder?actId={{detail.actId}}&cinfoId={{item.cinfoId}}" >
          <button size='mini'class="ctbtn">去参团</button>
        </navigator>
      </view>
    </view>
  </view>
</scroll-view>
pages/groupbuy/allPt.wxss
New file
@@ -0,0 +1,34 @@
@import "../../icon/iconfont.wxss";
@import "../../common/css/common.wxss";
@import "groupDetails.wxss";
.bar-box {
  height: 100rpx;
}
.bar-box view {
  float: left;
  width: 50%;
  text-align: center;
  font: 13pt;
  line-height: 100rpx;
  border-bottom: 1px solid #efefef;
}
.active {
  color: red;
  border-bottom: 1px solid #e00 !important;
}
.title-box {
  overflow: hidden;
  padding-left: 20rpx;
}
.gd-title {
  height: 70rpx;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
pages/groupbuy/groupDetails.js
New file
@@ -0,0 +1,878 @@
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
var shopcart = require('../../utils/shopcart.js');
//常量定义
//1页面进入未购买
const SHOW_MODEL_NOT_BUY = 1;
//2,未成团已购买进入 ,
const SHOW_MODEL_NOT_SUCCESS_BUY = 2;
//3,未成团邀请页面进入非购买,
const SHOW_MODEL_INVITED_NOT_BUY = 3;
//4 邀请进入已成团
const SHOW_MODEL_GROUP_EDN = 4;
//已经创建订单未支付
const SHOW_MODEL_HASJOIN_NOT_PAY=5;
Page({
  data: {
    userInfo: '', //用户信息
    stardata: [1, 2, 3, 4, 5],
    interval: 2000,
    duration: 1000,
    imgUrls: [],
    imagetext: ['商品介绍', '规格与包装'],
    currentTabsIndex: 0,
    checkCollect: true,
    goodsInfo: {},
    normspopup: false,
    currentIndex: 0,
    id: '',
    num: 1,
    whetherSpecification: false, //是否选择规格
    specification: '', //规格
    specificationId: '', //规格id
    specificationPrice: '', //规格价格
    price: '', //价格
    originalPrice: '', //划线价
    normsList: [],
    couponList: [],
    activity: [], //满减活动
    evaluateList: [], // 评论列表
    evaluateNum: 0, // 评论数量
    currentIndexs: 0,
    currentIndex: 0,
    hidden: false,
    limit: 10,
    offset: 0,
    inform: true,
    hidden: true,
    shareShow: false,
    cartProductId: "", //商品id
    title: "", //商品名
    imgSrc: "", //商品图片
    isShare: 0,
    qrcode: false,
    isBuyed: false, //已经购买过
    isInvited: true, //是通过邀请进入的
    showModel: SHOW_MODEL_NOT_BUY,
    gjId: null, //团队id
    groupList: [], //所有未成团的团购列表
    djsTime: {}, //倒计时
    isFirst: 1,//是否第一次进入页面
  },
  onLoad: function(options) {
    var _this = this;
    var actId = options.id; //拼团活动id
    var shopId = options.shopId;
    var gjId = options.gjId; //团队id
    var needGetShopInfo = false;
    if (actId == undefined) {
      //通过二维码进入
      const scene = decodeURIComponent(options.scene);
      var params = scene.split(",");
      console.log("扫码参数", params);
      shopId = params[0];
      actId = params[1];
      gjId = params[2];
      app.shopInfo = {
        id: shopId
      };
      needGetShopInfo = true;
    }
    //未获取到活动id
    if (!actId) {
      wx.showModal({
        title: '提示',
        content: '产品信息加载失败',
        showCancel: false
      })
      return;
    } else {
      _this.setData({
        id: actId
      });
    }
    _this.setData({
      gjId: gjId
    });
    //检测用户登录
    if (!getApp().loginToken) {
      util.userLogin(function() {
        _this.getPageInfo(actId, gjId);
      });
    } else {
      this.getPageInfo(actId, gjId);
    }
    //获取门店信息
    if (needGetShopInfo) {
      setShopInf(shopId);
    }
  },
  /**
   * 加载门店数据
   */
  getPageInfo(actId, gjId) {
    //获取拼团产品信息
    this.getGroupProductInfo(actId);
    //是否存在团队id
    if (gjId) {
      //如果存在团队id则必须展示这个团队的团购信息
      this.getGroupJoinInfo(gjId);
    } else {
      //没有明确的团队id
      this.getOwnerGroupBuyInfo(actId);
    }
  },
  /**
   * 根据当前登录人,查询组队信息
   * 1、如果当前登录人没有 购买过则显示其他已经组队成功的团队信息
   * 2、如果当前登录人购买了则展示当前登录人的团队信息
   */
  getOwnerGroupBuyInfo(actId) {
    console.log("getOwnerGroupBuyInfo");
    var _this = this;
    util.request({
      api: api.groupBuy.findOwnerGroupBuyInfo + actId,
      method: 'GET',
      checkLogin: true,
      callback: function(data) {
        let grouping = data.mapInfo.grouping;
        if (grouping == 2) {
          _this.setData({
            groupList: data.mapInfo.groupList,
            showModel: SHOW_MODEL_NOT_BUY,
          });
        } else {
          let myself=data.mapInfo.myself;
          if(myself.isHasPay==2){
            _this.setData({showModel: SHOW_MODEL_HASJOIN_NOT_PAY,orderId:myself.orderId});
          }else{
            _this.setData({showModel: SHOW_MODEL_NOT_SUCCESS_BUY,});
          };
          _this.setData({
            ownerGroupInfo: data.mapInfo.ownerGroupInfo,
            joinUserList: data.mapInfo.ownerGroupInfo.joinUserList,
            gjId: data.mapInfo.ownerGroupInfo.id,
            currentGrooupPrice: data.mapInfo.price,
            remainingTime: data.mapInfo.ownerGroupInfo.remainingTime
          });
          _this.ptDjs();
        }
      }
    });
  },
  /**
   * 加载拼团组队的信息
   */
  getGroupJoinInfo(gjId) {
    console.log("getGroupJoinInfo");
    var _this = this;
    this.setData({
      gjId: gjId
    });
    util.request({
      api: api.groupBuy.findGroupJoinInfo + gjId,
      method: 'GET',
      checkLogin: true,
      callback: function(data) {
        let grouping = data.mapInfo.groupJoin;
        let showModel = "";
        if (data.mapInfo.isExist == 1) {
          //当前用户已经是团中的成员
          showModel = SHOW_MODEL_NOT_SUCCESS_BUY;
        } else {
          //当前用户不是团中的成员 和TA组队
          showModel = SHOW_MODEL_INVITED_NOT_BUY;
        }
        //1 ,拼团成功 2拼团失败
        if (grouping.gjStatus == 2 || grouping.gjStatus == 1) {
          showModel = SHOW_MODEL_GROUP_EDN;
        }else{
          _this.setData({
            remainingTime: grouping.remainingTime
          });
          _this.ptDjs();
        }
        _this.setData({
          ownerGroupInfo: grouping,
          showModel: showModel,
          joinUserList: grouping.joinUserList,
          currentGrooupPrice: data.mapInfo.price
        });
      }
    });
  },
  /**
   * 加载团购产品信息
   */
  getGroupProductInfo(id) {
    var _this = this;
    //处理产品信息
    util.request({
      api: api.groupBuy.findGroupBuyInfo + id,
      method: 'GET',
      checkLogin: true,
      callback: function(data) {
        let goodsInfo = data.mapInfo.goodsInfo;
        if (goodsInfo.mobileDetails != null) {
          goodsInfo.mobileDetails = goodsInfo.mobileDetails.replace(/<img /g, '<img class="rich_img" ');
          console.log(goodsInfo.mobileDetails);
        }
        _this.setData({
          goodsInfo: goodsInfo,
          imgUrls: goodsInfo.productImgs,
          normsList: goodsInfo.skus,
          specification: goodsInfo.skus[0].name,
          specificationPrice: goodsInfo.skus[0].price,
          price: goodsInfo.skus[0].price,
          specificationId: goodsInfo.skus[0].id,
          imgSrc: goodsInfo.imgMobile,
          title: goodsInfo.title,
          hidden: true,
          activity: data.mapInfo.activity,
          couponList: data.mapInfo.couponList,
          evaluateNum: data.mapInfo.evaluateNum,
          checkCollect: data.mapInfo.checkCollect,
        })
        //处理拼团信息
        let groupBuyInfo = data.mapInfo.groupBuyInfo;
        let currentGrooupPrice=null;
        if (!_this.data.gjId) {
          // 如果没有特定的拼团取第一个拼团
          _this.setData({
             currentGrooupPrice:groupBuyInfo.groupPriceList[0]
          });
        }
        _this.setData({
          groupPriceList: groupBuyInfo.groupPriceList,
          //当前选中价格
          currentGrooupPriceIndex: 0,
          groupBuyInfo: groupBuyInfo,
        });
        //启动倒计时
        _this.djs();
      }
    });
  },
  //从服务器加载门店信息
  setShopInf(shopId) {
    util.request({
      api: api.yuyue.findShopInfoById + "/" + shopId,
      callback: function(data) {
        app.shopInfo = data.mapInfo.shopInfo;
      },
      checkLogin: true,
    });
  },
  /**
   *
   * 切换团类型
   */
  changeGroupType(e) {
    let index = e.currentTarget.dataset.index;
    let groupPriceList = this.data.groupPriceList;
    this.setData({
      currentGrooupPriceIndex: index,
      currentGrooupPrice: groupPriceList[index],
    });
  },
  /**
   * 倒计时
   */
  djs() {
    var _this = this;
    let time = _this.data.groupBuyInfo.time;
    var interval = setInterval(function() {
      time--;
      if (time < 0) {
        clearInterval(interval);
      } else {
        _this.setData({
          djs: util.getTimeSpance(time),
          time: time,
        });
      }
    }, 1000);
  },
  /**
    * 拼团支付倒计时
    */
  ptDjs() {
    var _this = this;
    let remainingTime = _this.data.remainingTime;
    var interval = setInterval(function () {
      remainingTime--;
      if (remainingTime < 0) {
        clearInterval(interval);
      } else {
        _this.setData({
          ptDjs: util.getTimeSpance(remainingTime),
          remainingTime: remainingTime,
        });
      }
    }, 1000);
  },
  onShow(options) {
    if(this.data.isFirst!=1){
      var actId = this.data.id;
      var gjId = this.data.gjId;
      this.getPageInfo(actId, gjId);
    }else{
      this.setData({isFirst:2});
    }
  },
  // 回到首页
  goBack() {
    wx.switchTab({
      url: '../index/index'
    })
  },
  goIndex() {
    wx.reLaunch({
      url: '/pages/index/index'
    })
  },
  //转发
  onShareAppMessage(res) {
    var index = this.data.index
    var id = this.data.id;
    var gjId = this.data.gjId;
    var title = this.data.goodsInfo.title;
    let url = "pages/groupbuy/groupDetails?id=" + id + "&shopId=" + app.shopInfo.id + "&gjId=" + gjId;
    console.log(url);
    if (res.from === "button") {}
    return {
      title: "[拼团]" + title,
      imageUrl: this.data.imgUrls[0].imgPath,
      path: url,
      success(res) {
      },
      fail(res) {
      }
    }
  },
  /**
   * 邀请好友
   */
  invitaion() {
  },
  // 分享
  share(e) {
    this.setData({
      shareShow: true,
      popupShow: true
    })
  },
  // 图文选项卡
  onTabsItemEvent(e) {
    var index = e.currentTarget.dataset.index;
    // console.log(index)
    this.setData({
      currentTabsIndex: index
    })
  },
  // 收藏
  collect() {
    var _this = this;
    var id = _this.data.id;
    util.request("POST", "/wxapi/Collection/saveCollection", {
      "collProductid": id
    }, function(data) {
      if (data.status == 200) {
        _this.setData({
          checkCollect: true
        })
      }
    }, false);
  },
  //规格选择
  norms(e) {
    var index = e.currentTarget.dataset.index;
    var value = e.currentTarget.dataset.value;
    var price = e.currentTarget.dataset.price;
    var id = e.currentTarget.dataset.id;
    this.setData({
      currentIndex: index,
      specification: value,
      specificationPrice: price,
      specificationId: id
    })
  },
  // 显示规格
  showNorms() {
    this.setData({
      whetherSpecification: true,
      normspopup: true
    })
  },
  //隐藏规格
  cancelNorms() {
    this.setData({
      normspopup: false
    })
  },
  /**
   * 绑定加数量事件
   */
  addCount(e) {
    var _this = this;
    let num = _this.data.num;
    num = num + 1;
    this.setData({
      num: num
    });
  },
  /**
   * 绑定减数量事件
   */
  minusCount(e) {
    var _this = this;
    let num = _this.data.num;
    if (num <= 1) {
      return false;
    }
    num = num - 1;
    this.setData({
      num: num
    });
  },
  /**
   * 单独购买
   */
  singelBuy(e) {
    this.setData({
      buyType: 1
    });
    this.buy();
  },
  groupBuy(e) {
    this.setData({
      buyType: 2
    });
    this.buy();
  },
/**
 * 去参团
 */
  joinBuy(e) {
    let gjId=e.currentTarget.dataset.gjid;
    this.setData({
      buyType: 2,
      gjId: gjId
    });
    this.buy();
  },
  // 立即购买
  buy() {
    var _this = this;
    var userInfo = getApp().userInfo;
    if (util.isBlank(userInfo.nickName)) {
      wx.navigateTo({
        url: '/pages/welcome/welcome?url=back',
      })
    }
    //判断是否授权头像
    // 判断是否绑定过手机号
    if (util.isBlank(getApp().userInfo.phoneNumber)) {
      wx.navigateTo({
        url: '../phone/phone',
      })
    } else {
      let goodsInfo = _this.data.goodsInfo;
      if (!_this.data.whetherSpecification) {
        console.log("存在多个规格,且没有选择过规格,弹出请选择");
        _this.setData({
          whetherSpecification: true,
          normspopup: true
        });
      } else {
        //隐藏规格
        this.cancelNorms();
        var id = _this.data.goodsInfo.id; // 商品id
        var cartSkuId = _this.data.specificationId; //规格id
        var cartNumber = _this.data.num; //数量
        var stockNum = goodsInfo.stockNum;
        if (stockNum < 1) {
          wx.showToast({
            title: "您来晚了,商品已经抢光了",
            icon: 'none',
          });
          return;
        }
        if (_this.data.buyType == 1) {
          //单独购买
          //取消所有购物车选中项目
          util.request({
            method: "POST",
            api: api.shoppingCart.updateCartAllSelected + app.shopInfo.id + "/2",
            callback: function() {
              //加入购物车
              comReq.addShoppingCar(cartSkuId, cartNumber, function(totalNum) {
                //进入结算
                wx.navigateTo({
                  url: '/pages/service/shopOrder?model=2',
                })
              });
            }
          });
        } else {
          //拼团购买
          let orderMsg = {
            goodsInfo: _this.data.goodsInfo,
            currentGrooupPrice: _this.data.currentGrooupPrice,
            cartSkuId: cartSkuId,
            cartNumber: cartNumber,
            specification: _this.data.specification,
            gjId: _this.data.gjId,
          };
          wx.setStorageSync("orderMsg", orderMsg);
          //进入结算
          wx.navigateTo({
            url: '/pages/groupbuy/groupOrder',
          })
        }
      }
    }
  },
  // 轮播图预览保存
  onSwiperEvent(e) {
    let index = e.currentTarget.dataset.index;
    let imgArr = [];
    for (var i = 0; i < this.data.imgUrls.length; i++) {
      imgArr.push(this.data.imgUrls[i].imgPath);
    }
    wx.previewImage({
      current: imgArr[index],
      urls: imgArr,
    })
    // console.log(1111)
    console.log(imgArr[index])
  },
  //领券
  couple(e) {
    this.setData({
      popup: true
    })
  },
  //取消领券弹窗选择
  popupTap(e) {
    this.setData({
      popup: false,
      normspopup: false,
      telShow: false,
      shareShow: false
    })
  },
  evaluate(e) {
    wx.navigateTo({
      url: '../wholeEvaluate/whoeEvaluate?id=' + e.currentTarget.dataset.id,
    })
  },
  // 生成卡片跳转
  card(e) {
    var id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../card/card?id=' + id,
    })
  },
  /**
   * 获取二维码
   */
  getQrcode: function() {
    var _this = this;
    if (_this.data.qrcode) {
      wx.previewImage({
        current: _this.data.qrcode, // 当前显示图片的http链接
        urls: [_this.data.qrcode] // 需要预览的图片http链接列表
      })
    } else {
      var shopId = app.shopInfo.id;
      var actId = _this.data.id;
      var gjId = _this.data.gjId;
      var gpId=_this.data.currentGrooupPrice.id;
      var data = {
        shopId: shopId,
        actId: actId,
        gpId: gpId,
        scene: shopId + "," + actId,
        path: "pages/groupbuy/groupDetails",
        activityType:2,
      };
      if (gjId != undefined) {
        data.gjId = gjId;
        data.scene = data.scene+","+gjId;
      }
      util.request({
        method: "POST",
        data:data,
        api: '/wxapi/shareProduct/getProductShareQrcode/',
        callback: function(data2) {
          var qrcode = data2.rows[0].qrcodeUrl
          console.log(qrcode);
          _this.setData({
            qrcode: qrcode,
          })
          wx.previewImage({
            current: _this.data.qrcode, // 当前显示图片的http链接
            urls: [_this.data.qrcode], // 需要预览的图片http链接列表
            success: function() {
              wx.downloadFile({
                url: _this.data.qrcode,
                success: function(res) {
                  console.log(res);
                  //图片保存到本地
                  wx.saveImageToPhotosAlbum({
                    filePath: res.tempFilePath,
                    success: function(data) {
                      wx.showToast({
                        title: '保存成功',
                        icon: 'success',
                        duration: 2000
                      })
                    },
                    fail: function(err) {
                      console.log(err);
                      if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
                        console.log("当初用户拒绝,再次发起授权")
                        wx.openSetting({
                          success(settingdata) {
                            console.log(settingdata)
                            if (settingdata.authSetting['scope.writePhotosAlbum']) {
                              console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
                            } else {
                              console.log('获取权限失败,给出不给权限就无法正常使用的提示')
                            }
                          }
                        })
                      }
                    },
                    complete(res) {
                      console.log(res);
                    }
                  })
                }
              })
            }
          })
        }
      })
    }
  },
  /**
   * 未支付进入支付页面
   */
  goOrder(){
    var _this = this;
    wx.redirectTo({
      url: '../orderDetails/orderDetails?id=' + _this.data.orderId,
    })
  },
  /**
   * 分享
   */
  formSubmit: function(e) {
    console.log('获取二维码:', e)
    this.getQrcode()
  },
})
pages/groupbuy/groupDetails.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "商品详情"
}
pages/groupbuy/groupDetails.wxml
New file
@@ -0,0 +1,352 @@
<view class="detail_container">
  <swiper indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='#00C085' indicator-color='#BDD8D0'>
    <block wx:for="{{imgUrls}}" wx:key="key">
      <swiper-item>
        <image src="{{item.imgPath}}" class="slide-image" bind:tap="onSwiperEvent" data-id="{{item.id}}" data-index="{{index}}" mode="widthFix"></image>
      </swiper-item>
    </block>
  </swiper>
  <view class="djs">
    <text class="js">拼团</text>
    <view class="time">
      <view>距结束仅剩</view>
      <view>{{djs.day}}天{{djs.hour}}时{{djs.minute}}分{{djs.second}}秒</view>
    </view>
  </view>
  <view class="detail_section">
    <view class="detail_content">
      <view class="detail_top">
        <view class="detail-group">
          <view class='iprice detail_iprice'>¥{{currentGrooupPrice.gpPrice}} </view>
          <view class="groupNum">{{currentGrooupPrice.gpCount}}人团</view>
          <view class='grey original_iprice'  >¥{{goodsInfo.price}}</view>
          <view class="share" bind:tap="share">
            <image src="/image/share.png"></image>
          </view>
        </view>
        <view class="detail_info">
          <view class="detail_name threeblack">{{goodsInfo.title}}</view>
          <view class='grey'>月销:{{goodsInfo.dsVolume}}</view>
        </view>
        <view class='grey explain'>{{goodsInfo.briefIntroduction}}</view>
      </view>
    </view>
    <view class='item-line ' wx:if="{{showModel==1}}">
      <view class='fl color-gray font-12'>拼团类型</view>
      <view class="fr groupNums">
        <view wx:for="{{groupPriceList}}" wx:key="i" bindtap="changeGroupType"  data-index="{{index}}" class="groupNum {{currentGrooupPriceIndex==index?'active':''}} ">{{item.gpCount}}人团</view>
      </view>
    </view>
    <view class="line-weight"></view>
    <view class='item-box font-10 ' wx:if="{{showModel==1 && groupList.length>0}}">
      <view class='item-line'>
        <text class="font-10 fl"> {{groupList.length}}人正在拼团,您可以直接参与</text>
      <!--
        <navigator url='/pages/groupbuy/allPt' class="font-10 fr color_gray" bindtap="showAllPt"> 查看更多 > </navigator>
      -->
      </view>
      <view class="cllist  item-line" wx:for="{{groupList}}">
        <view class="slide-item ">
          <image src="{{item.avatarUrl}}" class="headimg" />
          <text class='name'>{{item.createBy}}</text>
        </view>
        <view class="slide-item cllist ">
          <text class='count'>{{item.groupPrice.gpCount}}人团(还差{{item.groupPrice.gpCount-1-item.theLast}}人)</text>
          <navigator >
            <button bindtap="joinBuy" data-gjId="{{item.id}}" size='mini' class="ctbtn">去参团</button>
          </navigator>
        </view>
      </view>
    </view>
    <view class='item-line '>
      <view class='fl color-gray font-12'>拼团玩法</view>
      <view class="fr">
        <text class='font-12 color_gray'>开团/参团>邀请好友参团>人满成团</text>
      </view>
    </view>
    <!--  组团信息 -->
    <view class="item-box" wx:if="{{showModel==2||showModel==3|| showModel==4|| showModel==5}}">
      <view class="item-line headDjs ">
        <text>{{ownerGroupInfo.createBy}}发起的拼团</text>
        <text  wx:iff="{{showModel==2}}" >剩余{{ptDjs.hour}}时{{ptDjs.minute}}分{{ptDjs.second}}秒</text>
      </view>
      <view class="cllist  item-line" wx:for="{{joinUserList}}">
        <view class="slide-item ">
          <image src="{{item.avatarUrl}}" class="headimg" />
          <text class='name'>{{item.createBy}}</text>
        </view>
        <view class="slide-item cllist ">
          <text class='count'>{{item.createTime}}</text>
        </view>
      </view>
      <view class="queshi">还差{{ownerGroupInfo.theLast}}人成团</view>
    </view>
    <view class="detail_middle">
      <view class="couple">
        <view class='firms' bind:tap="showNorms">
          <view class='threeblack'>规格</view>
          <view class='couple_right'>
            <text>{{specification}}</text>
            <view class=" iconfont iconright"></view>
          </view>
        </view>
      </view>
      <!-- 图文说明 -->
      <view class='detail_imagetext'>
        <view class='imagetext_box'>
          <block wx:for="{{imagetext}}" wx:key="ids">
            <view class="imagetext_item {{currentTabsIndex==index?'selected':''}}" bindtap='onTabsItemEvent' data-index="{{index}}">
              {{item}}
            </view>
          </block>
        </view>
        <view class="imagetext_detail_box">
          <view class="tabs_content" hidden="{{currentTabsIndex!=0}}">
            <view>
              <rich-text class='price_content' nodes="{{goodsInfo.mobileDetails}}"></rich-text>
            </view>
          </view>
          <view class="tabs_content explain_tabs" hidden="{{currentTabsIndex!=1}}">
            <view wx:for="{{goodsInfo.params}}" wx:key="ids">
              <view class='title'>{{item.paramName}}</view>
              <view class='content name'>{{item.paramValue}}</view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <!--下架后进入产品页控制操作 -->
  <view class="detail_footer footer-grey" wx:if="{{goodsInfo.status == 2 || goodsInfo.delFlag == 1}}">
    <view class='detail_collected' bindtap="goIndex">
      <view class="iconfont icondianpu"></view>
      <text>店铺</text>
    </view>
    <view class='service'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          客服
        </button>
      </view>
    </view>
    <view class='detail_cart detail_pay'>加入购物车</view>
    <view class='detail_buy detail_pay'>已下架</view>
  </view>
  <!--下架后进入产品页控制操作END -->
  <!-- 底部按钮操作栏  -->
  <view class="detail_footer " wx:if="{{goodsInfo.status == 1 && goodsInfo.delFlag == 2}}">
    <view class='detail_collected' bindtap="goIndex">
      <view class="iconfont icondianpu"></view>
      <text>店铺</text>
    </view>
    <view class='service'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          客服
        </button>
      </view>
    </view>
    <view wx:if="{{goodsInfo.stockNum>0 && showModel==1 }}"  class='detail_cart detail_pay singer'
    bindtap='singelBuy' >单独购买</view>
    <view wx:if="{{goodsInfo.stockNum>0 && showModel==1 }}" class='detail_cart detail_pay headBuy' bindtap='groupBuy'>
    <view>发起拼团</view>
     <view class="headprice" wx:if="{{currentGrooupPrice.gpHeadPrice}}" >团长价¥{{currentGrooupPrice.gpHeadPrice}} </view>
    </view>
    <button
    open-type="share" wx:if="{{goodsInfo.stockNum>0 &&   showModel==2  }}" class='detail_cart detail_pay_big cleanbtn btn-center' >
    邀请好友参团</button>
    <button    bindtap="goOrder"   wx:if="{{goodsInfo.stockNum>0 &&   showModel==5 }}" class='detail_cart detail_pay_big cleanbtn btn-center' >
    立刻支付</button>
    <view wx:if="{{goodsInfo.stockNum>0 &&   showModel==3 }}" class='detail_cart detail_pay_big' bindtap='groupBuy'>和他TA组团</view>
    <view wx:if="{{showModel==4 }}" class='detail_cart detail_pay_over'  >拼团结束</view>
    <view wx:if="{{goodsInfo.stockNum<1}}" class='detail_cart detail_pay'>已售罄</view>
  </view>
 <!-- 底部按钮操作栏end  -->
  <view class="detail_couple">
    <view class='detail_coupon'></view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{normspopup}}">
    <view class='popup' bind:tap="popupTap"></view>
    <view class='norms-container'>
      <view class="norms-list">
        <view>
          <view class='norms-detail'>
            <block wx:for="{{normsList}}" wx:key="ids">
              <view class='norms-item' hidden="{{currentIndex!=index}}">
                <image src='{{item.imgPath}}'></image>
                <view class='norms-content'>
                  <text class='title'>{{goodsInfo.title}}</text>
                  <text class='stock grey'>库存:{{item.stock}}</text>
                  <text class='price'>¥{{currentGrooupPrice.gpPrice}}</text>
                </view>
              </view>
            </block>
            <view class='close iconfont icon-quxiao' bind:tap="cancelNorms"></view>
          </view>
        </view>
        <view class='norms-select'>
          <text class='threeblack'>规格</text>
          <view>
            <view class='norms-box'>
              <block wx:for="{{normsList}}" wx:key="ids">
                <view class='norms-box-item {{currentIndex == index?"selectedNorms":""}}' bindtap="norms" data-index="{{index}}" data-value="{{item.name}}" data-price="{{item.price}}" data-id="{{item.id}}">{{item.name}}</view>
              </block>
            </view>
          </view>
        </view>
        <view class='norms-number'>
          <text class='threeblack'>数量</text>
          <view class="cart-count-box">
            <!-- iconfont icon-jian -->
            <view class="cart-count-down " bindtap="minusCount" data-obj="{{obj}}" data-index="{{index}}">
              <image src='/image/jian.png'></image>
            </view>
            <text class="cart-count-num">{{num}}</text>
            <view class="cart-count-add" bindtap="addCount" data-index="{{index}}">
              <image src='/image/jia.png'></image>
            </view>
          </view>
        </view>
      </view>
      <view class='norms-footer'>
        <view class='norms-join' bindtap='buy'>立刻购买</view>
      </view>
    </view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择END\\\\\\\\\\\\\\\\\   -->
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\优惠券\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{popup}}">
    <view class='popup' bind:tap="popupTap"></view>
    <view class='coupons-list'>
      <view wx:for="{{couponList}}" wx:key="ids" data-id="{{item.id}}">
        <view class='coupons  counpons-list'>
          <view class="coupons-explain">
            <text>满减券</text>
          </view>
          <view class='money'>
            <view class='money-num'>
              <text style='font-size:34rpx'>¥</text>
              <text style='font-size:60rpx'>{{item.offsetAmount}}</text>
            </view>
            <view class='money-info'>
              <text>满{{item.minAmount}}元可用</text>
            </view>
          </view>
          <view class='content'>
            <view class="content-title">{{item.cname}}</view>
            <view class='content-info'></view>
            <view class='content-time'>有效期至{{item.endTimeWx}}</view>
          </view>
          <view class='right'>
            <view class='draw radius {{drawIndex==index?"active":""}}' wx:if="{{item.canReceive == 1}}" bindtap="getCoupon" data-value="{{item}}" data-index="{{index}}">
              <text>立即领取</text>
            </view>
            <view wx:else class='draw radius alreadyGet' bindtap="drawevent" data-value="{{item}}" data-index="{{index}}">
              <text>领取成功</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>
<!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\优惠券END\\\\\\\\\\\\\\\\\   -->
<view class="popup-item" wx:if="{{shareShow}}">
  <view class='popup' bind:tap="popupTap" wx:if="{{popupShow}}"></view>
  <view class="pupup-bottom popup-content">
    <view class="share-container">
      <view class="hr"></view>
      <text class="share-text">分享到</text>
    </view>
    <view class="share-box">
      <button open-type="share" data-index="{{index}}" bind:tap="popupTap">
        <image src="/image/wx.png"></image>
        微信
      </button>
      <view class="card">
        <form bindsubmit="formSubmit">
          <button formType="submit" style="width:200rpx;">
            <image src="/image/tp.png"></image>
            生成卡片 </button>
        </form>
      </view>
    </view>
    <view class="cancel padding" bind:tap="popupTap">取消</view>
  </view>
</view>
<!-- 回到首页 -->
<view class="index" bind:tap="goIndex" wx:if="{{isShare}}">
  <image src="/image/goIndex.png"></image>
</view>
pages/groupbuy/groupDetails.wxss
New file
@@ -0,0 +1,730 @@
@import "../../icon/iconfont.wxss";
swiper {
  height: 750rpx;
  width: 100%;
}
.slide-image {
  width: 100%;
  height: 100%;
}
swiper-item{
  background: #fff
}
.detail_top {
  font-size: 34rpx;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 20rpx 0;
}
.detail-group{
  display: flex;
  align-items: center
}
.detail_collected text{
    font-size: 10px;
}
.original_iprice{
  text-decoration:line-through;
  margin-left: 10rpx;
}
.share {
  width: 90%;
  text-align: right;
}
.share image{width: 42rpx;height: 42rpx}
.detail_top>view {
  width: 90%;
  margin: auto;
}
.detail_name {
  width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail_info {
  display: flex;
  padding: 11rpx 0 28rpx 0;
  align-items: center
}
textarea{position: absolute}
.stock{margin-top: 20rpx}
.explain {
  font-size: 26rpx;
  line-height: 48rpx;
}
.detail_iprice {
  font-size: 35rpx;
  font-weight: bold;
}
.detail_middle {
  font-size: 30rpx;
}
.couple {
  background: #fff;
  margin: 10rpx 0;
}
.couple>view {
  display: flex;
  width: 90%;
  margin: auto;
  line-height: 70rpx;
}
.couple_right {
  width: 90%;
  display: flex;
  justify-content: flex-end;
  align-items: center
}
.couple .threeblack {
  font-weight: bold;
}
.couple_right .icon-31gouwuquan {
  width: 72rpx;
  height: 38rpx;
  position: absolute;
  left: -73rpx;
}
.couple_icon {
  background: url("http://file.micromall.xczhyf.cn/wxxcx/image/70.png");
  margin-left: 23rpx;
  width: 88rpx;
  height: 29rpx;background-size: 100% 100%;
  text-align: center
}
.couple_icon .price {
  font-size: 24rpx;
  color: #fff;
  margin-top: -19rpx
}
.couple-list .icon-youbian {
  margin-top: 6rpx;
}
.avatarUrl {
  width: 50rpx;
  height: 50rpx;
  border-radius: 50%;
}
.eval_text {
  font-weight: bold;
  width: 77%;
}
.product_eval {
  display: flex;
  line-height: 80rpx
}
.all {
  display: flex;
  line-height: 80rpx;
}
.evaluate_container {
  background: #fff;
}
.evaluate_container>view {
  width: 90%;
  margin: auto;
}
.star {
  display: flex;
  align-items: center;
  width: 45%;
  padding-left: 62rpx;
}
.star image {
  width: 30rpx;
  height: 29rpx;
  margin-right: 17rpx;
}
.evaluate_detail>view {
  display: flex;
  align-items: center;
}
.evaluate-info{display: flex;align-items: center;width: 21%}
.user_name {
  margin-left: 20rpx;
  font-size: 26rpx;
  width: 48%;
}
.evaluate_detail {
  padding-bottom: 40rpx;
}
.status {
  padding-top: 34rpx;
  display: block;
  color: #999;
  font-size: 28rpx;
}
.detail_imagetext {
  margin-top: 10rpx;
  background: #fff;
}
.imagetext_box {
  display: flex;
  width: 90%;
  margin: auto;
}
.imagetext_item {
  padding: 30rpx 0;
  color: #999;
  font-size: 28rpx;
  border-bottom: 1px solid #b3b3b3;
  width: 50%;
  text-align: center;
}
.tabs_content {
  width: 100%;
  margin: auto;
}
.price_content {
  color: #666;
  font-size: 24rpx;
  line-height: 36rpx;
}
.rich_img {
  max-width: 100%;
  margin: 0rpx;
  padding: 0rpx;
  border: none;
}
.carriage .couple_right{width: 73%}
.imagetext_detail_box .title {
  background: #F1F1F1;
  border-bottom: 1rpx solid #E1E1E1;
  color: #333;
  width: 30%;
  padding: 20rpx 0;
  font-size: 26rpx;
  align-items: center;
  display: flex;
  justify-content: center;
  border-left: 1rpx solid #E1E1E1;
  border-right: 1rpx solid #E1E1E1;
  white-space: nowrap
}
.explain_tabs>view {
  display: flex;
}
.explain_tabs{width: 93%}
.explain_tabs .content {
  width: 70%;
  padding: 20rpx 24rpx;
  font-size: 26rpx;
  color: #666;
  border-top: #E1E1E1 solid 1px;
  border-right: 1rpx solid #E1E1E1;
  line-height: 36rpx;
  margin-top: -1rpx;
  margin-left: 0;
  box-sizing: border-box;
 word-wrap:break-word;
}
.imagetext_detail_box {
  padding: 29rpx 0;
}
.explain_tabs>view:nth-child(1) .content{margin-top: 0px}
.explain_tabs>view:nth-child(1) .title{border-top: 1rpx solid #E1E1E1}
.explain_tabs .content:last-child {
  border-bottom: 1rpx solid #E1E1E1;
}
.explain_tabs .title_explain {
  border-top: 1px solid #E1E1E1;
}
.imagetext_box .selected {
  font-size: 28rpx;
  color: #333;
}
.imagetext_item:nth-child(1)::after {
  content: '';
  height: 100%;
  margin-left: 40%;
  display: inline-block;
  vertical-align: middle;
  border-right: 1px solid #b3b3b3;
}
.imagetext_item:nth-child(1) {
  padding-left: 10%;
}
.detail_footer {
  height: 106rpx;
  width: 100%;
  position: fixed;
  bottom: 0;
  display: flex;
  line-height: 106rpx;
  background: #f7f7f7;
}
.detail_section {
  padding-bottom: 106rpx;
}
button {
  border: none;
  color: #666;
  display: inherit;
}
.footer-grey .detail_buy{background: #666666}
.detail_buy {
  background: #ff5806;
}
.footer-grey .detail_cart{background: #B3B3B3}
.detail_cart {
  background: #00C085;
}
.detail_pay {
  width: 35%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_pay_big {
  width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_pay_over{
   width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
  background:#999999;
}
.singer{
  background: rgb(155, 235, 211);
}
.detail_collected {
  width: 15%;
  text-align: center;
  line-height: 36rpx;
  font-size: 20rpx;
  margin-top: 20rpx;
  color: #666;
}
.button-hover {
  background: #f7f7f7;
  color: #666;
}
.service {
  margin-top: 20rpx;
  width: 15%;
  position: relative;
}
.detail_footer .iconfont {
  padding-bottom: 5rpx;
}
button {
  line-height: 36rpx;
  border: none;
  align-items: center;
  font-size: 20rpx;
  padding-left: 0;
  padding-right: 0;
}
.btn-center{
  display: flex;
  justify-content: center;
}
button:after {
  border: 0px;
  color: #414141;
}
.contact_list {
  width: 100%;
  position: absolute;
  height: 100%;
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
}
.icon-soucang {
  font-size: 32rpx;
}
.icon-shoucang {
  font-size: 36rpx;
  color: #ff3f3a;
}
.couple-image {
  width: 88rpx;
  height: 29rpx;
}
.couple .threeblack {
  width: 20%;
}
.icon-youbian {
  color: #cacaca;
  padding-left: 15rpx;
}
.norms-container {
  background: #fff;
  width: 750rpx;
  background: rgba(255, 255, 255, 1);
  border-radius: 10rpx 10rpx 0rpx 0rpx;
}
.norms-container {
  position: absolute;
  bottom: 0;
}
.norms-item image {
  width: 180rpx;
  height: 180rpx;
  margin-right: 35rpx;
}
.norms-item {
  display: flex;
  width: 96%;
}
.norms-detail {
  display: flex;
}
.norms-content {
  display: flex;
  flex-direction: column;
}
.norms-list {
  width: 90%;
  margin: auto;
}
.norms-list .threeblack {
  font-size: 26rpx;
}
.norms-box-item {
  font-size: 24rpx;
  background: #eee;
  color: #333;
  padding: 9rpx 30rpx;
  border-radius: 30rpx;
  text-align: center;
  margin-right: 20rpx;
  margin-top: 20rpx
}
.selectedNorms {
  color: #ff3f3a;
  background: #fff;
  border: 1px solid #ff3f3a;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  padding: 30rpx 0;
  height: 500rpx;
  overflow-y: auto
}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons-container{margin: 0}
.alreadyGet{
  background-color: #999999
  }
.coupons-list>view{
  position: relative
}
.coupons .money::after{
left: 280rpx;
}
.detail_info .grey{white-space: nowrap;width: 30%;text-align: right}
.cart-list .cart-count-box{
    display: flex;align-items: center;
    margin-top:55rpx;
}
.cart-count-box image{width: 32rpx;height: 33rpx}
.cart-count-down,.cart-count-add{
    height: 100%;
}
.cart-count-num{
    background: #f9f9f9;
    font-size: 26rpx;
    border-radius:5rpx;
    color: #B3B3B3;
    text-align: center;
      width: 43rpx;
    height: 41rpx;
    line-height: 41rpx;
    margin-left: 15rpx;
    margin-right: 15rpx;
    margin-top: 8rpx
}
.detail-tel{display: flex;width: 100%}
.detail-tel .detail_pay{width: 85%;letter-spacing: 1rpx}
.tel-text{background: #00C085;position: absolute;top: 10rpx;font-size: 26rpx;right: 23rpx;border-radius: 17rpx;padding: 0 20rpx;color: #fff}
.popup-item{width: 100%;height: 100%;position: fixed;bottom: 0;z-index: 99}
.pupup-bottom{position: absolute;bottom: 0;width: 100%}
.detail_buy .button-hover{
  background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.detail_buy button{
   background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.tel{
  font-size: 34rpx;
}
.popup-item .cancel{
  font-size: 36rpx;
  margin-top: 12rpx
}
.popup-item .padding{
  height: 100rpx;
  line-height: 100rpx;
  background: #fff;
  text-align: center;
  color: #000;
}
.goIndex{
  position: fixed;z-index: 9999;
  bottom: 0;width: 163rpx;
  display: flex;
  flex-direction: column;
  font-size: 26rpx;
  color:#fff;
  height: 78rpx;
  right: 0;
  top: 80%;
}
.goIndex image{
  width: 100%;
  height: 100%
}
.popup-content{background: #fff;border-radius:10px 10px 0px 0px;height: 492rpx}
.popup-content button{background: #fff;width: 50%;font-size: 30rpx;display: flex;flex-direction: column}
.popup-content .button-hover{
  background: #fff;
  text-align: right;
}
.share-box{
  display: flex;padding: 40rpx 0;
}
.card{width: 50%;font-size: 30rpx;display: flex;flex-direction: column;align-items: center;color:#666 }
.popup-content .hr{
  display:block;content:'';width:100%;position:absolute;top:50%;border-top:2rpx solid #c3c3c3;opacity:0.6
}
.popup-content .share-container{
  text-align:center;position:relative;padding:44rpx 0;width:33%;margin:auto;letter-spacing:1rpx;
}
.popup-content .share-text{
  position:relative;padding:0 20rpx;color:#666;background-color:#fff;font-size: 30rpx
}
.popup-content .padding{
  background: #FF5806;margin-top: 0;font-size: 26rpx;
  color: #fff;position: absolute;bottom: 0;width: 100%;
  line-height: 74rpx;
  height: 74rpx
}
.share-box image{
  width: 125rpx;height: 125rpx;padding-bottom: 20rpx
}
.explain-images image{
  width: 100%;
  height: 1342rpx
}
.explain-image image{
  width: 100%;
  height: 1941rpx
}
.index image{
  width: 163rpx;
  height: 78rpx
}
.index{position: fixed;bottom:140rpx;right: 0;z-index: 999;}
 .djs{
  height: 80rpx;
  background: #fc464f;
  color: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items:center;
 }
 .js{
  font-weight: bold;
   font-size: 38rpx;
 }
 .time{
   font-weight: bold;
 }
 .groupNums{
   display: flex;
   flex-direction:row-reverse;
   align-items: center;
   height: 100rpx;
 }
 .groupNum{
   padding: 2rpx 10rpx;
   border: 1px solid  #fc464f;
   font-size: 20rpx;
   text-align: center;
   background: #ffffff;
   width: 100rpx;
   border-radius: 5rpx;
    margin-left: 10rpx;
    font-weight: bold;
    color:  #fc464f;
    height: 40rpx;
    line-height: 40rpx;
    overflow: hidden;
 }
.groupNums .active{
  background: #fc464f;
  color: white;
}
.cllist{
  display: flex;
  justify-content: space-between;
}
.headimg{
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  vertical-align: middle
}
.slide-item text{
  margin-left:10rpx;
}
.slide-item button{
  vertical-align: middle;
}
navigator{
 display: inline;
}
.ctbtn{
  background: #00C085;
  border: noen;
  color:#ffffff;
}
.grtitle{
  height: 50rpx;
  line-height: 50rpx;
}
.userBox{
  display: flex;
  justify-content: center;
  height: 200rpx;
}
.tzFlag{
  width: 60rpx;
  height: 30rpx;
  font-size: 25rpx;
  line-height: 30rpx;
  border-radius: 5rpx;
  background: #fc464f;
  color: #fff;
  text-align: center;
}
.userItem{
  margin-top: 60rpx;
}
.queshi{
  text-align: center;
  height: 80rpx;
  line-height: 80rpx;
}
.cleanbtn{
  border-radius: 0rpx;
  text-align: center !important;
}
.headDjs{
  display: flex;
}
.headBuy{
  display: flex;
  flex-direction: column;
}
.headBuy view{
  height: 40rpx;
}
.headprice{
  font-size:20rpx;
}
pages/groupbuy/groupList.js
New file
@@ -0,0 +1,226 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    productList: [],
    offset: 0,
    limit: 10,
    isEnd: false,
    shopId: '',
    toTopIcon: false,
    top_num: 0,
    totalNum: 0,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this = this;
     //获取banbber
     util.request({
      api: api.ad.getAdByCode,
      method: 'POST',
      data:{title:'拼团banner'},
      callback: function (data) {
        _this.setData({
          banner: data.rows[0],
        });
      }
    });
    this.getProductList();
    this.setData({
      shopId: app.shopInfo.id,
    });
    this.djs();
  },
  /**
   * 加载产品列表
   */
  getProductList: function () {
    var _this = this;
    var limit = _this.data.limit;
    var offset = _this.data.offset;
    util.request({
      api: api.groupBuy.showGroupByList,
      data: {
        "limit": limit,
        "offset": offset,
        "shopId": app.shopInfo.id,
      },
      callback: function (data) {
        if (data.rows.length == 0) {
          _this.setData({
            isEnd: true
          });
        } else {
          var productList = _this.data.productList;
          for (var i = 0; i < data.rows.length; i++) {
            productList.push(data.rows[i])
          }
          //更新下次调用的角标
          _this.setData({
            productList: productList,
            offset: offset + limit,
          });
        }
      }
    });
  },
  // 进入详情
  intoDetail(e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/groupbuy/groupDetails?id=' + id,
    })
  },
  //检查用户信息是否绑定
  checkUserInfoIsBuding() {
    if (util.isBlank(getApp().userInfo.nickName)) {
      wx.navigateTo({
        url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
      })
    } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
      wx.navigateTo({
        url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
      })
    }
  },
  //一键回到顶部
  goTap() {
    this.setData({ top_num: 0 })
  },
  scroll_distance: function (event) {
    this.setData({
      toTopIcon: event.detail.scrollTop > 300 ? true : false
    })
  },
  backtop: function () {
    this.setData({ top_num: 0 })
  },
  djs(){
    var _this=this;
    var interval = setInterval(function () {
      let productList = _this.data.productList;
      for(let i=0; i<productList.length; i++){
        let time = productList[i].time;
        time--;
        productList[i].time=time;
        if(time<0){
          continue;
        }else{
          productList[i].djs = util.getTimeSpance(time);
        }
      }
      _this.setData({
        productList: productList
      });
    }, 1000);
  },
  //转发
  onShareAppMessage(res) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    console.log("上拉");
    this.getProductList();
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/groupbuy/groupList.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/groupbuy/groupList.wxml
New file
@@ -0,0 +1,32 @@
<image mode="aspectFill"
       src="{{banner.imgUrl}}"></image>
<scroll-view class="scroll">
   <view wx:for="{{productList}}"  class="group" data-id="{{item.id}}"  bindtap="intoDetail">
        <image mode="aspectFit"
               src="{{item.goodsPic}}"></image>
        <view class="djs">
            <text class="js" >距结束</text>
            <text class="time">{{item.djs.day}}:{{item.djs.hour}}:{{item.djs.minute}}:{{item.djs.second}}</text>
        </view>
        <view class="footBox">
            <view class="title" >{{item.goodsName}}</view>
            <view class="description" >{{item.goodsIntro}}</view>
            <view class="price_box" >
              <text>
                <text class="price">¥{{item.nowPrice}}</text>
                <text class="price_line">¥{{item.prePrice}}</text>
              </text>
                <text bindtap="intoDetail" data-id="{{item.id}}" class="group_but">去拼团</text>
            </view>
        </view>
    </view>
</scroll-view>
  <view wx:if="{{productList.length==0}}" class="nodata">暂无数据</view>
  <view wx:if="{{productList.length!=0&&isEnd}}" class="nodata " >没有更多了</view>
pages/groupbuy/groupList.wxss
New file
@@ -0,0 +1,92 @@
.banner{
  height: 280rpx;
}
.scroll{
  margin:  5rpx;
}
.group{
  width: 360rpx;
  margin-left: 10rpx;
  float: left;
  background: #ffffff;
  border-radius: 5rpx;
  margin-top: 20rpx;
}
.group iamge{
  width: 360rpx;
}
 .djs{
  height: 50rpx;
  background: #fc464f;
  color: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items:center;
 }
 .js{
   opacity: 0.8;
 }
 .time{
   font-weight: bold;
 }
 .footBox{
   height: 160rpx;
   margin: 10rpx 10rpx;
 }
 .title{
   font-size: 32rpx;
 }
 .description{
  font-size: 24rpx;
  color: #939393;
  line-height: 24rpx;
  height:48rpx;
  overflow: hidden;
}
.price_box{
  height: 60rpx;
  margin-top: 10rpx;
  display: flex;
  justify-content: space-between;
  align-content: center;
}
.price{
  color: #df151f;
  font-size: 28rpx;
}
.price_line{
  font-size: 24rpx;
  color: #939393;
  text-decoration:line-through ;
  text-indent: 10rpx;
}
.group_but{
  color: #ffffff;
  background: #fc464f;
  display: inline-block;
  width: 120rpx;
  height: 50rpx;
  line-height: 50rpx;
  border-radius: 10rpx;
  text-align: center;
}
pages/groupbuy/groupOrder.js
New file
@@ -0,0 +1,448 @@
const app = getApp();
//拼团订单
const SHOW_MODEL_GROUP = 2;
//拼团订单结束
const SHOW_MODEL_GROUP_END = 3;
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  data: {
    address: {},
    addrDefault: "",
    hasAddress: false,
    total: 0,
    couponsShow: false, //优惠券
    delivery: [],
    key: 0,
    keydelivery: 0,
    isShow: true,
    selected: "",
    hidden: false,
    goodsList: [],
    skuList: [],
    usefulCoupon: [],
    coupons: '暂无可用优惠券', // 优惠券金额
    couponReceiveId: null, // 优惠券Id
    postage: '', //邮费
    showCoupon: false, //是否存在优惠券
    carId: '', //购物车id
    buttonClicked: false,
    checkedValue: false,
    deliverySelect: "物流配送",
    qsfy: "",
    pageScen: "",
    discountExplain: {},
    shopInfo: {},
  },
  onLoad(options) {
    var _this = this;
    this.setData({
      shopInfo: app.shopInfo
    });
  },
  onShow: function() {
    var _this = this;
    //获取收货地址
    _this.getAddress();
  },
  //计算订单价格
  jsjg() {
    var _this = this;
    let orderMsg = util.getOutStorage("orderMsg");
    let goodsInfo = orderMsg.goodsInfo;
    _this.setData({
      goodsList: [{
        imgMobile: goodsInfo.imgMobile,
        title: goodsInfo.title,
        name: orderMsg.specification,
        price: orderMsg.currentGrooupPrice.gpPrice,
        gpHeadPrice:orderMsg.currentGrooupPrice.gpHeadPrice,
        cartNumber: orderMsg.cartNumber,
      }],
      orderMsg: orderMsg,
    });
    //调用接口计算价格
    var goods = this.data.goodsList[0];
    var couponReceiveId = _this.data.couponReceiveId;
    let gpId = _this.data.orderMsg.currentGrooupPrice.id;
    let actId = _this.data.orderMsg.currentGrooupPrice.actId;
    var sendData = {
      actId: actId,//活动id
      gpId: gpId,//几人团
      addressId: _this.data.address.addrId, //收货地址ID
      remarks: _this.data.txtContent,
      skuId: goods.cartSkuId,
      productId: goods.cartProductId,
      count: goods.cartNumber,
      shopId: app.shopInfo.id,
      shippingMethod: this.data.deliverySelect,
    }
    if (_this.data.orderMsg.gjId) {
      sendData.gjId = _this.data.orderMsg.gjId;
    }
    util.request({
      api: api.groupBuy.calPrice,
      data: sendData,
      callback: function (data) {
        console.log(data);
       _this.setData({
         discountExplain: {
           billPrice: data.mapInfo.billPrice,
           postage: data.mapInfo.postage,
           payPrice:data.mapInfo.totalPrice
         },
       });
      }
    });
  },
  mySelect(e) {
    var name = e.currentTarget.dataset.name
    this.setData({
      tihuoWay: name,
      select: false
    })
  },
  //获取textarea里的值
  txtInput(e) {
    this.setData({
      txtContent: e.detail.value
    })
  },
  onShowText(e) {
    this.setData({
      isShow: true,
    })
  },
  onReady() {
    this.getTotalPrice();
  },
  /**
   * 计算总价
   */
  getTotalPrice() {
  },
  bindTextAreaBlur(event) {
    var value = event.detail.value;
    this.setData({
      txtContent: value,
    });
  },
  // 支付
  startPayment() {
    var _this = this;
    if (!_this.data.address) {
      wx.showToast({
        title: "请选择收货地址",
        icon: "none"
      });
      return;
    }
    wx.showLoading({
      title: '加载中',
      mask: true,
      duration: 2000
    });
    util.buttonClicked(this);
    var goods = this.data.goodsList[0];
    var couponReceiveId = _this.data.couponReceiveId;
    let gpId = _this.data.orderMsg.currentGrooupPrice.id;
    let actId = _this.data.orderMsg.currentGrooupPrice.actId;
    var sendData = {
      actId: actId, //活动id
      gpId: gpId, //几人团
      addressId: _this.data.address.addrId, //收货地址ID
      remarks: _this.data.txtContent,
      skuId: goods.cartSkuId,
      productId: goods.cartProductId,
      count: goods.cartNumber,
      shopId: app.shopInfo.id,
      shippingMethod: this.data.deliverySelect,
    }
    console.log("订单请求参数", sendData)
    var url = api.groupBuy.createGroupBuy;
    if (_this.data.orderMsg.gjId) {
      //存在指定团队,则调用加入该团的接口
      url = api.groupBuy.joinGroupBuy;
      sendData.gjId = _this.data.orderMsg.gjId;
    }
    util.request({
      api: url,
      data: sendData,
      callback: function(data) {
        wx.requestPayment({
          'timeStamp': data.rows[0].timeStamp,
          'nonceStr': data.rows[0].nonceStr,
          'package': data.rows[0].prepay_id,
          'signType': 'MD5',
          'paySign': data.rows[0].paySign,
          'success': function(res) {
            // console.log(res.errMsg)
            console.log("成功后的回调")
            console.log(res)
            if (res.errMsg == 'requestPayment:ok') {
              // console.log(data.mapInfo.orderId);
              //成功后的回调;
              util.request({
                method: "GET",
                api: '/wxapi/shopOrder/findOrderPayStatus/' + data.mapInfo.orderId,
                mask: true,
                callback: function(payRes) {
                  debugger
                  if (payRes.mapInfo.status == 'success') {
                    //传输分享数据到订单成功页面
                    var shareData = {
                      id: actId, //活动id
                      gpId: gpId, //几人团
                      shopId: app.shopInfo.id,
                      actId: actId, //活动id
                      title: "[拼团]" + _this.data.goodsList[0].title,
                      imageUrl: _this.data.goodsList[0].imgMobile,
                      gjId:payRes.mapInfo.gjId,
                    };
                    wx.setStorageSync("shareData", shareData);
                    wx.redirectTo({
                      url: '../payOrder/paySuccess?showModel=' + payRes.mapInfo.groupBuyStatus,
                    });
                    wx.showToast({
                      title: payRes.mapInfo.msg,
                      icon: 'success'
                    })
                  } else {
                    wx.showToast({
                      title: payRes.mapInfo.msg,
                      duration: 2000,
                      image: "/image/fail.png"
                    })
                    wx.redirectTo({
                      url: '../payOrder/payError',
                    })
                  }
                }
              });
            } else {
              // console.log("支付失败");
              wx.redirectTo({
                url: '../order/order',
              })
            }
            //{errMsg: "requestPayment:ok"}
          },
          'fail': function(res) {
            wx.redirectTo({
              url: '../order/order?status=1',
            })
          }
        });
      }
    });
  },
  // 进入收货地址列表
  goAddress(e) {
    wx.navigateTo({
      url: '../editAddress/editAddress?pageScen=2',
    })
  },
  // 进入添加收货地址
  addAddress() {
    wx.navigateTo({
      url: '../editAddress/editAddress?pageScen=2',
    })
  },
  //设置地址
  setAddress(address) {
    debugger
    this.setData({
      "address": address,
      hasAddress: true
    });
  },
  //隐藏弹窗
  popupTap(e) {
    this.setData({
      couponsShow: false,
      isShow: false
    })
  },
  total(e) {
    this.setData({
      isShow: true
    })
  },
  // 获取默认地址
  getAddress() {
    var _this = this;
    util.request({
      api: api.address.queryaddress,
      callback: function(data) {
        if (data.rows.length != 0) {
          _this.setData({
            address: data.rows[0],
            hasAddress: true
          });
        } else {
          _this.setData({
            hasAddress: false
          })
        }
        _this.jsjg();
      }
    });
  },
  // 不使用优惠券按钮
  checkedTap: function() {
    var checked = this.data.checkedValue;
    var couponReceiveId = this.data.couponReceiveId;
    if (!checked) {
      couponReceiveId = 1
      this.setData({
        coupons: '不使用优惠券',
        couponReceiveId: couponReceiveId
      })
    }
    this.setData({
      checkedValue: !checked,
      couponsShow: false
    })
    this.jsjg();
  },
  //优惠券
  couponsChoice(e) {
    this.setData({
      couponsShow: true,
      isShow: true
    })
  },
  //优惠券
  radioCouponsChange(e) {
    var checked = e.detail.value;
    var changed = {}
  },
  //优惠券选择
  couponsEvent(e) {
    var _this = this;
    var coupon = e.currentTarget.dataset.coupon;
    var index = e.currentTarget.dataset.index;
    var id = e.currentTarget.dataset.id;
    var usefulCoupon = _this.data.usefulCoupon;
    var changed = {};
    for (var i = 0; i < usefulCoupon.length; i++) {
      if (i == index) {
        changed['usefulCoupon[' + i + '].checked'] = true;
      } else {
        changed['usefulCoupon[' + i + '].checked'] = false
      }
    }
    _this.setData(changed)
    _this.setData({
      coupons: coupon.cName,
      couponsShow: false,
      isShow: false,
      couponReceiveId: id,
      checkedValue: false
    })
    this.jsjg();
  },
})
pages/groupbuy/groupOrder.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "订单详情"
}
pages/groupbuy/groupOrder.wxml
New file
@@ -0,0 +1,92 @@
<view class="main">
  <view class="order-add-address">
    <view wx:if="{{hasAddress}}" class="orders-address" bindtap='goAddress' data-id="{{address.addrId}}">
      <view class="iconfont icon-address"></view>
      <view class="order-list">
        <view>
          <text class="orders-address-name threeblack">{{address.addrLiaisonman}}</text>
          <text class="orders-address-phone grey">{{address.addrTelephone}}</text>
        </view>
        <view class='orders-address-item'>
          <text wx:if="{{address.addrDefault==1}}" class="default">默认</text>
          <view class="orders-address-detail">{{address.addrRegion}}</view>
        </view>
      </view>
    </view>
    <view wx:else class="orders-no-address" bindtap='addAddress'>
      <text class="iconfont icontianjia"></text>
      <text decode="{{true}}">&ensp;添加收货地址</text>
    </view>
    <image  src='http://file.micromall.xczhyf.cn/wxxcx/image/15.png' class="division"></image>
  </view>
  <view class="orders-box">
    <view wx:for="{{goodsList}}" wx:key="index" class="orders-list">
      <view wx:if="{{item != null}}">
        <image mode="aspectFit" class="orders-thumb" src="{{item.imgMobile}}"></image>
        <view class='order-detail'>
          <view>
            <view class="orders-pro-name">{{item.title}}</view>
            <view class="order-norms"><text class="lables" >拼团</text>规格:{{item.name}}</view>
            <view class="orders-pro-price">¥{{item.price}}</view>
            <!-- TODO  -->
          </view>
        </view>
        <view class="orders-count-num">×{{item.cartNumber}}</view>
      </view>
    </view>
  </view>
<view class="orders-bottom">
    <view class="orders-bottom-text">
      <text>下单门店</text>
      <view class="orders-bottom-text-right"  >
        <text> {{shopInfo.shopShortName}}</text>
      </view>
    </view>
    <view class="orders-bottom-text">
      <text>配送方式</text>
      <view class="orders-bottom-text-right"  >
        <text>{{deliverySelect}}</text>
        <text wx:if="{{deliverySelect=='立即配送' && discountExplain.postage>0  }}">(注:满{{qsfy}}元免配送费)</text>
      </view>
    </view>
    <view class="orders-bottom-text remarks">
      <text>买家留言</text>
      <input class='orders-bottom-text-input' bindchange="bindTextAreaBlur" type='text' placeholder='买家留言'></input>
    </view>
  </view>
  <view class="orders-bottom-yh youhui-box">
    <view class="youhui-item">
      <text class="left" >商品金额</text>
      <text class="right">¥{{discountExplain.billPrice}}</text>
    </view>
    <view class="youhui-item">
      <text class="left">运费 </text>
      <text class="right">¥{{discountExplain.postage}}</text>
    </view>
    <view class="line"></view>
    <view class="youhui-item">
      <text class="left">实际支付</text>
      <text class="right orders-footer-total-money">¥{{discountExplain.payPrice}}</text>
    </view>
  </view>
  <cover-view class="orders-footer" bind:tap="total">
    <cover-view class="orders-footer-total">合计金额:
      <cover-view class='orders-footer-total-money'>¥{{discountExplain.payPrice}}</cover-view>
    </cover-view>
    <cover-view class="orders-footer-btn" bindtap="startPayment">确认订单 </cover-view>
  </cover-view>
</view>
pages/groupbuy/groupOrder.wxss
New file
@@ -0,0 +1,396 @@
.main {
  margin: 0 18rpx;
  padding-bottom: 20rpx;
}
.icon-address{color: #00C085;font-size: 40rpx;margin: 25rpx 22rpx 0 22rpx}
.orders-address {
  position: relative;
  padding: 25rpx 0;
  display: flex;
  font-size: 14px;
  line-height: 25px;
  color: #adadad;
}
.orders-address-detail{font-size: 26rpx;color: #666;line-height: 30rpx;width: 459rpx}
.orders-address::after {
  position: absolute;
  right: 40rpx;
  top: 60rpx;
  content: '';
  width: 20rpx;
  height: 20rpx;
  border-top: 4rpx solid #999;
  border-right: 4rpx solid #999;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.default {
  width: 44rpx;
  height: 23rpx;
  font-size: 14rpx;
  border-radius: 9rpx;
  color: #fff;
  display: block;
  text-align: center;
  line-height: 23rpx;
  background-color: #FF4606;
  margin-top: 6rpx;
  margin-right: 5rpx
}
.order-list{width: 470rpx;}
.orders-address-item{display:flex}
.orders-address-name {
  display: inline-block;
  font-size: 34rpx;
  margin-right: 20rpx
}
.orders-no-address {
  font-size: 26rpx;
  position: relative;
  line-height: 100rpx;
  color: #666;
  text-align: center;
}
.orders-box {
  padding-bottom: 0rpx;
}
.orders-list {
  position: relative;
  height: 180rpx;
  margin-bottom: 10rpx;
  background-color: #fff;
  border-radius: 10rpx;
  display: flex;
  padding: 30rpx 0;
}
.orders-list>view {
  display: flex;
}
.orders-thumb {
  width: 167rpx;
  height: 159rpx;
  margin: 0 23rpx;
}
.orders-pro-name {
  color: #333;
  margin: 10rpx 0 10rpx 0;
  font-weight: bold;
  font-size: 30rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-norms {
  color: #999;
  font-size: 26rpx;
}
.order-detail {
  width: 417rpx;
}
.orders-pro-price {
  margin-top: 29rpx;
  color: #ff4606;
  font-size: 32rpx;
  font-weight: bold;
}
.orders-count-num {
  margin-top: 125rpx;
  font-size: 34rpx;
  width: 50rpx;
  color: #b3b3b3;
}
.orders-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 106rpx;
  line-height: 106rpx;
  background: #fff; box-sizing: border-box;
  display: flex;z-index: 99;
  overflow: hidden
}
.orders-footer .orders-footer-total {
  width: 504rpx;
  padding-left: 38rpx;
  color: #666;
  font-size: 26rpx;
  display: flex;align-items: center;line-height: 106rpx
}
.orders-footer-total-money {
  color: #ff5e10;
  font-weight: bold;
  font-size: 32rpx;
}
.orders-footer .orders-footer-btn {
  display: inline-block;
  width: 246rpx;
  height: 106rpx;
  text-align: center;
  color: #fff;
  background: #e74a05;
  font-size: 28rpx;
  padding: 0 5rpx;
  line-height: 106rpx
}
.orders-bottom-text {
  display: flex;
  line-height: 100rpx;
  font-size: 26rpx;
  margin: 0 20rpx;
}
.orders-bottom-text>text {
  color: #333;
  font-weight: bold;
  font-size: 30rpx;
}
.orders-bottom {
  padding-bottom: 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 10rpx;
}
.orders-bottom-text text {
  margin: 0 15rpx;
}
/* .remarks {
  flex-direction: column;
} */
.orders-bottom-text>text {
  width: 30%;
}
.orders-bottom-text-right {
  display: flex;
  width: 70%;
  justify-content: flex-end;
  color: #666;
}
.orders-bottom-text-right-last {
  color: #ff3f3a;
}
.orders-bottom-text-input {
  margin: 0rpx 20rpx;
  height: 100rpx;
  width: 100%;
  padding-left: 10rpx;
  border-radius: 10rpx;
  font-size: 26rpx;
  line-height: 100rpx;text-align: right
}
.youhui-box{
  line-height: 100rpx;
  font-size: 26rpx;
  padding-bottom: 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 100rpx;
}
.youhui-item{
  width: 100%;
}
.youhui-box .left{
  text-align: left;
  padding-left: 15px;
  display: inline-block;
  width: 20%;
}
.youhui-box .right{
  text-align: right;
   padding-right: 15px;
  display: inline-block;
   width: 60%;
}
/* 下拉列表 */
.list-msg {
  background-color: #fff;
  position: relative;
}
.list-msg .list-msg2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.select_box {
  background-color: #fff;
  width: 93%;
  position: absolute;
  top: 80rpx;
  z-index: 1;
  overflow: hidden;
  animation: myfirst 0.5s;
}
.select_one {
  height: 60rpx;
  line-height: 60rpx;
  border-bottom: 1px solid #ccc;
}
.icon-jia {
  color: #666;
  font-weight: bold;
}
.division{
  height: 6rpx;
  display: block;
  margin-bottom: 10rpx;
}
.getShopStore, .delivery {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 688rpx;
  background: #fff;
  border-radius: 10px 10px 0px 0px;
}
.getShopStore, .delivery text {
  font-size: 26rpx;
  font-weight: bold;
}
/* page{
  background-color: skyblue!important
} */
.choice {
  width: 686rpx;
  margin: auto;
  color: #999;
  display: flex;
  align-items: center;
  padding-top: 28rpx;
}
.choice .title {
  width: 96%;
  display: block;
}
.icon-quxiao {
  font-size: 38rpx;
}
.label-2 {
  font-size: 30rpx;
  line-height: 100rpx;
}
.label-2__icon {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 40rpx;
  height: 40rpx;
  border-radius: 50%;
  border: 1px solid #999;
  left: 88%;
}
.icon-checked {
  background-image: url(http://file.micromall.xczhyf.cn/wxxcx/image/20.png);
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
}
.active .label-2__icon {
  background: #00c085;
  border: none;
}
radio-group {
  height: 500rpx;
  overflow-y: scroll;
  margin-top: 29rpx;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  height: 500rpx;
  overflow-y: hidden;
  padding-bottom: 143rpx;
}
.coupons-container{margin: 0;position: relative}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons .money::after{
left: 280rpx;
}
.coupons-list .coupons-container:last-child{padding-bottom: 106rpx}
button {
  line-height: 106rpx;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  font-size: 30rpx;
  padding-left: 0;
  padding-right: 0;
  color: #333;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden
}
.button-hover{
  /* color:#fff; */
  background-color: rgba(0,0,0,0);
}
button:after {
  border: 0px;
  color: #333;
}
.coupons-list radio-group{margin-top: 0}
.coupons-one{
  font-size: 30rpx;
  color: #333;
  display: flex;
  align-items: center;
  width: 90%;
  margin: 30rpx auto;
}
.checked-lable{
  width: 100%;display: flex;white-space: nowrap
}
.radio-one{
  width: 70%;text-align: right
}
radio{
    transform: scale(0.8);
}
pages/groupbuy/invited.js
New file
@@ -0,0 +1,67 @@
// pages/groupbuy/invited.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    headImg: 'https://wx.qlogo.cn/mmopen/vi_32/EPQ0sC241zkbLm1wkIcpYTiaI6oibp2RGziaVg0StQN49mjxbKg4gKlew6KCDuGibM9jS7qwN67Kpz1uYYov2p7LgQ/132',
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/groupbuy/invited.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/groupbuy/invited.wxml
New file
@@ -0,0 +1,41 @@
<view>
  <image src="https://filehive2.jyymatrix.cc/uploadeFile/image/1b6453892473a467d07372d45eb05abc2031647a/20200225/cfbd04aa84c24e21bf7fe2a69438cea2.jpg"></image>
  <view>
    <view>肌肽轻肤原液</view>
    <view>
      <text>¥500</text>
      <text>¥566</text>
    </view>
  </view>
  <view>
    <text class="iconfont iconright"></text>
  </view>
</view>
<view>
  <view class="upBox" ></view>
  <view class="dowonBox" >
    <view class="userBox">
      <view class="userItem">
        <image src="{{headImg}}" class="headimg" />
        <view class="tzFlag">团长</view>
      </view>
      <view class="userItem">
        <image src="{{headImg}}" class="headimg" />
      </view>
      <view class="userItem">
        <image src="{{headImg}}" class="headimg" />
      </view>
    </view>
    <view class="queshi">还差1人,<text class="djs" >5天24时56分23秒</text>后活动结束</view>
    <view>和他组团</view>
  </view>
</view>
pages/groupbuy/invited.wxss
New file
@@ -0,0 +1,36 @@
.userBox{
  display: flex;
  justify-content: center;
  height: 200rpx;
}
.tzFlag{
  width: 60rpx;
  height: 30rpx;
  font-size: 25rpx;
  line-height: 30rpx;
  border-radius: 5rpx;
  background: #fc464f;
  color: #fff;
  text-align: center;
}
.userItem{
  margin-top: 60rpx;
}
.queshi{
  text-align: center;
  height: 40rpx;
}
.headimg{
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  vertical-align: middle
}
.djs{
  color: #df2525;
}
pages/index-back/index.js
New file
@@ -0,0 +1,105 @@
//index.js
//获取应用实例
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
    data: {
        banners: [
        ],
        iconUrls: [
        ],
        indexAds: [
        ],
    },
    onLoad: function () {
    util.userLogin(function () {
        console.log("登录成功");
    });
      this.getLbt();
      this.getNav();
      this.getIndexAds();
    },
  getIndexAds: function () {
    var _this = this;
    util.request({
      method: 'GET',
      api: api.ad.getByType + "indexAds",
      callback: function (data) {
        console.log(data.rows);
        _this.setData({
          indexAds: data.rows
        });
      }
    });
  },
  getNav: function () {
    var _this = this;
    util.request({
      method: 'GET',
      api: api.ad.getByType + "indexNav",
      callback: function (data) {
        console.log(data.rows);
        _this.setData({
          iconUrls: data.rows
        });
      }
    });
  },
  getLbt:function(){
    var _this = this;
    util.request({
      method: 'GET',
      api: api.ad.getByType + "sylbt",
      callback: function (data) {
        console.log(data.rows);
        _this.setData({
          banners: data.rows
        });
      }
    });
  },
    goAd(e){
        var title = e.currentTarget.dataset.title;
        var jumppath = e.currentTarget.dataset.jumppath;
        if (jumppath == '/pages/service/service' ||
            jumppath == '/pages/yuyue/khyuyue' ){
                wx.switchTab({
                    url: jumppath,
                    fail:function(e){
                        console.log(e);
                    },
                });
        } else{
            wx.navigateTo({
                url: jumppath,
            })
        }
    },
})
pages/index-back/index.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/index-back/index.wxml
New file
@@ -0,0 +1,34 @@
<swiper  autoplay interval="5000" circular='true' previous-margin="40rpx" next-margin="40rpx" >
    <block wx:for="{{banners}}" wx:key="ids">
        <swiper-item>
            <navigator url='{{item.jumpPath}}'>
                <image mode="aspectFill" src="{{item.imgUrl}}" class="slide-image {{currentIndex == index ? 'active': ''}}"/>
            </navigator>
        </swiper-item>
    </block>
</swiper>
<view class="dots">
    <block wx:for="{{imgUrls}}" wx:key="unique">
        <view class="dot{{index == currentIndex ? ' active' : ''}}"></view>
    </block>
</view>
<view class="nav_container">
    <block wx:for="{{iconUrls}}" wx:key="key">
        <view  class="icon_item"   bindtap="goAd"  data-jumpPath="{{item.jumpPath}}" data-title="{{item.title}}" >
                <image mode="aspectFill" src="{{item.imgUrl}}"></image>
                <text class="icon_title">{{item.title}}</text>
        </view>
    </block>
</view>
<view class="nav_container">
<block wx:for="{{indexAds}}" wx:key="key">
    <view  class="ads" data-id="{{item.attrId}}">
    <navigator url='{{item.jumpPath}}'>
        <image mode="aspectFit"  mode='widthFix' src="{{item.imgUrl}}"></image>
    </navigator>
    </view>
</block>
</view>
pages/index-back/index.wxss
New file
@@ -0,0 +1,69 @@
swiper {
    height: 360rpx;
    width: 100%;
}
.slide-image {
    position: absolute;
    height: 350rpx;
    width: 98%;
    z-index: 5;
    top: 10rpx;
    margin-left: 5rpx;
    margin-right: 5rpx;
    border-radius: 20rpx;
}
.active {
    opacity: 1;
    z-index: 10;
    height: 350rpx;
    top: 10rpx;
    transform: scale(1.0);
    transition: all 0.2s ease-in 0s;
    /* transition: all .625s ease; *//* transition: all 0.2s ease-in 0s; *//* transform:scale(0.7); */
}
.nav_container {
    display: flex;
    flex-wrap: wrap;
    padding-top: 50rpx;
}
.icon_item {
    width: 33.33333%;
    text-align: center;
    margin: auto;
    padding-bottom: 27rpx;
}
.icon_item text {
    display: block;
    color: #626262;
    font-size: 30rpx;
    margin-top: 15rpx;
}
.icon_item image {
    width: 100rpx;
    height: 100rpx;
    border-radius: 50%;
}
.title_img {
    width: 100%;
    height: 120rpx;
    margin-top: 20rpx;
}
.ads{
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}
.ads image{
   width: 95%;
}
pages/index/index.js
New file
@@ -0,0 +1,191 @@
//index.js
//获取应用实例
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
Page({
  data: {
    adNodes: [],
    distance: 0,
    size: 30,
    step: 1,
    interval: 20,
  },
  onLoad: function(options) {
    util.userLogin(function() {
      console.log("登录成功");
    });
    //获取首页所有的节点元素
      this.getAdNodes();
    //获取小程序码中的店铺id
    if (options.scene) {
      const shopId = decodeURIComponent(options.scene);
      //获取门店信息
      util.request({
        api: api.yuyue.findShopInfoById + "/" + shopId,
        callback: function (data) {
          app.shopInfo = data.mapInfo.shopInfo;
          wx.setNavigationBarTitle({
            title: app.shopInfo.shopShortName
          });
        },
        checkLogin: true,
      });
    }
  },
  onShow: function() {
    wx.setNavigationBarTitle({
      title: app.shopInfo.shopShortName
    });
  },
  changeShop() {
    wx.navigateTo({
      url: "/pages/yuyue/choseShop",
    });
  },
  getAdNodes: function() {
    console.log('加载广告');
    var _this = this;
    util.request({
      method: 'POST',
      api: api.ad.getAdPage,
      data: {
        "pageCode": "index",
      },
      callback: function(data) {
        let hasPmd = false;
        for (let i = 0; i < data.rows.length; i++) {
          let node = data.rows[i];
          //处理属性节点
          console.log(node.nodeAttribute);
          if (node.nodeAttribute != null) {
            node.nodeAttribute = JSON.parse(node.nodeAttribute);
          }
          if (node.nodeType == 5) {
            //处理跑马灯,一个页面只支持一个跑马灯
            var length = node.nodeValue.length * _this.data.size;
            _this.setData({
              length: length
            });
            hasPmd = true;
          }
        }
        _this.setData({
          adNodes: data.rows
        });
        if (hasPmd) {
          _this.scrollling();
        }
      }
    });
  },
  /**
   * 点击广告节点事件
   */
  clickAdnode(e) {
    var linkType = e.currentTarget.dataset.linktype;
    var linkUrl = e.currentTarget.dataset.linkurl;
    if (linkType == 1) {
      wx.switchTab({
        url: linkUrl,
        fail: function(e) {
          console.log(e);
        },
      });
    } else if (linkType == 2) {
      wx.navigateTo({
        url: linkUrl,
      })
    } else if (linkType == 3) {
      wx.navigateTo({
        url: "/pages/webView/webView?url=" + linkUrl,
      })
    }
  },
  scrollling: function() {
    var that = this;
    var interval = setInterval(function() {
      var maxscrollwidth = that.data.length;
      var left = that.data.distance;
      if (maxscrollwidth + left > 1) {
        that.setData({
          distance: left - that.data.step
        })
      } else {
        that.setData({
          distance: 0
        });
        clearInterval(interval);
        that.scrollling();
      }
    }, that.data.interval);
  },
  setShopTitle() {
    wx.setNavigationBarTitle({
      title: app.shopInfo.shopName
    });
  },
  //转发
  onShareAppMessage(res) {
  },
})
pages/index/index.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/index/index.wxml
New file
@@ -0,0 +1,70 @@
<!--
<navigator url="/pages/groupbuy/groupList">团购</navigator>
<navigator url="/pages/miaosha/msList">秒杀2</navigator>
<navigator url="/pages/shalong/shalongList">沙龙</navigator>
  -->
<block wx:for="{{adNodes}}" wx:key="ids">
  <!-- 图片展示 1.image  2.text 3.swiper 4.video -->
  <block wx:if="{{item.nodeType==1}}">
    <image data-linkUrl="{{item.linkUrl}}" data-linkType="{{item.linkType}}" bindtap="clickAdnode" style="{{item.nodeStyle}}" mode="{{item.nodeAttribute.mode}}" src="{{item.nodeValue}}"></image>
  </block>
<!-- 文字展示 -->
  <block wx:if="{{item.nodeType==2}}">
    <text data-linkUrl="{{item.linkUrl}}" data-linkType="{{item.linkType}}"  bindtap="clickAdnode" style="{{item.nodeStyle}}">{{item.nodeValue}}</text>
  </block>
<!-- 轮播图展示 -->
  <block wx:if="{{item.nodeType==3}}">
    <swiper autoplay  style="{{item.nodeStyle}}" interval="{{item.nodeAttribute.interval}}" circular='{{item.nodeAttribute.circular}}' previous-margin="{{item.nodeAttribute.previous-margin}}" next-margin="{{item.nodeAttribute.next-margin}}">
      <block wx:for="{{item.ads}}" wx:for-item="img" wx:key="ids2">
        <swiper-item>
            <image
              bindtap="clickAdnode"
               data-linkUrl="{{img.linkUrl}}"
               data-linkType="{{img.linkType}}"
               mode="{{item.nodeAttribute.mode}}"
               src="{{img.imgUrl}}"
               style="{{item.nodeStyle}}" />
        </swiper-item>
      </block>
    </swiper>
  </block>
<!-- 视频展示 -->
  <block wx:if="{{item.nodeType==4}}">
     <video data-linkUrl="{{item.linkUrl}}" bindtap="clickAdnode" style="{{item.nodeStyle}}"  id="myVideo"
      poster="{{item.nodeAttribute.poster}}" controls="true"
      src="{{item.nodeValue}}"
      object-fit="fill"></video>
  </block>
<!-- 跑马灯组件 -->
  <block wx:if="{{item.nodeType==5}}">
    <view class="notice">
        <text class="iconfont iconlaba" style="{{item.nodeAttribute.iconStyle}}"></text>
        <view class="content" >
            <text class="notice_text" style="left:{{distance}}rpx;{{item.nodeStyle}}"   >{{item.nodeValue}}</text>
        </view>
    </view>
  </block>
<!-- 滑块展示 -->
  <block wx:if="{{item.nodeType==6}}">
    <scroll-view scroll-x
     class="huakuai" style=" {{item.nodeAttribute.style}}" >
            <image  wx:for="{{item.ads}}" wx:for-item="img" wx:key="ids2"
              bindtap="clickAdnode"
               data-linkUrl="{{img.linkUrl}}"
               data-linkType="{{img.linkType}}"
               mode="{{item.nodeAttribute.mode}}"
               src="{{img.imgUrl}}"
               style="{{item.nodeStyle}}" />
    </scroll-view>
  </block>
</block>
<view class="changeShop" bindtap="changeShop">
   切换门店<text class="iconfont icondown"></text>
</view>
pages/index/index.wxss
New file
@@ -0,0 +1,60 @@
page {
  background: #efefef;
  width: 100%;
  overflow-x: hidden;
}
.notice {
  width: 100%;
  height: 80rpx;
  line-height: 60rpx;
  background: #fff;
}
.notice>.iconfont {
  color: #e64211;
  display: inline-block;
  overflow: hidden;
  line-height: 80rpx;
  width: 40rpx;
}
.notice>.content {
  color: #ee2929;
  white-space: nowrap;
  font-size: 20rpx;
  height: 80rpx;
  line-height: 80rpx;
  width: 660rpx;
  display: inline-block;
  overflow: hidden;
}
.notice_text {
  position: relative;
  font-size: 30rpx;
}
.huakuai {
  width: 100%;
  white-space: nowrap;
}
.changeShop {
  position: absolute;
  top: 20rpx;
  right: 16rpx;
  background: #ffffff;
  opacity: 0.7;
  width: 140rpx;
  height: 40rpx;
  border-radius: 36rpx;
  font-size: 20rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.changeShop .icondown{
  top: 5rpx;
}
pages/logistics/logistics.js
New file
@@ -0,0 +1,125 @@
// pages/logistics/logistics.js
var util = require('../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    logisticsList:[],
    order:{},
    logisticsInfo: {},
    inform: true,
    info:""
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getLogisticsInfo(options.id);
    this.getOrderInfo(options.id)
    // 判断是否从通知跳进来
    if (options.inform == '1') {
      this.setData({
        inform: false
      })
    }
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  },
  // 获取物流信息
  getLogisticsInfo:function(id){
    var _this = this;
    util.request(
        {method:"GET",
        api: "/wxapi/ShopLogisticsQuery/getLogisticsInformation/"+id,
        callback: function (data) {
      if (data.status == 200) {
        if (data.rows == null) {
        }else{
          for (var i = 0; i < data.rows.length; i++) {
            data.rows[i].logisticsTime = data.rows[i].logisticsTime.substring(5, 16)
          }
        }
        _this.setData({
          logisticsList: data.rows,
          logisticsInfo:data.mapInfo,
          info: data.info
        })
      }
    }});
  },
  // 获取订单信息
  getOrderInfo:function(id){
    var _this = this;
    util.request({method:"GET", api:"/wxapi/shopOrder/getOrderInfoById/" + id, callback: function (data) {
        if (data.rows.length != 0) {
          for (var i = 0; i < data.rows.length; i++) {
            data.rows[i].paymentTime = data.rows[i].paymentTime.substring(5, 16).replace(/T/g, ' ')
          }
        }
        _this.setData({
          order: data.rows[0]
        })
    }});
  },
  // 回到首页
  goBack() {
    wx.switchTab({
      url: '../index/index'
    })
  },
})
pages/logistics/logistics.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "物流信息"
}
pages/logistics/logistics.wxml
New file
@@ -0,0 +1,91 @@
<view class="main">
  <view class='logistics-container'>
    <view class='logistics-list'>
      <view class='logistics-detail radius'>
        <image class='logistics-image' mode="aspectFit" src="{{order.details[0].shopProduct.imgMobile}}"></image>
        <view class='logistics-express'>
          <text class='name'>
                <text wx:if="{{logisticsInfo.logisticsInfo.logisticsStatus == '1'}}">已揽件</text>
                <text wx:if="{{logisticsInfo.logisticsInfo.logisticsStatus == '2'}}">运输中</text>
                <text wx:if="{{logisticsInfo.logisticsInfo.logisticsStatus == '3'}}">已签收</text>
                <text wx:if="{{logisticsInfo.logisticsInfo.logisticsStatus == '4'}}">待取件</text>
                <text wx:else>{{info==null?'':info}}</text>
          </text>
          <view class='express'>
            <view class='grey'>{{logisticsInfo.logisticsInfo.logisticsCompany}}</view>
            <view class='grey'>{{logisticsInfo.logisticsInfo.waybillNo}}</view>
          </view>
        </view>
        <view>
          <view class='contact_list'>
            <button open-type='contact'>
              <view class="iconfont iconkefu"></view>
              客服
            </button>
          </view>
        </view>
      </view>
      <view class='logistics-content'>
        <view class='logistics-info'>
          <view>
            <view class='harvest'>收</view>
            <text decode="{{true}}" class='address-info'>【收货地址】&nbsp;{{order.deliveryInfo.receiveAddress}}</text>
          </view>
        </view>
        <view wx:for="{{logisticsList}}">
          <view class='logistics-info' wx:if="{{item.state != 0}}">
            <view>
              <text class='time' decode="{{true}}">{{item.logisticsTime}}</text>
              <view class='logistics-close'>
                <view class='online-top-close'></view>
                 <view class='dot-close'></view>
                <!-- <view class='iconfont icon-fahuo'></view> -->
                <view class='online-bottom'></view>
              </view>
              <view class='info'>
                <text wx:if="{{item.state == 1}}">已揽件</text>
                <text wx:if="{{item.state == 2}}">运输中</text>
                <text wx:if="{{item.state == 3}}">已签收</text>
                <text wx:if="{{item.state == 4}}">待取件</text>
                <text>{{item.describe}}</text>
              </view>
            </view>
          </view>
           <view class='logistics-info' wx:if="{{item.state == 0}}">
              <view>
                <text class='time'>{{item.logisticsTime}}</text>
                <view class='logistics-close'>
                    <view class='online-top-close'></view>
                    <view class='dot-close'></view>
                    <view class='online-bottom'></view>
                  </view>
                <view class='info'>
                  <text>{{item.describe}}</text>
                </view>
              </view>
            </view>
        </view>
        <view class='logistics-info' >
              <view>
                <text class='time'>{{order.paymentTime == null?'':order.paymentTime}}</text>
                <view class='logistics-close'>
                    <view class='online-top-close'></view>
                    <!-- <view class='iconfont icon-dingdan border'></view> -->
                     <view class='dot-close'></view>
                    <view class='online-bottom'></view>
                  </view>
                <view class='info'>
                  <text>已下单</text>
                  <text>您的订单待配货</text>
                </view>
              </view>
            </view>
      </view>
    </view>
  </view>
</view>
<view bindtap="goBack"  hidden="{{inform}}" class="goIndex">回到首页</view>
pages/logistics/logistics.wxss
New file
@@ -0,0 +1,89 @@
view,text,navigator {
font-size: 12px;
}
.logistics-content{font-size: 22rpx;color: #868686;background: #fff;padding: 31rpx 0 ;margin: 0 20rpx 10rpx 20rpx;}
.harvest{margin-left: 76rpx;
text-align: center;color: #fff;
border-radius: 50%;background: #FF4606;padding: 10rpx 14rpx}
.address-info{color: #333;margin-left: 14rpx;width: 80%}
.logistics-content>view{display: flex}
.logistics-info>view{display: flex;align-items: center;padding: 0 25rpx;overflow: hidden;}
.icon-fahuo{background:linear-gradient(90deg,rgba(10,206,146,1),rgba(0,192,133,1));
border-radius:50%;color: #fff;font-size:36rpx ;margin-left: 14rpx}
.transport{color: #333}
.transport>view{display: flex}
.transport .info>text{display: block}
.logistics-close{display: flex;flex-direction: column;margin: 0 28rpx;}
.online-top-close {
  width: 1rpx;
  height: 80rpx;
  background: #f7f7f7;
  margin-left: 5rpx
}
.dot-closing {
  width: 10rpx;
  height: 10rpx;
  border-radius: 50%;
  margin-top: 6rpx;
  margin-bottom: 6rpx;
  background: #DDDDDD;
}
.time{width: 80rpx;}
.dot-close {
  width: 10rpx;
  height: 10rpx;
  border-radius: 50%;
  margin-top: 6rpx;
  margin-bottom: 6rpx;
  background: #DDDDDD;
}
.time{margin-top: 41rpx}
.info{margin-top: 65rpx;margin-left: 17rpx}
.info>text{display: block;width: 511rpx}
.logistcs-addressinfo{display: flex}
.transport .online-top-close{margin-left: 35rpx}
.iconfont{
  width:48rpx;
height:48rpx;
line-height: 48rpx;
border-radius: 50%;
text-align: center;
font-size: 40rpx
}
.border{
  border: 2rpx solid #DDDDDD;
  margin-left: -20rpx
}
.logistics-image{width: 120rpx;height: 80rpx;margin: 30rpx;}
.logistics-detail{display: flex;background: #fff;margin: 20rpx 20rpx 10rpx 20rpx}
button {
  line-height: 49rpx;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  padding-left: 0;
  padding-right: 0;
  color: #666;
  font-size:26rpx
}
button:after {
  border: 0px;
  color: #333;
  font-size:22rpx
}
.button-hover{
  color: #666666;
  background-color: rgba(0,0,0,0)
}
.contact_list>button{display: flex;flex-direction: column}
.logistics-detail .name{padding-top: 36rpx;display: block}
.express{display: flex;margin-top: 7rpx;align-items: center}
.express .grey{margin-right: 10rpx}
.logistics-express{width: 63%;}
.contact_list{margin-top: 33rpx; }
pages/miaosha/msDetails.js
New file
@@ -0,0 +1,508 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
    /**
     * 页面的初始数据
     */
    data: {
      userInfo: '', //用户信息
    interval: 2000,
    duration: 1000,
    imgUrls: [],
    imagetext: ['商品介绍', '规格与包装'],
    currentTabsIndex: 0,
    checkCollect: true,
    goodsInfo: {},
    normspopup: false,
    currentIndex: 0,
    id: '',
    num: 1,
    whetherSpecification: false, //是否选择规格
    specification: '', //规格
    specificationId: '', //规格id
    specificationPrice: '', //规格价格
    price: '', //价格
    originalPrice: '', //划线价
    normsList: [],
    currentIndexs: 0,
    currentIndex: 0,
    hidden: false,
    limit: 10,
    offset: 0,
    inform: true,
    hidden: true,
    shareShow: false,
    cartProductId: "", //商品id
    title: "", //商品名
    imgSrc: "", //商品图片
    isShare: 0,
    qrcode: false,
    djsTime: {}, //倒计时
    isFirst: 1,//是否第一次进入页面
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        var _this = this;
        var id = options.id; //秒杀id
        var shopId = options.shopId;
        var needGetShopInfo = false;
        if (id == undefined) {
            //通过二维码进入
            const scene = decodeURIComponent(options.scene);
            var params = scene.split(",");
            console.log("扫码参数", params);
            shopId = params[0];
            id = params[1];
            app.shopInfo = {
                id: shopId
            };
            needGetShopInfo = true;
        }
        //未获取到活动id
        if (!id) {
            wx.showModal({
                title: '提示',
                content: '产品信息加载失败',
                showCancel: false
            })
            return;
        } else {
            _this.setData({
                id: id
            });
        }
          //检测用户登录
    if (!getApp().loginToken) {
        util.userLogin(function() {
          _this.getPageInfo(id);
        });
      } else {
        this.getPageInfo(id);
      }
      //获取门店信息
      if (needGetShopInfo) {
        setShopInf(shopId);
      }
    },
  /**
   * 秒杀数据
   */
  getPageInfo(id) {
    var _this = this;
    //处理产品信息
    util.request({
      api: api.seckill.findSecKillGoodsInfo + id,
      method: 'GET',
      checkLogin: true,
      callback: function(data) {
        let msActivitInfo=data.mapInfo.goodsInfo;
        let goodsInfo = data.mapInfo.goodsInfo.goods;
        if (goodsInfo.mobileDetails != null) {
          goodsInfo.mobileDetails = goodsInfo.mobileDetails.replace(/<img /g, '<img class="rich_img" ');
          console.log(goodsInfo.mobileDetails);
        }
        _this.setData({
          goodsInfo: goodsInfo,
          imgUrls: goodsInfo.productImgs,
          normsList: goodsInfo.skus,
          specification: goodsInfo.skus[0].name,
          specificationPrice: goodsInfo.skus[0].price,
          price: goodsInfo.skus[0].price,
          specificationId: goodsInfo.skus[0].id,
          imgSrc: goodsInfo.imgMobile,
          title: goodsInfo.title,
          hidden: true,
          //整场秒杀活动信息
          activity: data.mapInfo.activity,
          //本产品秒杀活动信息
          msActivitInfo: msActivitInfo,
        });
        _this.djs();
      }})
  },
  /**
   * 倒计时
   */
  djs() {
    var _this = this;
    let time = _this.data.activity.remainTime;
    var interval = setInterval(function() {
      time--;
      if (time < 0) {
        _this.data.activity.actStatus=2;
        clearInterval(interval);
      } else {
        _this.setData({
          djs: util.getTimeSpance(time),
          time: time,
        });
      }
    }, 1000);
  },
      //从服务器加载门店信息
  setShopInf(shopId) {
    util.request({
      api: api.yuyue.findShopInfoById + "/" + shopId,
      callback: function(data) {
        app.shopInfo = data.mapInfo.shopInfo;
      },
      checkLogin: true,
    });
  },
  // 立即购买
  buy() {
    var _this = this;
    var userInfo = getApp().userInfo;
    if (util.isBlank(userInfo.nickName)) {
      wx.navigateTo({
        url: '/pages/welcome/welcome?url=back',
      })
    }
    //判断是否授权头像
    // 判断是否绑定过手机号
    if (util.isBlank(getApp().userInfo.phoneNumber)) {
      wx.navigateTo({
        url: '../phone/phone',
      })
    } else {
      let goodsInfo = _this.data.goodsInfo;
      if (!_this.data.whetherSpecification) {
        console.log("存在多个规格,且没有选择过规格,弹出请选择");
        _this.setData({
          whetherSpecification: true,
          normspopup: true
        });
      } else {
        //隐藏规格
        this.cancelNorms();
        var id = _this.data.goodsInfo.id; // 商品id
        var cartSkuId = _this.data.specificationId; //规格id
        var cartNumber = _this.data.num; //数量
        var stockNum = _this.data.msActivitInfo.siRemainCnt;
        if (stockNum < 1) {
          wx.showToast({
            title: "您来晚了,商品已经抢光了",
            icon: 'none',
          });
          return;
        }
          //订单参数
        let orderMsg = {
          goodsInfo: goodsInfo,
          cartSkuId: cartSkuId,
          cartNumber: cartNumber,
          specification: _this.data.specification,
          msActivitInfo: _this.data.msActivitInfo,
        };
        wx.setStorageSync("orderMsg", orderMsg);
        //进入结算
        wx.navigateTo({
          url: '/pages/miaosha/msOrder',
        })
      }
    }
  },
  //规格选择
  norms(e) {
    var index = e.currentTarget.dataset.index;
    var value = e.currentTarget.dataset.value;
    var price = e.currentTarget.dataset.price;
    var id = e.currentTarget.dataset.id;
    this.setData({
      currentIndex: index,
      specification: value,
      specificationPrice: price,
      specificationId: id
    })
  },
  // 显示规格
  showNorms() {
    this.setData({
      whetherSpecification: true,
      normspopup: true
    })
  },
  //隐藏规格
  cancelNorms() {
    this.setData({
      normspopup: false
    })
  },
  /**
   * 绑定加数量事件
   */
  addCount(e) {
    var _this = this;
    let num = _this.data.num;
    num = num + 1;
    this.setData({
      num: num
    });
  },
  /**
   * 绑定减数量事件
   */
  minusCount(e) {
    var _this = this;
    let num = _this.data.num;
    if (num <= 1) {
      return false;
    }
    num = num - 1;
    this.setData({
      num: num
    });
  },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {
    },
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {
    },
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {
    },
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {
    },
  /**
   * 获取二维码
   */
  getQrcode: function() {
    var _this = this;
    if (_this.data.qrcode) {
      wx.previewImage({
        current: _this.data.qrcode, // 当前显示图片的http链接
        urls: [_this.data.qrcode] // 需要预览的图片http链接列表
      })
    } else {
      var shopId = app.shopInfo.id;
      const msActivitInfo = _this.data.msActivitInfo;
      var data = {
        shopId:shopId,
        actId: msActivitInfo.actId,
        scene: shopId + "," + msActivitInfo.id,
        path: "pages/miaosha/msDetails",
        skillId: msActivitInfo.id,
        activityType:3,
      };
     util.request({
        method: "POST",
        data:data,
        api: '/wxapi/shareProduct/getProductShareQrcode/',
        callback: function(data2) {
          var qrcode = data2.rows[0].qrcodeUrl
          console.log(qrcode);
          _this.setData({
            qrcode: qrcode,
          })
          wx.previewImage({
            current: _this.data.qrcode, // 当前显示图片的http链接
            urls: [_this.data.qrcode], // 需要预览的图片http链接列表
            success: function() {
              wx.downloadFile({
                url: _this.data.qrcode,
                success: function(res) {
                  console.log(res);
                  //图片保存到本地
                  wx.saveImageToPhotosAlbum({
                    filePath: res.tempFilePath,
                    success: function(data) {
                      wx.showToast({
                        title: '保存成功',
                        icon: 'success',
                        duration: 2000
                      })
                    },
                    fail: function(err) {
                      console.log(err);
                      if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
                        console.log("当初用户拒绝,再次发起授权")
                        wx.openSetting({
                          success(settingdata) {
                            console.log(settingdata)
                            if (settingdata.authSetting['scope.writePhotosAlbum']) {
                              console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
                            } else {
                              console.log('获取权限失败,给出不给权限就无法正常使用的提示')
                            }
                          }
                        })
                      }
                    },
                    complete(res) {
                      console.log(res);
                    }
                  })
                }
              })
            }
          })
        }
      })
    }
  },
  //取消领券弹窗选择
  popupTap(e) {
    this.setData({
      popup: false,
      normspopup: false,
      telShow: false,
      shareShow: false
    })
  },
  //隐藏规格
  cancelNorms() {
    this.setData({
      normspopup: false
    })
  },
    /**
    * 分享
    */
   formSubmit: function (e) {
    console.log('获取二维码:', e)
    this.getQrcode()
  },
 // 分享
 share(e) {
  this.setData({
    shareShow: true,
    popupShow: true
  })
},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {
      var id = this.data.id;
      var title = this.data.goodsInfo.title;
      let url = "pages/miaosha/msDetails?id=" + id + "&shopId=" + app.shopInfo.id;
      console.log(url);
      return {
        title: "[秒杀]" + title,
        imageUrl: this.data.imgUrls[0].imgPath,
        path: url,
        success(res) {
        },
        fail(res) {
        }
      }
    }
})
pages/miaosha/msDetails.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "商品详情"
}
pages/miaosha/msDetails.wxml
New file
@@ -0,0 +1,279 @@
<view class="detail_container">
  <swiper indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='#00C085' indicator-color='#BDD8D0'>
    <block wx:for="{{imgUrls}}" wx:key="key">
      <swiper-item>
        <image src="{{item.imgPath}}" class="slide-image" bind:tap="onSwiperEvent" data-id="{{item.id}}" data-index="{{index}}" mode="widthFix"></image>
      </swiper-item>
    </block>
  </swiper>
  <view class="djs">
    <text class="js">秒杀</text>
    <view class="time">
      <view>距结束仅剩</view>
      <view>{{djs.day}}天{{djs.hour}}时{{djs.minute}}分{{djs.second}}秒</view>
    </view>
  </view>
  <view class="detail_section">
    <view class="detail_content">
      <view class="detail_top">
        <view class="detail-group">
          <view class='iprice detail_iprice'>¥{{msActivitInfo.siPrice}} </view>
          <view class='grey original_iprice'  >¥{{goodsInfo.price}}</view>
          <view class="share" bind:tap="share">
            <image src="/image/share.png"></image>
          </view>
        </view>
        <view class="detail_info">
          <view class="detail_name threeblack">{{goodsInfo.title}}</view>
          <view class='grey'>月销:{{goodsInfo.dsVolume}}</view>
        </view>
        <view class='grey explain'>{{goodsInfo.briefIntroduction}}</view>
      </view>
    </view>
    <view class="detail_middle">
      <view class="couple">
        <view class='firms' bind:tap="showNorms">
          <view class='threeblack'>规格</view>
          <view class='couple_right'>
            <text>{{specification}}</text>
            <view class=" iconfont iconright"></view>
          </view>
        </view>
      </view>
      <!-- 图文说明 -->
      <view class='detail_imagetext'>
        <view class='imagetext_box'>
          <block wx:for="{{imagetext}}" wx:key="ids">
            <view class="imagetext_item {{currentTabsIndex==index?'selected':''}}" bindtap='onTabsItemEvent' data-index="{{index}}">
              {{item}}
            </view>
          </block>
        </view>
        <view class="imagetext_detail_box">
          <view class="tabs_content" hidden="{{currentTabsIndex!=0}}">
            <view>
              <rich-text class='price_content' nodes="{{goodsInfo.mobileDetails}}"></rich-text>
            </view>
          </view>
          <view class="tabs_content explain_tabs" hidden="{{currentTabsIndex!=1}}">
            <view wx:for="{{goodsInfo.params}}" wx:key="ids">
              <view class='title'>{{item.paramName}}</view>
              <view class='content name'>{{item.paramValue}}</view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
<!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{normspopup}}">
    <view class='popup' bind:tap="popupTap"></view>
    <view class='norms-container'>
      <view class="norms-list">
        <view>
          <view class='norms-detail'>
            <block wx:for="{{normsList}}" wx:key="ids">
              <view class='norms-item' hidden="{{currentIndex!=index}}">
                <image src='{{item.imgPath}}'></image>
                <view class='norms-content'>
                  <text class='title'>{{goodsInfo.title}}</text>
                  <text class='stock grey'>库存:{{item.stock}}</text>
                  <text class='price'>¥{{currentGrooupPrice.gpPrice}}</text>
                </view>
              </view>
            </block>
            <view class='close iconfont icon-quxiao' bind:tap="cancelNorms"></view>
          </view>
        </view>
        <view class='norms-select'>
          <text class='threeblack'>规格</text>
          <view>
            <view class='norms-box'>
              <block wx:for="{{normsList}}" wx:key="ids">
                <view class='norms-box-item {{currentIndex == index?"selectedNorms":""}}' bindtap="norms" data-index="{{index}}" data-value="{{item.name}}" data-price="{{item.price}}" data-id="{{item.id}}">{{item.name}}</view>
              </block>
            </view>
          </view>
        </view>
        <view class='norms-number'>
          <text class='threeblack'>数量</text>
          <view class="cart-count-box">
            <!-- iconfont icon-jian -->
            <view class="cart-count-down " bindtap="minusCount" data-obj="{{obj}}" data-index="{{index}}">
              <image src='/image/jian.png'></image>
            </view>
            <text class="cart-count-num">{{num}}</text>
            <view class="cart-count-add" bindtap="addCount" data-index="{{index}}">
              <image src='/image/jia.png'></image>
            </view>
          </view>
        </view>
      </view>
      <view class='norms-footer'>
        <view class='norms-join' bindtap='buy'>立刻购买</view>
      </view>
    </view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择END\\\\\\\\\\\\\\\\\   -->
  <!--下架后进入产品页控制操作 -->
  <view class="detail_footer footer-grey" wx:if="{{goodsInfo.status == 2 || goodsInfo.delFlag == 1}}">
    <view class='detail_collected' bindtap="goIndex">
      <view class="iconfont icondianpu"></view>
      <text>店铺</text>
    </view>
    <view class='service'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          客服
        </button>
      </view>
    </view>
    <view class='detail_cart detail_pay'>加入购物车</view>
    <view class='detail_buy detail_pay'>已下架</view>
  </view>
  <!--下架后进入产品页控制操作END -->
  <!-- 底部按钮操作栏  -->
  <view class="detail_footer " wx:if="{{goodsInfo.status == 1 && goodsInfo.delFlag == 2}}">
    <view class='detail_collected' bindtap="goIndex">
      <view class="iconfont icondianpu"></view>
      <text>店铺</text>
    </view>
    <view class='service'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          客服
        </button>
      </view>
    </view>
    <view wx:if="{{msActivitInfo.siRemainCnt>0 && activity.actStatus==1}}"  class='detail_cart detail_pay_big cleanbtn btn-center'
    bindtap='buy' >立刻秒杀</view>
   <view wx:if="{{activity.actStatus==2 }}" class='detail_cart detail_pay_big detail_pay_over'  >秒杀结束</view>
    <view wx:if="{{msActivitInfo.siRemainCnt<1}}" class='detail_cart detail_pay_big detail_pay_over'>已售罄</view>
    </view>
  </view>
 <!-- 底部按钮操作栏end  -->
  <view class="detail_couple">
    <view class='detail_coupon'></view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{normspopup}}">
    <view class='popup' bind:tap="popupTap"></view>
    <view class='norms-container'>
      <view class="norms-list">
        <view>
          <view class='norms-detail'>
            <block wx:for="{{normsList}}" wx:key="ids">
              <view class='norms-item' hidden="{{currentIndex!=index}}">
                <image src='{{item.imgPath}}'></image>
                <view class='norms-content'>
                  <text class='title'>{{goodsInfo.title}}</text>
                  <text class='stock grey'>库存:{{item.stock}}</text>
                  <text class='price'>¥{{msActivitInfo.siPrice}}</text>
                </view>
              </view>
            </block>
            <view class='close iconfont icon-quxiao' bind:tap="cancelNorms"></view>
          </view>
        </view>
        <view class='norms-select'>
          <text class='threeblack'>规格</text>
          <view>
            <view class='norms-box'>
              <block wx:for="{{normsList}}" wx:key="ids">
                <view class='norms-box-item {{currentIndex == index?"selectedNorms":""}}' bindtap="norms" data-index="{{index}}" data-value="{{item.name}}" data-price="{{item.price}}" data-id="{{item.id}}">{{item.name}}</view>
              </block>
            </view>
          </view>
        </view>
        <view class='norms-number'>
          <text class='threeblack'>数量</text>
          <view class="cart-count-box">
            <!-- iconfont icon-jian -->
            <view class="cart-count-down " bindtap="minusCount" data-obj="{{obj}}" data-index="{{index}}">
              <image src='/image/jian.png'></image>
            </view>
            <text class="cart-count-num">{{num}}</text>
            <view class="cart-count-add" bindtap="addCount" data-index="{{index}}">
              <image src='/image/jia.png'></image>
            </view>
          </view>
        </view>
      </view>
      <view class='norms-footer'>
        <view class='norms-join' bindtap='buy'>立刻购买</view>
      </view>
    </view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择END\\\\\\\\\\\\\\\\\   -->
<view class="popup-item" wx:if="{{shareShow}}">
  <view class='popup' bind:tap="popupTap" wx:if="{{popupShow}}"></view>
  <view class="pupup-bottom popup-content">
    <view class="share-container">
      <view class="hr"></view>
      <text class="share-text">分享到</text>
    </view>
    <view class="share-box">
      <button open-type="share" data-index="{{index}}" bind:tap="popupTap">
        <image src="/image/wx.png"></image>
        微信
      </button>
      <view class="card">
        <form bindsubmit="formSubmit">
          <button formType="submit" style="width:200rpx;">
            <image src="/image/tp.png"></image>
            生成卡片 </button>
        </form>
      </view>
    </view>
    <view class="cancel padding" bind:tap="popupTap">取消</view>
  </view>
</view>
<!-- 回到首页 -->
<view class="index" bind:tap="goIndex" wx:if="{{isShare}}">
  <image src="/image/goIndex.png"></image>
</view>
pages/miaosha/msDetails.wxss
New file
@@ -0,0 +1,730 @@
@import "../../icon/iconfont.wxss";
swiper {
  height: 750rpx;
  width: 100%;
}
.slide-image {
  width: 100%;
  height: 100%;
}
swiper-item{
  background: #fff
}
.detail_top {
  font-size: 34rpx;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 20rpx 0;
}
.detail-group{
  display: flex;
  align-items: center
}
.detail_collected text{
    font-size: 10px;
}
.original_iprice{
  text-decoration:line-through;
  margin-left: 10rpx;
}
.share {
  width: 90%;
  text-align: right;
}
.share image{width: 42rpx;height: 42rpx}
.detail_top>view {
  width: 90%;
  margin: auto;
}
.detail_name {
  width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail_info {
  display: flex;
  padding: 11rpx 0 28rpx 0;
  align-items: center
}
textarea{position: absolute}
.stock{margin-top: 20rpx}
.explain {
  font-size: 26rpx;
  line-height: 48rpx;
}
.detail_iprice {
  font-size: 35rpx;
  font-weight: bold;
}
.detail_middle {
  font-size: 30rpx;
}
.couple {
  background: #fff;
  margin: 10rpx 0;
}
.couple>view {
  display: flex;
  width: 90%;
  margin: auto;
  line-height: 70rpx;
}
.couple_right {
  width: 90%;
  display: flex;
  justify-content: flex-end;
  align-items: center
}
.couple .threeblack {
  font-weight: bold;
}
.couple_right .icon-31gouwuquan {
  width: 72rpx;
  height: 38rpx;
  position: absolute;
  left: -73rpx;
}
.couple_icon {
  background: url("http://file.micromall.xczhyf.cn/wxxcx/image/70.png");
  margin-left: 23rpx;
  width: 88rpx;
  height: 29rpx;background-size: 100% 100%;
  text-align: center
}
.couple_icon .price {
  font-size: 24rpx;
  color: #fff;
  margin-top: -19rpx
}
.couple-list .icon-youbian {
  margin-top: 6rpx;
}
.avatarUrl {
  width: 50rpx;
  height: 50rpx;
  border-radius: 50%;
}
.eval_text {
  font-weight: bold;
  width: 77%;
}
.product_eval {
  display: flex;
  line-height: 80rpx
}
.all {
  display: flex;
  line-height: 80rpx;
}
.evaluate_container {
  background: #fff;
}
.evaluate_container>view {
  width: 90%;
  margin: auto;
}
.star {
  display: flex;
  align-items: center;
  width: 45%;
  padding-left: 62rpx;
}
.star image {
  width: 30rpx;
  height: 29rpx;
  margin-right: 17rpx;
}
.evaluate_detail>view {
  display: flex;
  align-items: center;
}
.evaluate-info{display: flex;align-items: center;width: 21%}
.user_name {
  margin-left: 20rpx;
  font-size: 26rpx;
  width: 48%;
}
.evaluate_detail {
  padding-bottom: 40rpx;
}
.status {
  padding-top: 34rpx;
  display: block;
  color: #999;
  font-size: 28rpx;
}
.detail_imagetext {
  margin-top: 10rpx;
  background: #fff;
}
.imagetext_box {
  display: flex;
  width: 90%;
  margin: auto;
}
.imagetext_item {
  padding: 30rpx 0;
  color: #999;
  font-size: 28rpx;
  border-bottom: 1px solid #b3b3b3;
  width: 50%;
  text-align: center;
}
.tabs_content {
  width: 100%;
  margin: auto;
}
.price_content {
  color: #666;
  font-size: 24rpx;
  line-height: 36rpx;
}
.rich_img {
  max-width: 100%;
  margin: 0rpx;
  padding: 0rpx;
  border: none;
}
.carriage .couple_right{width: 73%}
.imagetext_detail_box .title {
  background: #F1F1F1;
  border-bottom: 1rpx solid #E1E1E1;
  color: #333;
  width: 30%;
  padding: 20rpx 0;
  font-size: 26rpx;
  align-items: center;
  display: flex;
  justify-content: center;
  border-left: 1rpx solid #E1E1E1;
  border-right: 1rpx solid #E1E1E1;
  white-space: nowrap
}
.explain_tabs>view {
  display: flex;
}
.explain_tabs{width: 93%}
.explain_tabs .content {
  width: 70%;
  padding: 20rpx 24rpx;
  font-size: 26rpx;
  color: #666;
  border-top: #E1E1E1 solid 1px;
  border-right: 1rpx solid #E1E1E1;
  line-height: 36rpx;
  margin-top: -1rpx;
  margin-left: 0;
  box-sizing: border-box;
 word-wrap:break-word;
}
.imagetext_detail_box {
  padding: 29rpx 0;
}
.explain_tabs>view:nth-child(1) .content{margin-top: 0px}
.explain_tabs>view:nth-child(1) .title{border-top: 1rpx solid #E1E1E1}
.explain_tabs .content:last-child {
  border-bottom: 1rpx solid #E1E1E1;
}
.explain_tabs .title_explain {
  border-top: 1px solid #E1E1E1;
}
.imagetext_box .selected {
  font-size: 28rpx;
  color: #333;
}
.imagetext_item:nth-child(1)::after {
  content: '';
  height: 100%;
  margin-left: 40%;
  display: inline-block;
  vertical-align: middle;
  border-right: 1px solid #b3b3b3;
}
.imagetext_item:nth-child(1) {
  padding-left: 10%;
}
.detail_footer {
  height: 106rpx;
  width: 100%;
  position: fixed;
  bottom: 0;
  display: flex;
  line-height: 106rpx;
  background: #f7f7f7;
}
.detail_section {
  padding-bottom: 106rpx;
}
button {
  border: none;
  color: #666;
  display: inherit;
}
.footer-grey .detail_buy{background: #666666}
.detail_buy {
  background: #ff5806;
}
.footer-grey .detail_cart{background: #B3B3B3}
.detail_cart {
  background: #00C085;
}
.detail_pay {
  width: 35%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_pay_big {
  width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_pay_over{
   width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
  background:#999999;
}
.singer{
  background: rgb(155, 235, 211);
}
.detail_collected {
  width: 15%;
  text-align: center;
  line-height: 36rpx;
  font-size: 20rpx;
  margin-top: 20rpx;
  color: #666;
}
.button-hover {
  background: #f7f7f7;
  color: #666;
}
.service {
  margin-top: 20rpx;
  width: 15%;
  position: relative;
}
.detail_footer .iconfont {
  padding-bottom: 5rpx;
}
button {
  line-height: 36rpx;
  border: none;
  align-items: center;
  font-size: 20rpx;
  padding-left: 0;
  padding-right: 0;
}
.btn-center{
  display: flex;
  justify-content: center;
}
button:after {
  border: 0px;
  color: #414141;
}
.contact_list {
  width: 100%;
  position: absolute;
  height: 100%;
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
}
.icon-soucang {
  font-size: 32rpx;
}
.icon-shoucang {
  font-size: 36rpx;
  color: #ff3f3a;
}
.couple-image {
  width: 88rpx;
  height: 29rpx;
}
.couple .threeblack {
  width: 20%;
}
.icon-youbian {
  color: #cacaca;
  padding-left: 15rpx;
}
.norms-container {
  background: #fff;
  width: 750rpx;
  background: rgba(255, 255, 255, 1);
  border-radius: 10rpx 10rpx 0rpx 0rpx;
}
.norms-container {
  position: absolute;
  bottom: 0;
}
.norms-item image {
  width: 180rpx;
  height: 180rpx;
  margin-right: 35rpx;
}
.norms-item {
  display: flex;
  width: 96%;
}
.norms-detail {
  display: flex;
}
.norms-content {
  display: flex;
  flex-direction: column;
}
.norms-list {
  width: 90%;
  margin: auto;
}
.norms-list .threeblack {
  font-size: 26rpx;
}
.norms-box-item {
  font-size: 24rpx;
  background: #eee;
  color: #333;
  padding: 9rpx 30rpx;
  border-radius: 30rpx;
  text-align: center;
  margin-right: 20rpx;
  margin-top: 20rpx
}
.selectedNorms {
  color: #ff3f3a;
  background: #fff;
  border: 1px solid #ff3f3a;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  padding: 30rpx 0;
  height: 500rpx;
  overflow-y: auto
}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons-container{margin: 0}
.alreadyGet{
  background-color: #999999
  }
.coupons-list>view{
  position: relative
}
.coupons .money::after{
left: 280rpx;
}
.detail_info .grey{white-space: nowrap;width: 30%;text-align: right}
.cart-list .cart-count-box{
    display: flex;align-items: center;
    margin-top:55rpx;
}
.cart-count-box image{width: 32rpx;height: 33rpx}
.cart-count-down,.cart-count-add{
    height: 100%;
}
.cart-count-num{
    background: #f9f9f9;
    font-size: 26rpx;
    border-radius:5rpx;
    color: #B3B3B3;
    text-align: center;
      width: 43rpx;
    height: 41rpx;
    line-height: 41rpx;
    margin-left: 15rpx;
    margin-right: 15rpx;
    margin-top: 8rpx
}
.detail-tel{display: flex;width: 100%}
.detail-tel .detail_pay{width: 85%;letter-spacing: 1rpx}
.tel-text{background: #00C085;position: absolute;top: 10rpx;font-size: 26rpx;right: 23rpx;border-radius: 17rpx;padding: 0 20rpx;color: #fff}
.popup-item{width: 100%;height: 100%;position: fixed;bottom: 0;z-index: 99}
.pupup-bottom{position: absolute;bottom: 0;width: 100%}
.detail_buy .button-hover{
  background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.detail_buy button{
   background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.tel{
  font-size: 34rpx;
}
.popup-item .cancel{
  font-size: 36rpx;
  margin-top: 12rpx
}
.popup-item .padding{
  height: 100rpx;
  line-height: 100rpx;
  background: #fff;
  text-align: center;
  color: #000;
}
.goIndex{
  position: fixed;z-index: 9999;
  bottom: 0;width: 163rpx;
  display: flex;
  flex-direction: column;
  font-size: 26rpx;
  color:#fff;
  height: 78rpx;
  right: 0;
  top: 80%;
}
.goIndex image{
  width: 100%;
  height: 100%
}
.popup-content{background: #fff;border-radius:10px 10px 0px 0px;height: 492rpx}
.popup-content button{background: #fff;width: 50%;font-size: 30rpx;display: flex;flex-direction: column}
.popup-content .button-hover{
  background: #fff;
  text-align: right;
}
.share-box{
  display: flex;padding: 40rpx 0;
}
.card{width: 50%;font-size: 30rpx;display: flex;flex-direction: column;align-items: center;color:#666 }
.popup-content .hr{
  display:block;content:'';width:100%;position:absolute;top:50%;border-top:2rpx solid #c3c3c3;opacity:0.6
}
.popup-content .share-container{
  text-align:center;position:relative;padding:44rpx 0;width:33%;margin:auto;letter-spacing:1rpx;
}
.popup-content .share-text{
  position:relative;padding:0 20rpx;color:#666;background-color:#fff;font-size: 30rpx
}
.popup-content .padding{
  background: #FF5806;margin-top: 0;font-size: 26rpx;
  color: #fff;position: absolute;bottom: 0;width: 100%;
  line-height: 74rpx;
  height: 74rpx
}
.share-box image{
  width: 125rpx;height: 125rpx;padding-bottom: 20rpx
}
.explain-images image{
  width: 100%;
  height: 1342rpx
}
.explain-image image{
  width: 100%;
  height: 1941rpx
}
.index image{
  width: 163rpx;
  height: 78rpx
}
.index{position: fixed;bottom:140rpx;right: 0;z-index: 999;}
 .djs{
  height: 80rpx;
  background: #fc464f;
  color: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items:center;
 }
 .js{
  font-weight: bold;
   font-size: 38rpx;
 }
 .time{
   font-weight: bold;
 }
 .groupNums{
   display: flex;
   flex-direction:row-reverse;
   align-items: center;
   height: 100rpx;
 }
 .groupNum{
   padding: 2rpx 10rpx;
   border: 1px solid  #fc464f;
   font-size: 20rpx;
   text-align: center;
   background: #ffffff;
   width: 100rpx;
   border-radius: 5rpx;
    margin-left: 10rpx;
    font-weight: bold;
    color:  #fc464f;
    height: 40rpx;
    line-height: 40rpx;
    overflow: hidden;
 }
.groupNums .active{
  background: #fc464f;
  color: white;
}
.cllist{
  display: flex;
  justify-content: space-between;
}
.headimg{
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  vertical-align: middle
}
.slide-item text{
  margin-left:10rpx;
}
.slide-item button{
  vertical-align: middle;
}
navigator{
 display: inline;
}
.ctbtn{
  background: #00C085;
  border: noen;
  color:#ffffff;
}
.grtitle{
  height: 50rpx;
  line-height: 50rpx;
}
.userBox{
  display: flex;
  justify-content: center;
  height: 200rpx;
}
.tzFlag{
  width: 60rpx;
  height: 30rpx;
  font-size: 25rpx;
  line-height: 30rpx;
  border-radius: 5rpx;
  background: #fc464f;
  color: #fff;
  text-align: center;
}
.userItem{
  margin-top: 60rpx;
}
.queshi{
  text-align: center;
  height: 80rpx;
  line-height: 80rpx;
}
.cleanbtn{
  border-radius: 0rpx;
  text-align: center !important;
}
.headDjs{
  display: flex;
}
.headBuy{
  display: flex;
  flex-direction: column;
}
.headBuy view{
  height: 40rpx;
}
.headprice{
  font-size:20rpx;
}
pages/miaosha/msList.js
New file
@@ -0,0 +1,248 @@
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
var interval = {};
Page({
  /**
   * 页面的初始数据
   */
  data: {
    //活动未开始
    ACTIVE_STATUS_NOT_START: 2,
    //活动进行中
    ACTIVE_STATUS_ING: 1,
    //活动结束
    ACTIVE_STATUS_END: 3,
    //当前场次角标
    currentTab: 0,
    //当期场次信息
    currentActiveInfo: {},
    //秒杀列表数据
    activitList: [],
    //秒杀产品列表
    productList: [],
    //分页相关数据
    //搜索条件
    shopId: '',
    //通用分页参数
    offset: 0,
    limit: 4,
    isEnd: false,
    toTopIcon: false,
    top_num: 0,
    totalNum: 0,
    //分页相关数据结束
    banner:"",
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this = this;
    var shopId = app.shopInfo.id;
    this.setData({
      shopId: shopId
    });
    //获取banbber
    util.request({
      api: api.ad.getAdByCode,
      method: 'POST',
      data:{title:'秒杀banner'},
      callback: function (data) {
        _this.setData({
          banner: data.rows[0],
        });
      }
    });
    //数据加载启动倒计时
    util.request({
      api: api.seckill.findSecKillActList + shopId,
      method: 'GET',
      callback: function (data) {
        _this.setData({
          activitList: data.rows,
          currentActiveInfo: data.rows[0]
        });
        _this.startDjs();
        _this.getProductList();
      }
    });
  },
  changeTab(e) {
    var index = e.currentTarget.dataset.index;
    var currentActiveInfo = this.data.activitList[index];
    this.setData({
      currentTab: index,
      currentActiveInfo: currentActiveInfo,
      productList: [],
      offset: 0,
      limit: 2,
      isEnd: false,
      toTopIcon: false,
      top_num: 0,
      totalNum: 0,
    });
    this.getProductList();
  },
  /**
   * 加载产品列表
   */
  getProductList: function () {
    var _this = this;
    //获取当前分页
    var limit = _this.data.limit;
    var offset = _this.data.offset;
    util.request({
      api: api.seckill.findSecKillGoodsListById,
      mask: true,
      data: {
        "limit": limit,
        "offset": offset,
        "id": _this.data.currentActiveInfo.id,
      },
      callback: function (data) {
        //判断数据是否达达到结束条件
        if (data.rows.length == 0) {
          _this.setData({
            isEnd: true
          });
        } else {
          //获取到新数据加入列表中
          var productList = _this.data.productList;
          for (var i = 0; i < data.rows.length; i++) {
            productList.push(data.rows[i])
          }
          //更新下次调用的角标
          _this.setData({
            productList: productList,
            offset: offset + limit,
          });
        }
      }
    });
  },
   // 进入详情
   intoDetail(e) {
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/miaosha/msDetails?id=' + id,
    })
  },
  /**
   * 启动倒计时
   */
  startDjs() {
    var _this = this;
    interval = setInterval(function () {
      var activitList = _this.data.activitList;
      for (let i = 0; i < activitList.length; i++) {
        let time = activitList[i].remainTime;
        time--;
        if (time < 0) {
          activitList[i].isStart=_this.data.ACTIVE_STATUS_END;
          continue;
        } else {
          activitList[i].remainTime = time;
          activitList[i].djs = util.getTimeSpance(time);
        }
      }
      _this.setData({
        activitList: activitList,
        currentActiveInfo:activitList[_this.data.currentTab]
      });
    }, 1000);
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    console.log("上拉");
    this.getProductList();
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/miaosha/msList.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/miaosha/msList.wxml
New file
@@ -0,0 +1,64 @@
<image  mode="aspectFill"
src="{{banner.imgUrl}}"></image>
<view class="waprbox">
    <view data-index="{{index}}" bindtap="changeTab" class="chagnciBox  {{index==currentTab?'active':''}} "   wx:for="{{activitList}}" wx:key="ids" >
        <view  >{{item.title}}</view>
        <view wx:if="{{item.isStart==ACTIVE_STATUS_NOT_START}}" >未开始</view>
        <view wx:if="{{item.isStart==ACTIVE_STATUS_ING}}" >秒杀中</view>
    </view>
</view>
<view class="msdjs">
<!-- 活动状态显示-->
<block wx:if="{{currentActiveInfo.isStart==ACTIVE_STATUS_NOT_START}}" >
    <view class="msTitle">{{currentActiveInfo.title}}即将开场</view>
    <view class="msendTitle"  >距离开始还有 <text>{{currentActiveInfo.djs.day}}:{{currentActiveInfo.djs.hour}}:{{currentActiveInfo.djs.minute}}:{{currentActiveInfo.djs.second}}</text></view>
</block>
<block wx:if="{{currentActiveInfo.isStart==ACTIVE_STATUS_ING}}" >
    <view class="msTitle">{{currentActiveInfo.title}}秒杀中</view>
    <view class="msendTitle"  >距离结束还有 <text>{{currentActiveInfo.djs.day}}:{{currentActiveInfo.djs.hour}}:{{currentActiveInfo.djs.minute}}:{{currentActiveInfo.djs.second}}</text></view>
</block>
<block wx:if="{{currentActiveInfo.isStart==ACTIVE_STATUS_END}}" >
    <view class="msTitle gray">{{currentActiveInfo.title}}已结束</view>
</block>
<!-- 活动状态显示结束-->
    <scroll-view>
        <view wx:for="{{productList}}" class="msItemBox"   data-id="{{item.id}}"
        bindtap="intoDetail" >
            <image src="{{item.goods.imgMobile}}"></image>
            <view class="productInfoBox">
                <view class="productTitle">{{item.goods.title}}</view>
                <view class="msMsg" >
                    <view class="ms_Lmsg" >
                        <view class="price">¥{{item.siPrice}}</view>
                        <view class="gray hxj" >原价¥{{item.goods.price}}</view>
                    </view>
                    <view class="ms_Rmsg">
                        <view class="gray" >剩余{{item.siCount}}件</view>
                        <view  wx:if="{{currentActiveInfo.isStart==ACTIVE_STATUS_ING}}"  class="btn">马上抢</view>
                        <view  wx:if="{{currentActiveInfo.isStart==ACTIVE_STATUS_END}}" class="btn gray_bg">活动结束</view>
                    </view>
                </view>
            </view>
        </view>
    </scroll-view>
  <view wx:if="{{productList.length==0}}" class="nodata">暂无数据</view>
  <view wx:if="{{productList.length!=0&&isEnd}}" class="nodata " >没有更多了</view>
</view>
pages/miaosha/msList.wxss
New file
@@ -0,0 +1,125 @@
.waprbox{
    display: flex;
    justify-content: center;
     height: 100rpx;
    background: #ffffff;
}
 .chagnciBox{
    width: 300rpx;
    text-align: center;
     line-height: 50rpx;
 }
 .waprbox .active{
     border-bottom: 2rpx solid #ff0000;
 }
 .msdjs{
     background-color: #ffffff;
     margin-top: 20rpx;
 }
 .msTitle{
    line-height: 100rpx;
    font-size:40rpx;
    font-weight: bold;
    text-align: center;
    color: #ff563b;
 }
 .msendTitle{
    line-height: 50rpx;
    font-size:28rpx;
    text-align: center;
    color: #ff563b;
    margin-bottom: 30rpx;
 }
 .msItemBox{
     width: 710rpx;
     margin:10rpx auto;
     height: 350rpxl;
     display: flex;
     justify-content: space-between;
     border-bottom: 1px solid #efefef;
     padding: 20rpx;
 }
 .msItemBox image{
    height: 240rpx;
    width: 240rpx;
 }
 .productInfoBox{
     width:460rpx;
     height: 240rpx;
     display: flex;
     flex-direction: column;
     justify-content: space-between;
 }
 .productTitle{
     font-size: 35rpx;
     font-weight: bold;
     margin-bottom: 40rpx;
 }
.msMsg{
    display: flex;
    justify-content: space-between;
}
.ms_Lmsg{
}
.ms_Rmsg{
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
}
.btn{
    width: 180rpx;
height: 60rpx;
background: #ff563b;
color: #ffffff;
text-align: center;
border-radius: 5rpx;
line-height: 60rpx;
margin-left: 10rpx;
}
.gray{
    color:#9f9f9f;
}
.gray_bg{
    background-color:#9f9f9f;
    color: #333;
}
.hxj{
    text-decoration:line-through;
}
.price{
    color:#ff563b;
    font-size:35rpx;
    font-weight: bold;
}
pages/miaosha/msOrder.js
New file
@@ -0,0 +1,380 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  data: {
    address: {},
    addrDefault: "",
    hasAddress: false,
    total: 0,
    couponsShow: false, //优惠券
    delivery: [],
    key: 0,
    keydelivery: 0,
    isShow: true,
    selected: "",
    hidden: false,
    goodsList: [],
    skuList: [],
    usefulCoupon: [],
    coupons: '暂无可用优惠券', // 优惠券金额
    couponReceiveId: null, // 优惠券Id
    postage: '', //邮费
    showCoupon: false, //是否存在优惠券
    carId: '', //购物车id
    buttonClicked: false,
    checkedValue: false,
    deliverySelect: "物流配送",
    qsfy: "",
    pageScen: "",
    discountExplain: {},
    shopInfo: {},
  },
  onLoad() {
    this.setData({
      shopInfo: app.shopInfo
    });
  },
  onShow: function() {
    var _this = this;
    _this.jsjg();
    //获取收货地址
    _this.getAddress();
  },
  //计算订单价格
  jsjg() {
    var _this = this;
    let orderMsg = util.getOutStorage("orderMsg");
    let goodsInfo = orderMsg.goodsInfo;
    _this.setData({
      goodsList: [{
        imgMobile: goodsInfo.imgMobile,
        title: goodsInfo.title,
        name: orderMsg.specification,
        price: orderMsg.msActivitInfo.siPrice,
        cartNumber: orderMsg.cartNumber,
      }],
      orderMsg: orderMsg,
    });
    //调用接口计算价格
    var goods = this.data.goodsList[0];
    let actId = _this.data.orderMsg.msActivitInfo.id;
    var sendData = {
      id: actId,//活动id
      addressId: _this.data.address.addrId, //收货地址ID
      count: goods.cartNumber,
      shopId: app.shopInfo.id,
      shippingMethod: this.data.deliverySelect,
    }
    util.request({
      api: api.seckill.calSecKillPrice,
      data: sendData,
      callback: function (data) {
       _this.setData({
         discountExplain: {
           billPrice: data.mapInfo.totalPrice,
           postage: data.mapInfo.postage,
           payPrice:data.mapInfo.postage + data.mapInfo.totalPrice
         },
       });
      }
    });
  },
  mySelect(e) {
    var name = e.currentTarget.dataset.name
    this.setData({
      tihuoWay: name,
      select: false
    })
  },
  //获取textarea里的值
  txtInput(e) {
    this.setData({
      txtContent: e.detail.value
    })
  },
  onShowText() {
    this.setData({
      isShow: true,
    })
  },
  onReady() {
    this.getTotalPrice();
  },
  /**
   * 计算总价
   */
  getTotalPrice() {
  },
  bindTextAreaBlur(event) {
    var value = event.detail.value;
    this.setData({
      txtContent: value,
    });
  },
  // 支付
  startPayment() {
    var _this = this;
    if (!_this.data.address) {
      wx.showToast({
        title: "请选择收货地址",
        icon: "none"
      });
      return;
    }
    wx.showLoading({
      title: '加载中',
      mask: true,
      duration: 2000
    });
    util.buttonClicked(this);
    //调用接口计算价格
    var goods = this.data.goodsList[0];
    let actId = _this.data.orderMsg.msActivitInfo.id;
    var sendData = {
      id: actId,//活动id
      addressId: _this.data.address.addrId, //收货地址ID
      count: goods.cartNumber,
      shopId: app.shopInfo.id,
      shippingMethod: this.data.deliverySelect,
    }
    util.request({
      api: api.seckill.createSecKill,
      data: sendData,
      callback: function(data) {
        wx.requestPayment({
          'timeStamp': data.rows[0].timeStamp,
          'nonceStr': data.rows[0].nonceStr,
          'package': data.rows[0].prepay_id,
          'signType': 'MD5',
          'paySign': data.rows[0].paySign,
          'success': function(res) {
            // console.log(res.errMsg)
            console.log("成功后的回调")
            console.log(res)
            if (res.errMsg == 'requestPayment:ok') {
              // console.log(data.mapInfo.orderId);
              //成功后的回调;
              util.request({
                method: "GET",
                api: '/wxapi/shopOrder/findOrderPayStatus/' + data.mapInfo.orderId,
                mask: true,
                callback: function(payRes) {
                  if (payRes.mapInfo.status == 'success') {
                    wx.redirectTo({
                      url: '../payOrder/paySuccess',
                    });
                  } else {
                    wx.showToast({
                      title: payRes.mapInfo.msg,
                      duration: 2000,
                      image: "/image/fail.png"
                    })
                    wx.redirectTo({
                      url: '../payOrder/payError',
                    })
                  }
                }
              });
            } else {
              // console.log("支付失败");
              wx.redirectTo({
                url: '../order/order',
              })
            }
            //{errMsg: "requestPayment:ok"}
          },
          'fail': function() {
            wx.redirectTo({
              url: '../order/order?status=1',
            })
          }
        });
      }
    });
  },
  // 进入收货地址列表
  goAddress() {
    wx.navigateTo({
      url: '../editAddress/editAddress?pageScen=2',
    })
  },
  // 进入添加收货地址
  addAddress() {
    wx.navigateTo({
      url: '../editAddress/editAddress?pageScen=2',
    })
  },
  //设置地址
  setAddress(address) {
    this.setData({
      "address": address,
      hasAddress: true
    });
  },
  //隐藏弹窗
  popupTap() {
    this.setData({
      couponsShow: false,
      isShow: false
    })
  },
  total() {
    this.setData({
      isShow: true
    })
  },
  // 获取默认地址
  getAddress() {
    var _this = this;
    util.request({
      api: api.address.queryaddress,
      callback: function(data) {
        if (data.rows.length != 0) {
          _this.setData({
            address: data.rows[0],
            hasAddress: true
          });
        } else {
          _this.setData({
            hasAddress: false
          })
        }
      }
    });
  },
  // 不使用优惠券按钮
  checkedTap: function() {
    var checked = this.data.checkedValue;
    var couponReceiveId = this.data.couponReceiveId;
    if (!checked) {
      couponReceiveId = 1
      this.setData({
        coupons: '不使用优惠券',
        couponReceiveId: couponReceiveId
      })
    }
    this.setData({
      checkedValue: !checked,
      couponsShow: false
    })
    this.jsjg();
  },
  //优惠券
  couponsChoice() {
    this.setData({
      couponsShow: true,
      isShow: true
    })
  },
  //优惠券
  radioCouponsChange(e) {
  },
  //优惠券选择
  couponsEvent(e) {
    var _this = this;
    var coupon = e.currentTarget.dataset.coupon;
    var index = e.currentTarget.dataset.index;
    var id = e.currentTarget.dataset.id;
    var usefulCoupon = _this.data.usefulCoupon;
    var changed = {};
    for (var i = 0; i < usefulCoupon.length; i++) {
      if (i == index) {
        changed['usefulCoupon[' + i + '].checked'] = true;
      } else {
        changed['usefulCoupon[' + i + '].checked'] = false
      }
    }
    _this.setData(changed)
    _this.setData({
      coupons: coupon.cName,
      couponsShow: false,
      isShow: false,
      couponReceiveId: id,
      checkedValue: false
    })
    this.jsjg();
  },
})
pages/miaosha/msOrder.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "订单详情"
}
pages/miaosha/msOrder.wxml
New file
@@ -0,0 +1,90 @@
<view class="main">
  <view class="order-add-address">
    <view wx:if="{{hasAddress}}" class="orders-address" bindtap='goAddress' data-id="{{address.addrId}}">
      <view class="iconfont icon-address"></view>
      <view class="order-list">
        <view>
          <text class="orders-address-name threeblack">{{address.addrLiaisonman}}</text>
          <text class="orders-address-phone grey">{{address.addrTelephone}}</text>
        </view>
        <view class='orders-address-item'>
          <text wx:if="{{address.addrDefault==1}}" class="default">默认</text>
          <view class="orders-address-detail">{{address.addrRegion}}</view>
        </view>
      </view>
    </view>
    <view wx:else class="orders-no-address" bindtap='addAddress'>
      <text class="iconfont icontianjia"></text>
      <text decode="{{true}}">&ensp;添加收货地址</text>
    </view>
    <image  src='http://file.micromall.xczhyf.cn/wxxcx/image/15.png' class="division"></image>
  </view>
  <view class="orders-box">
    <view wx:for="{{goodsList}}" wx:key="index" class="orders-list">
      <view wx:if="{{item != null}}">
        <image mode="aspectFit" class="orders-thumb" src="{{item.imgMobile}}"></image>
        <view class='order-detail'>
          <view>
            <view class="orders-pro-name">{{item.title}}</view>
            <view class="order-norms"><text class="lables" >秒杀</text>规格:{{item.name}}</view>
            <view class="orders-pro-price">¥{{item.price}}</view>
          </view>
        </view>
        <view class="orders-count-num">×{{item.cartNumber}}</view>
      </view>
    </view>
  </view>
<view class="orders-bottom">
    <view class="orders-bottom-text">
      <text>下单门店</text>
      <view class="orders-bottom-text-right"  >
        <text> {{shopInfo.shopShortName}}</text>
      </view>
    </view>
    <view class="orders-bottom-text">
      <text>配送方式</text>
      <view class="orders-bottom-text-right"  >
        <text>{{deliverySelect}}</text>
        <text wx:if="{{deliverySelect=='立即配送' && discountExplain.postage>0  }}">(注:满{{qsfy}}元免配送费)</text>
      </view>
    </view>
    <view class="orders-bottom-text remarks">
      <text>买家留言</text>
      <input class='orders-bottom-text-input' bindchange="bindTextAreaBlur" type='text' placeholder='买家留言'></input>
    </view>
  </view>
  <view class="orders-bottom-yh youhui-box">
    <view class="youhui-item">
      <text class="left">商品金额</text>
      <text class="right">¥{{discountExplain.billPrice}}</text>
    </view>
    <view class="youhui-item">
      <text class="left">运费 </text>
      <text class="right">¥{{discountExplain.postage}}</text>
    </view>
    <view class="line"></view>
    <view class="youhui-item">
      <text class="left">实际支付</text>
      <text class="right orders-footer-total-money">¥{{discountExplain.payPrice}}</text>
    </view>
  </view>
  <cover-view class="orders-footer" bind:tap="total">
    <cover-view class="orders-footer-total">合计金额:
      <cover-view class='orders-footer-total-money'>¥{{discountExplain.payPrice}}</cover-view>
    </cover-view>
    <cover-view class="orders-footer-btn" bindtap="startPayment">确认订单 </cover-view>
  </cover-view>
</view>
pages/miaosha/msOrder.wxss
New file
@@ -0,0 +1,396 @@
.main {
  margin: 0 18rpx;
  padding-bottom: 20rpx;
}
.icon-address{color: #00C085;font-size: 40rpx;margin: 25rpx 22rpx 0 22rpx}
.orders-address {
  position: relative;
  padding: 25rpx 0;
  display: flex;
  font-size: 14px;
  line-height: 25px;
  color: #adadad;
}
.orders-address-detail{font-size: 26rpx;color: #666;line-height: 30rpx;width: 459rpx}
.orders-address::after {
  position: absolute;
  right: 40rpx;
  top: 60rpx;
  content: '';
  width: 20rpx;
  height: 20rpx;
  border-top: 4rpx solid #999;
  border-right: 4rpx solid #999;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.default {
  width: 44rpx;
  height: 23rpx;
  font-size: 14rpx;
  border-radius: 9rpx;
  color: #fff;
  display: block;
  text-align: center;
  line-height: 23rpx;
  background-color: #FF4606;
  margin-top: 6rpx;
  margin-right: 5rpx
}
.order-list{width: 470rpx;}
.orders-address-item{display:flex}
.orders-address-name {
  display: inline-block;
  font-size: 34rpx;
  margin-right: 20rpx
}
.orders-no-address {
  font-size: 26rpx;
  position: relative;
  line-height: 100rpx;
  color: #666;
  text-align: center;
}
.orders-box {
  padding-bottom: 0rpx;
}
.orders-list {
  position: relative;
  height: 180rpx;
  margin-bottom: 10rpx;
  background-color: #fff;
  border-radius: 10rpx;
  display: flex;
  padding: 30rpx 0;
}
.orders-list>view {
  display: flex;
}
.orders-thumb {
  width: 167rpx;
  height: 159rpx;
  margin: 0 23rpx;
}
.orders-pro-name {
  color: #333;
  margin: 10rpx 0 10rpx 0;
  font-weight: bold;
  font-size: 30rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-norms {
  color: #999;
  font-size: 26rpx;
}
.order-detail {
  width: 417rpx;
}
.orders-pro-price {
  margin-top: 29rpx;
  color: #ff4606;
  font-size: 32rpx;
  font-weight: bold;
}
.orders-count-num {
  margin-top: 125rpx;
  font-size: 34rpx;
  width: 50rpx;
  color: #b3b3b3;
}
.orders-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 106rpx;
  line-height: 106rpx;
  background: #fff; box-sizing: border-box;
  display: flex;z-index: 99;
  overflow: hidden
}
.orders-footer .orders-footer-total {
  width: 504rpx;
  padding-left: 38rpx;
  color: #666;
  font-size: 26rpx;
  display: flex;align-items: center;line-height: 106rpx
}
.orders-footer-total-money {
  color: #ff5e10;
  font-weight: bold;
  font-size: 32rpx;
}
.orders-footer .orders-footer-btn {
  display: inline-block;
  width: 246rpx;
  height: 106rpx;
  text-align: center;
  color: #fff;
  background: #e74a05;
  font-size: 28rpx;
  padding: 0 5rpx;
  line-height: 106rpx
}
.orders-bottom-text {
  display: flex;
  line-height: 100rpx;
  font-size: 26rpx;
  margin: 0 20rpx;
}
.orders-bottom-text>text {
  color: #333;
  font-weight: bold;
  font-size: 30rpx;
}
.orders-bottom {
  padding-bottom: 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 10rpx;
}
.orders-bottom-text text {
  margin: 0 15rpx;
}
/* .remarks {
  flex-direction: column;
} */
.orders-bottom-text>text {
  width: 30%;
}
.orders-bottom-text-right {
  display: flex;
  width: 70%;
  justify-content: flex-end;
  color: #666;
}
.orders-bottom-text-right-last {
  color: #ff3f3a;
}
.orders-bottom-text-input {
  margin: 0rpx 20rpx;
  height: 100rpx;
  width: 100%;
  padding-left: 10rpx;
  border-radius: 10rpx;
  font-size: 26rpx;
  line-height: 100rpx;text-align: right
}
.youhui-box{
  line-height: 100rpx;
  font-size: 26rpx;
  padding-bottom: 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 100rpx;
}
.youhui-item{
  width: 100%;
}
.youhui-box .left{
  text-align: left;
  padding-left: 15px;
  display: inline-block;
  width: 20%;
}
.youhui-box .right{
  text-align: right;
   padding-right: 15px;
  display: inline-block;
   width: 60%;
}
/* 下拉列表 */
.list-msg {
  background-color: #fff;
  position: relative;
}
.list-msg .list-msg2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.select_box {
  background-color: #fff;
  width: 93%;
  position: absolute;
  top: 80rpx;
  z-index: 1;
  overflow: hidden;
  animation: myfirst 0.5s;
}
.select_one {
  height: 60rpx;
  line-height: 60rpx;
  border-bottom: 1px solid #ccc;
}
.icon-jia {
  color: #666;
  font-weight: bold;
}
.division{
  height: 6rpx;
  display: block;
  margin-bottom: 10rpx;
}
.getShopStore, .delivery {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 688rpx;
  background: #fff;
  border-radius: 10px 10px 0px 0px;
}
.getShopStore, .delivery text {
  font-size: 26rpx;
  font-weight: bold;
}
/* page{
  background-color: skyblue!important
} */
.choice {
  width: 686rpx;
  margin: auto;
  color: #999;
  display: flex;
  align-items: center;
  padding-top: 28rpx;
}
.choice .title {
  width: 96%;
  display: block;
}
.icon-quxiao {
  font-size: 38rpx;
}
.label-2 {
  font-size: 30rpx;
  line-height: 100rpx;
}
.label-2__icon {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 40rpx;
  height: 40rpx;
  border-radius: 50%;
  border: 1px solid #999;
  left: 88%;
}
.icon-checked {
  background-image: url(http://file.micromall.xczhyf.cn/wxxcx/image/20.png);
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
}
.active .label-2__icon {
  background: #00c085;
  border: none;
}
radio-group {
  height: 500rpx;
  overflow-y: scroll;
  margin-top: 29rpx;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  height: 500rpx;
  overflow-y: hidden;
  padding-bottom: 143rpx;
}
.coupons-container{margin: 0;position: relative}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons .money::after{
left: 280rpx;
}
.coupons-list .coupons-container:last-child{padding-bottom: 106rpx}
button {
  line-height: 106rpx;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  font-size: 30rpx;
  padding-left: 0;
  padding-right: 0;
  color: #333;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden
}
.button-hover{
  /* color:#fff; */
  background-color: rgba(0,0,0,0);
}
button:after {
  border: 0px;
  color: #333;
}
.coupons-list radio-group{margin-top: 0}
.coupons-one{
  font-size: 30rpx;
  color: #333;
  display: flex;
  align-items: center;
  width: 90%;
  margin: 30rpx auto;
}
.checked-lable{
  width: 100%;display: flex;white-space: nowrap
}
.radio-one{
  width: 70%;text-align: right
}
radio{
    transform: scale(0.8);
}
pages/order/order.js
New file
@@ -0,0 +1,312 @@
var util = require('../../utils/util.js');
Page({
  data: {
    tabs: ['全部', '待付款', '待配送','待收货','待评价'],
    currentIndex: 0,
    orderList:[],
    limit:8,
    offset:1,
    refresh:false,
    orderShow:false,
    // hiddenData:true
  },
  onUnload: function () {
    // wx.reLaunch({
    //   url: '../customerCenter/customerCenter'
    // })
  },
  onLoad: function (options) {
    var status = options.status;
    if (status!=undefined){
      this.setData({
        currentIndex: status
      })
    }
    this.getOrderInfo(this.data.currentIndex);
    this.goTap();
  },
  onShow:function(){
    if(this.data.refresh){
      this.getOrderInfo(this.data.currentIndex);
    }
  },
  //获取滚动条当前位置
  onPageScroll: function (e) {
    // console.log(e)
    if (e.scrollTop > 400) {
      this.setData({
        floorstatus: true
      });
    } else {
      this.setData({
        floorstatus: false
      });
    }
  },
  //一键回到顶部
  goTap(){
    util.goTap();
  },
  onTabsItemEvent(e){
    var index = e.currentTarget.dataset.index;
    this.setData({
      currentIndex:index,
      offset: 1
    })
    this.getOrderInfo(index);
  },
  // 根据状态获取订单信息
  getOrderInfo:function(status){
    var _this = this;
    var limit = _this.data.limit;
    var offset = _this.data.offset;
    util.request({
    api:"/wxapi/shopOrder/getMyOrderInfo",
    data: { "limit": limit, "orderStatus": status, "offset": offset},
    callback: function (data) {
      console.log("订单信息")
      console.log(data.rows)
      _this.setData({
        orderList: data.rows,
        currentIndex: status
      });
      var orderList = _this.data.orderList;
      console.log(orderList)
      if (orderList.length == 0) {
        _this.setData({
          orderShow: true,
        })
      } else {
        _this.setData({
          orderShow: false
        })
      }
    }});
  },
  invoice(e){
    var id = e.currentTarget.dataset.id
    console.log(id)
    wx.navigateTo({
      url: '../applyInvoice/applyInvoice?id='+id,
    })
  },
  // 支付
  pay(e){
    var id = e.currentTarget.dataset.id;
    var status = e.currentTarget.dataset.status;
    var _this = this;
    var sendData = {
    }
    util.request({
      method : "GET",
      api:"/wxapi/shopOrder/orderSettlement/" + id,
      data:sendData,
      callback: function (data) {
        console.log(data);
        if (data.status == '700000'){
            wx.showToast({
              title: data.info,
              duration: 2000,
            })
            return;
        }
        wx.requestPayment({
          'timeStamp': data.rows[0].timeStamp,
          'nonceStr': data.rows[0].nonceStr,
          'package': data.rows[0].prepay_id,
          'signType': 'MD5',
          'paySign': data.rows[0].paySign,
          'success': function (res) {
            console.log(res.errMsg)
            if (res.errMsg == 'requestPayment:ok') {
              console.log(data.mapInfo.orderId);
              //成功后的回调;
              util.request({
                method:"GET",
                api: '/wxapi/shopOrder/findOrderPayStatus/' + data.mapInfo.orderId,
                callback: function (payRes) {
                console.log("查询支付结果", payRes);
                if (payRes.mapInfo.status == 'success') {
                  wx.navigateTo({
                    url: '../payOrder/paySuccess?getBack=1&&status=' + status,
                  });
                  wx.showToast({
                    title: payRes.mapInfo.msg,
                    icon: 'success'
                  })
                } else {
                  wx.showToast({
                    title: payRes.mapInfo.msg,
                    duration: 2000,
                    image: "/image/fail.png"
                  })
                  wx.navigateTo({
                    url: '../payOrder/payError',
                  })
                }
              }});
            } else {
              console.log("支付失败");
              wx.navigateTo({
                url: '../order/order',
              })
            }
            //{errMsg: "requestPayment:ok"}
          },
          'fail': function (res) {
            // wx.navigateTo({
            //   url: '../order/order?status=1',
            // })
          }
        })
      }});
  },
  // 评价
  evaluate(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../productEvaluate/productEvaluate?id=' + id,
    })
  },
  // 取消订单
  cancelOrder(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var index = e.currentTarget.dataset.index;
    wx.showModal({
      title: '提示',
      content: '确定取消订单吗?',
      success: function (sm) {
        if (sm.confirm) {
          util.request({
            method:"GET",
            api: "/wxapi/shopOrder/cancelOrderWhenWaitPay/" + id,
            callback: function (data) {
            if (data.status == '200') {
              _this.getOrderInfo(0);
            }
          }});
        } else if (sm.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
  // 删除订单
  delOrder(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var index = e.currentTarget.dataset.index;
    wx.showModal({
      title: '提示',
      content: '确定删除订单吗?',
      success: function (sm) {
        if (sm.confirm) {
          util.request({ method:"GET",
          api:"/wxapi/shopOrder/delOrder/" + id,callback: function (data) {
            if (data.status == '200') {
              _this.getOrderInfo(0);
            }
          }});
        } else if (sm.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
  // 确认收货
  confirmReceipt(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var index = e.currentTarget.dataset.index;
    wx.showModal({
      title: '提示',
      content: '确认收货吗?',
      success: function (sm) {
        if (sm.confirm) {
          util.request({method:"GET",
          api: "/wxapi/shopOrder/confirmPackageById/" + id,
          callback: function (data) {
            if (data.status == '200') {
              _this.getOrderInfo(0);
            }
          }});
        } else if (sm.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
  // 退款
  refund(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var orderCancel = e.currentTarget.dataset.status;
    wx.navigateTo({
      url: '../refund/refund?id=' + id + "&&orderCancel=" + orderCancel,
    })
  },
  // 进入详情
  intoDetail(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../orderDetails/orderDetails?id=' + id,
    })
  },
  // 上拉加载
  onReachBottom: function () {
    var _this = this;
    var offset = _this.data.offset;
    var limit = _this.data.limit;
    var orderList = _this.data.orderList;
    var status = _this.data.currentIndex;
    _this.setData({
      offset: offset + 1
    });
    offset = _this.data.offset;
    util.request({api: "/wxapi/shopOrder/getMyOrderInfo",data: { "limit": limit, "orderStatus": status, "offset": offset },
    callback: function (data) {
      for (var i = 0; i < data.rows.length; i++) {
        orderList.push(data.rows[i]);
      }
      _this.setData({
        orderList: orderList
      });
    }});
  },
  // 查看物流
  lookLogistics(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var logistStatus = e.currentTarget.dataset.status;
    wx.navigateTo({
      url: '../logistics/logistics?id=' + id + '&&logistStatus=' + logistStatus,
    })
  }
})
pages/order/order.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "我的订单",
  "usingComponents": {}
}
pages/order/order.wxml
New file
@@ -0,0 +1,78 @@
<view class="order_container">
  <view class='tabs_box'>
    <block wx:for="{{tabs}}" wx:key="ids">
       <view class="tabs_item {{currentIndex==index?'selected':''}}" bindtap='onTabsItemEvent' data-index="{{index}}">
           {{item}}
     </view>
    </block>
  </view>
  <view class="order-container" wx:if="{{!orderShow}}">
    <view class="order-list radius" wx:for="{{orderList}}" wx:key="ids" data-id="{{item.id}}" bindtap='intoDetail'>
      <view class='order-top'>
        <text class='grey'>订单编号:{{item.orderNo}}</text>
        <text wx:if="{{item.orderStatus == 1}}" class='explain'>待付款</text>
        <text wx:if="{{item.orderStatus == 2}}" class='explain'>待配送</text>
        <text wx:if="{{item.orderStatus == 3}}" class='explain'>待收货</text>
        <text wx:if="{{item.orderStatus == 4}}" class='explain'>待评价</text>
        <text wx:if="{{item.orderStatus == 5}}" class='explain'>已评价</text>
        <text wx:if="{{item.orderStatus == 6}}" class='explain'>申请退款</text>
        <text wx:if="{{item.orderStatus == 7}}" class='explain'>退款成功</text>
        <text wx:if="{{item.orderStatus == 8}}" class='explain'>退款拒绝</text>
        <text wx:if="{{item.orderStatus == 9}}" class='explain'>已取消</text>
      </view>
      <view class='order-middle' wx:for="{{item.details}}" wx:key="ids" wx:for-item="goods">
        <image src='{{goods.shopProduct.imgMobile}}' class='order-image' mode="aspectFit"></image>
        <view class='order-info'>
          <view class='name'>{{goods.shopProduct.title}}</view>
          <view class='grey norms'>
            <text class="lables" wx:if="{{item.activityType==2}}" >拼团</text>
            <text class="lables" wx:if="{{item.activityType==3}}" >秒杀</text>
            规格:{{goods.shopSku.name}}</view>
          <view class='grey norms'>{{item.storeName}}</view>
          <view class="goods-group">
            <view class='price'>¥{{item.orderMoney}}</view>
            <!-- <view class='grey original_iprice' wx:if="{{goods.shopProduct.markedPrice != null}}">¥{{goods.shopProduct.m  arkedPrice}}</view> -->
          </view>
        </view>
        <text class='grey'>x{{goods.count}}</text>
      </view>
      <view class='order-number'>
        <text class='grey'>共计{{item.purchaseQuantity}}件商品</text>
        <text class='total-text'>合计</text>
        <text class='price'>¥{{item.orderMoney}}</text>
      </view>
      <view class='order-bottom'>
        <!--  不支持在线申请发票
        <text class='cancel-order' wx:if="{{(item.orderStatus == 4 || item.orderStatus == 5) && item.invoiceCount == 0}}" data-index="{{index}}" data-id="{{item.id}}" capture-catch:touchstart='invoice' >申请开票</text>-->
        <text class='cancel-order' wx:if="{{item.orderStatus == 1}}" data-index="{{index}}" data-id="{{item.id}}" bind:touchstart="intoDetail"  capture-catch:touchstart='cancelOrder'>取消订单</text>
        <text class='cancel-order' wx:if="{{item.orderStatus == 2}}" data-index="{{index}}" data-id="{{item.id}}" bind:touchstart="intoDetail"  capture-catch:touchstart='refund'>取消订单</text>
        <text class='cancel-order' wx:if="{{item.orderStatus == 9}}" data-index="{{index}}" data-id="{{item.id}}"   capture-catch:touchstart='delOrder' >删除订单</text>
        <text class='pay' wx:if="{{item.orderStatus == 1}}" data-id="{{item.id}}" capture-catch:touchstart='pay' data-status="{{item.shippingMethod}}" >付款</text>
        <text class='evaluate' wx:if="{{item.orderStatus == 4}}" data-id="{{item.id}}" capture-catch:touchstart='evaluate'>评价</text>
        <text class='cancel-order' wx:if="{{item.orderStatus == 3 }}" capture-catch:touchstart='confirmReceipt'  data-index='{{index}}' wx:for-index="{{idx}}"  data-id="{{item.id}}" style="margin-left:15rpx">确认收货</text>
        <text class='cancel-order' wx:if="{{item.orderStatus == 3 }}" capture-catch:touchstart='refund'  data-index='{{index}}' wx:for-index="{{idx}}"  data-id="{{item.id}}" style="margin-left:15rpx">申请退款</text>
        <text class='cancel-order logistics' wx:if="{{item.orderStatus == 3 && item.shippingMethod == 1}}"  capture-catch:touchstart='lookLogistics' data-id="{{item.id}}" >查看物流</text>
      </view>
    </view>
    <view class="toTap" bind:tap="goTap" hidden='{{!floorstatus}}'>
      <view class="iconfont icontop"></view>
    </view>
  </view>
<!-- <view class='noData' hidden="{{hiddenData}}">暂无更多数据了</view> -->
</view>
  <view class="no-order" wx:if="{{orderShow}}">
    <image src='/image/61.png'></image>
    <text class='no-text'>暂无订单记录</text>
    <text class='wait-active'>亲,您还没有订单,快去购买哦!</text>
  </view>
pages/order/order.wxss
New file
@@ -0,0 +1,131 @@
.tabs_box {
  display: flex;
  color: #999;
  padding: 20rpx 0;
  line-height: 60rpx;
  width: 95%;margin: auto
}
.tabs_box>view {
  text-align: center;
  font-size: 26rpx;
  width: 20%;
}
.selected {
  color: #00c085;
  font-size: 30rpx;
  border-bottom: 6rpx solid #00c085;
}
.order-list {
  background: #fff;
  margin: 0 19rpx;
  padding: 30rpx 32rpx;
  margin-bottom: 10rpx;
}
.order-middle {
  padding: 19rpx 0;
}
.explain {
  color: #ff5806;
  font-size: 26rpx;
  width: 30%;
  text-align: right;
}
.order-image {
  width: 167rpx;
  height: 159rpx;
  margin-right: 21rpx;
}
.order-list>view {
  display: flex;
}
.order-top .grey {
  width: 70%;
}
.order-bottom>text {
  width: 120rpx;
  height: 44rpx;
  line-height: 44rpx;
  display: block;
  font-size: 22rpx;
  text-align: center;
  border-radius: 10rpx;
}
.pay {
  margin-left: 18rpx;
  background: #ff5806;
  color: #fff;
}
.cancel-order {
  color: #999;
  border: 1rpx solid #b3b3b3;
  width: 116rpx;
  height: 40rpx
}
.order-number {
  justify-content: flex-end;
}
.order-bottom {
  justify-content: flex-end;
}
.order-list .price {
  color: #ff4606;
}
.norms {
  margin: 2rpx 0 2rpx 0;
}
.order-info {
  width: 70%;
}
.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 67%;
}
.order-number {
  font-size: 26rpx;
  margin-bottom: 30rpx;
}
.total-text {
  margin-left: 20rpx;
  color: #999;
}
.order-number .price {
  color: #666;
}
.evaluate, .receiving-goods {
  border: 1rpx solid#FF5806;
  margin-left: 18rpx;
  color: #ff5806;
}
.logistics {
  margin-left: 18rpx;
}
.no-order{text-align: center;font-size: 30rpx}
.no-order image{width: 281rpx;height: 258rpx;margin: 200rpx 0 109rpx 0}
.no-text{display: block}
.no-text{color: #333333;margin-bottom: 30rpx}
.wait-active{color: #999999}
.noData{font-size: 26rpx;color: #666;text-align:
center;padding:30rpx 0}
pages/orderDetails/orderDetails.js
New file
@@ -0,0 +1,258 @@
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  data: {
    order:[],
    logisticsInfo:{},
    remarks:"",
    inform: true
  },
  onShow: function () {
    var _this = this;
  },
  onLoad: function (options) {
    this.getOrderInfo(options.id)
    this.getLogisticsInfo(options.id)
    // 判断是否从通知跳进来
    if (options.inform == '1') {
      this.setData({
        inform: false
      })
    }
  },
  //获取根据id获取订单信息
  getOrderInfo:function(id){
    var _this = this;
    util.request({
      method:"GET",
      api:"/wxapi/shopOrder/getOrderInfoById/" + id,
      callback: function (data) {
      console.log(data);
        var createTime = new Date(data.rows[0].createTime);
        console.log("createTime", createTime);
        console.log(createTime.toString());
        console.log(JSON.stringify(createTime));
        data.rows[0].createTime = util.dateFtt(createTime)
        if (data.rows[0].deliveryInfo !=null && data.rows[0].deliveryInfo.deliveryTime != null){
          var deliveryTime = new Date(data.rows[0].deliveryInfo.deliveryTime);
          data.rows[0].deliveryInfo.deliveryTime = util.dateFtt(deliveryTime)
        }
        var discountExplain = JSON.parse(data.rows[0].discountExplain);
        _this.setData({
          order: data.rows[0],
          activity: discountExplain.activity,
          coupon: discountExplain.coupon
        })
        _this.setData({
          order:data.rows[0],
        })
    }});
  },
  // 支付
  pay(e) {
    var id = e.currentTarget.dataset.id;
    console.log("支付");
    var _this = this;
    var sendData = {
    }
    util.request({
      method: "GET",
      api:"/wxapi/shopOrder/orderSettlement/" + id,
      data:sendData,
     callback:function (data) {
        console.log(data);
        wx.requestPayment({
          'timeStamp': data.rows[0].timeStamp,
          'nonceStr': data.rows[0].nonceStr,
          'package': data.rows[0].prepay_id,
          'signType': 'MD5',
          'paySign': data.rows[0].paySign,
          'success': function (res) {
            console.log(res.errMsg)
            if (res.errMsg == 'requestPayment:ok') {
              console.log(data.mapInfo.orderId);
              //成功后的回调;
              util.request({
                method:"GET",
                api: '/wxapi/shopOrder/findOrderPayStatus/' + data.mapInfo.orderId,
                callback: function (payRes) {
                console.log("查询支付结果", payRes);
                if (payRes.mapInfo.status == 'success') {
                  wx.navigateTo({
                    url: '../payOrder/paySuccess?getBack=2',
                  });
                  wx.showToast({
                    title: payRes.mapInfo.msg,
                    icon: 'success'
                  })
                } else {
                  wx.showToast({
                    title: payRes.mapInfo.msg,
                    duration: 2000,
                    image: "/image/fail.png"
                  })
                  wx.navigateTo({
                    url: '../payOrder/payError',
                  })
                }
              }});
            } else {
              console.log("支付失败");
              wx.navigateTo({
                url: '../order/order',
              })
            }
            //{errMsg: "requestPayment:ok"}
          },
          'fail': function (res) {
            wx.navigateTo({
              url: '../order/order?status=1',
            })
          }
        })
      }});
  },
  // 退款
  refund(e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../refund/refund?id=' + id+'&&getBack=1',
    })
  },
  // 确认收货
  confirmReceipt(e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var index = e.currentTarget.dataset.index;
    wx.showModal({
      title: '提示',
      content: '确认收货吗?',
      success: function (sm) {
        if (sm.confirm) {
          util.request({
            method:"GET",
            api: "/wxapi/shopOrder/confirmPackageById/" + id,
            callback: function (data) {
            let pages = getCurrentPages();//当前页面
            let prevPage = pages[pages.length - 2];//上一页面
            prevPage.setData({//直接给上移页面赋值
              refresh: true
            });
            wx.navigateBack({
              delta: 1
            })
          }});
        } else if (sm.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
  // 开票
  invoice(e) {
    var id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../applyInvoice/applyInvoice?id=' + id + '&&getBack=1',
    })
  },
  // 评价
  evaluate(e) {
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../productEvaluate/productEvaluate?id=' + id + '&&getBack=1',
    })
  },
  // 获取物流信息
  getLogisticsInfo:function(id){
    var _this = this;
    util.request({
      method:"GET",
      api: "/wxapi/ShopLogisticsQuery/getLogisticsByOrderId/"+id,callback: function (data) {
      console.log(data.mapInfo.logisticsInfo);
      console.log(data.mapInfo.logisticsInfo.isShipments)
      if (data.status == 200) {
        _this.setData({
          logisticsInfo: data.mapInfo.logisticsInfo
        })
      }
    }});
  },
  // 进入物流页面
  intoLogistics(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../logistics/logistics?id=' + id,
    })
  },
  // 取消订单
  cancelOrder(e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var index = e.currentTarget.dataset.index;
    wx.showModal({
      title: '提示',
      content: '确定取消订单吗?',
      success: function (sm) {
        if (sm.confirm) {
          util.request({
            method:"GET",
            api: "/wxapi/shopOrder/cancelOrderWhenWaitPay/" + id,
            callback: function (data) {
            if (data.status == '200') {
              wx.redirectTo({
                url: '../orderDetails/orderDetails?id=' + id,
              })
            }
          }});
        } else if (sm.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
  // 跳转至商品页
  goGoods(e) {
    var id = e.currentTarget.dataset.id;
    var status = e.currentTarget.dataset.status;
    var delflag = e.currentTarget.dataset.delflag;
    if (status == 2 || delflag == 1){
      wx.showToast({
        title: "商品已失效",
        icon: "none"
      });
    } else {
      wx.navigateTo({
        url: '../details/details?id=' + id, //把id传到product页面
      })
    }
  },
  // 回到首页
  goBack() {
    wx.switchTab({
      url: '../index/index'
    })
  },
})
pages/orderDetails/orderDetails.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "订单详情"
}
pages/orderDetails/orderDetails.wxml
New file
@@ -0,0 +1,154 @@
<view class="main">
  <view class='order-container'>
    <view class='order-list'>
      <view class='order-text radius' wx:if="{{(order.orderStatus > 1)}}">
        <view wx:if="{{(order.orderStatus == 2)}}">
          <text class="iconfont  icon-huowu icon-color"></text>
          <text class='grey'>待商家确认</text>
        </view>
        <view wx:if="{{(order.orderStatus == 3)}}">
          <text class="iconfont  icon-huoche icon-color"></text>
          <text class='grey'>待收货</text>
        </view>
        <view wx:if="{{(order.orderStatus > 3 &&order.orderStatus!=9  )}}">
          <text class="iconfont  icon-yiqianshou icon-color"></text>
          <text class='grey'>已签收</text>
        </view>
        <view wx:if="{{(order.orderStatus==9)}}">
          <text class="iconfont  icon-yiqianshou icon-color"></text>
          <text class='grey'>订单取消</text>
        </view>
      </view>
      <view class="order-list-info radius">
        <view class='order-logistics' wx:if="{{logisticsInfo.isShipments == 1 }}" bindtap='intoLogistics' data-id="{{order.id}}">
          <view class='order-logist-top'>
            <text class='order-logist-text' wx:if="{{logisticsInfo.isShipments == 1 && (logisticsInfo.logisticsStatus == 0 || logisticsInfo.logisticsStatus == 1 || logisticsInfo.logisticsStatus == 2)}}">
            运输中</text>
            <text class='order-logist-text' wx:if="{{logisticsInfo.isShipments == 1 && ( logisticsInfo.logisticsStatus == 3)}}">已签收</text>
            <text class='order-logist-text' wx:if="{{logisticsInfo.isShipments == 1 && ( logisticsInfo.logisticsStatus == 4)}}">待签收</text>
            <text class='order-logist-add'>{{logisticsInfo.describe}}</text>
          </view>
          <view class='iconfont icon-youbian'></view>
        </view>
        <view class='order-address'>
          <view class='invoice-address-info'>
            <view class="order-add-address">
              <view class="orders-address">
                <view class="iconfont icon-address"></view>
                <view class="order-address-list">
                  <view>
                    <text class="orders-address-name threeblack">{{order.userName}}  </text>
                    <text class="orders-address-phone grey">{{order.userTel}}</text>
                  </view>
                  <view class='orders-address-item'>
                    <text wx:if="{{address.addrDefault==1}}" class="default">默认</text>
                    <view class="orders-address-detail">{{order.deliveryInfo.receiveAddress == null?'':order.deliveryInfo.receiveAddress}}</view>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
      <view class='order-detail'>
        <view>
          <view mode="aspectFit" data-id="{{item.shopProduct.id}}" data-status="{{item.shopProduct.status}}" data-delflag="{{item.shopProduct.delFlag}}" bindtap="goGoods" class='order-detail-top' wx:for="{{order.details}}">
            <image class='order-image' src="{{item.shopProduct.imgMobile}}" mode="aspectFit"></image>
            <view class='order-detail-info'>
              <text class='name'>{{item.shopProduct.title}}</text>
              <text class='grey norms'>规格:{{item.shopSku.name}}</text>
              <text class='grey'>品牌:{{item.shopProduct.brand}}</text>
            </view>
            <text class='grey price'>¥{{item.shopProduct.price}}</text>
          </view>
          <view class='order-detail-middle grey'>
          <view class='goods-total'>
              {{order.storeName}}
            </view>
            <view class='goods-total'>
              <view class='order-left'>商品总价</view>
              <view class='order-right'>¥{{order.commodityPrice}}</view>
            </view>
            <view class='freight'>
              <view class='order-left'>满减满折</view>
              <view class='order-right'>-¥{{activity}}</view>
            </view>
            <view class='freight'>
              <view class='order-left'>优惠券</view>
              <view class='order-right'>-¥{{coupon}}</view>
            </view>
            <view class='freight'>
              <view class='order-left'>运费(快递)</view>
              <view class='order-right'>¥{{order.postage==null?0:order.postage}}</view>
            </view>
            <view class='freight'>
              <view class='order-left' style="width:15%">备注</view>
              <!-- <textarea bindblur="bindTextAreaBlur" disabled="true" style="width:85%" bindinput='txtInput' class="order-right" value="{{txtContent}}" auto-height="true"/> -->
              <text style="width:85%" class="order-right explain">{{order.remarks==null?"":order.remarks}}</text>
            </view>
            <view class='order-total'>
              <view class='order-left'>订单总价</view>
              <view class='order-right'>¥{{order.orderMoney}}</view>
            </view>
            <view class='real-total'>
              <view class='order-left'>实付款</view>
              <view class='order-right price'>¥{{order.orderMoney}}</view>
            </view>
          </view>
        </view>
      </view>
      <view class='order-info grey'>
        <view class='order-number'>
          <view class='order-left'>订单编号</view>
          <view class='order-right'>{{order.orderNo}}</view>
        </view>
        <view class='create-time'>
          <view class='order-left'>创建时间</view>
          <text class='order-right' decode="{{true}}">{{order.orderTimeWx}}</text>
        </view>
        <view class='pay-time'>
          <view class='order-left'>付款时间</view>
          <text class='order-right' decode="{{true}}">{{order.paymentTimeWx == null?'':order.paymentTimeWx}}</text>
        </view>
        <view class='deliver-time'>
          <view class='order-left'>发货时间</view>
          <text class='order-right' decode="{{true}}">{{order.deliveryInfo.deliveryTimeWx == null?'':order.deliveryInfo.deliveryTimeWx}}</text>
        </view>
        <view class='service'>
          <button open-type='contact'>
            <view class="iconfont icon-kefu1"></view>
            联系客服
          </button>
        </view>
      </view>
      <view class='order-footer'>
        <view class='order-footer-list'>
          <view class='footer-text' wx:if="{{order.orderStatus == 4 && inform}}" data-id="{{order.id}}" bindtap='evaluate'>评价</view>
          <view class='footer-text' wx:if="{{order.orderStatus == 1 && inform}}" data-index="{{index}}" data-id="{{order.id}}" bindtap='cancelOrder'>取消订单</view>
          <view class='footer-text' wx:if="{{order.orderStatus == 2 && inform}}" data-index="{{index}}" data-id="{{order.id}}" bindtap='refund'>取消订单</view>
          <view class='footer-text' wx:if="{{order.orderStatus == 3 && inform}}" bindtap='refund' data-id="{{order.id}}">申请退款</view>
          <view class='goods' wx:if="{{order.orderStatus == 1 && inform}}" data-id="{{order.id}}" bindtap='pay'>付款</view>
        </view>
      </view>
    </view>
  </view>
</view>
<view bindtap="goBack" hidden="{{inform}}" class="goIndex">回到首页</view>
pages/orderDetails/orderDetails.wxss
New file
@@ -0,0 +1,44 @@
@import "/common/css/refund.wxss";
.order-footer-list {
  background: #fff;
  display: flex;
  justify-content: flex-end;
  width: 95%;
  height: 106rpx;
  align-items: center;
}
.order-footer {
  width: 100%;
  position: fixed;
  bottom: 0;
  height: 106rpx;
  background: #fff;
  left: 0;
}
.order-footer-list>view {
  width: 120rpx;
  height: 44rpx;
  line-height: 44rpx;
  text-align: center;
  border-radius: 10rpx;
  font-size: 22rpx;
}
.main{padding-bottom: 20rpx}
.explain{
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap
}
.order-address{
  margin-top: 0
}
.icon-color{
color: #00c085;
font-size: 40rpx;
margin: 25rpx 22rpx 0 0;
}
pages/payOrder/payError.js
New file
@@ -0,0 +1,3 @@
Page({
})
pages/payOrder/payError.json
New file
@@ -0,0 +1 @@
{}
pages/payOrder/payError.wxml
New file
@@ -0,0 +1,9 @@
<view class="main">
  <view class='payStatus'>
    <view class='iconfont icon-xianshi_quxiaotianchong'></view>
    <view class="pay-success">支付失败</view>
  </view>
  <view>
    <button class="return">返回</button>
  </view>
</view>
pages/payOrder/payError.wxss
New file
@@ -0,0 +1,31 @@
page{
  background-color: #F7F7F7;
}
.main{
  background: #fff;
  margin: 40rpx 22rpx;
  border-radius: 20rpx;
  padding-bottom:94rpx;
}
.payStatus{
  margin: auto;
  text-align: center
}
.icon-xianshi_quxiaotianchong{
  font-size: 180rpx;
  color: red;
  padding-top: 194rpx;
}
.pay-success{
  font-size: 38rpx;
  color: #333333;
  font-weight: bold;
}
.return{
  background-color: #FF5806;
  margin: 0 20rpx;
  margin-top: 120rpx;
  font-size: 32rpx;
  font-weight: bold;
  color: #fff;
}
pages/payOrder/payOrder.js
New file
@@ -0,0 +1,17 @@
const app = getApp()
Page({
  data: {
    orderId: '2019811111111111111',
    payStatus: true
  },
  payChoose(e) {
    console.log(this.data.payStatus);
    let payStatus = this.data.payStatus;
    if (payStatus) {
      this.data.payStatus = false;
    } else {
      this.data.payStatus = true;
    }
  }
})
pages/payOrder/payOrder.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/payOrder/payOrder.wxml
New file
@@ -0,0 +1,19 @@
<view >
  <view class="order-info">
    <view class="order-info-input">订单编号 <text class="order-info-id">{{orderId}}</text></view>
    <view class="order-info-input order-info-pay">支付金额 <text class="order-info-money">¥13.00</text></view>
  </view>
  <view class="order-pay">
    <view class="choose-pay-style">选择支付方式:</view>
    <view class="pay-style">
      <image class="wxImg" src='http://file.micromall.xczhyf.cn/wxxcx/image/16.png'></image>微信支付
    <icon  class="pay-icon iconfont icon-gouxuan" bindtap="payChoose" />
    </view>
  </view>
  <view class="pay-feature" >
    <button class="pay-button">确认支付</button>
  </view>
</view>
pages/payOrder/payOrder.wxss
New file
@@ -0,0 +1,85 @@
page{
  background-color: #F7F7F7;
  font-size:26rpx;
}
.order-info{
  margin: 10rpx 20rpx;
  background-color: #FFF;
  padding-bottom: 15rpx;
  border-radius: 10rpx;
  font-weight: bold;
  padding:30rpx 0
}
.order-info-pay{ padding-top: 39rpx }
.order-info-input{
  color: #333;
  font-size: 26rpx;
  margin:0 30rpx;
}
.pay-title{
  margin: 20rpx 40rpx;
}
.order-info-id{
  float:right;
  color: #666;
  font-size:24rpx;
  font-weight: 500
}
.order-info-money{
  float:right;
  color:#FF4606;
  font-size:32rpx;
}
.order-pay{
  background-color: #FFF;
  border-radius:10rpx;
  margin:10rpx 20rpx;
  padding:30rpx 0;
}
.choose-pay-style{
  padding: 0 22rpx;
  font-size: 26rpx;
  font-weight: bold;
  color: #333
}
.pay-style{
   padding-left: 21rpx;
   font-size: 26rpx;
   color: #333;
   font-weight: bold;
   padding-top: 33rpx;
}
.pay-icon{
  margin-top: 20rpx;
  margin-right:40rpx;
  float:right;
}
.pay-button{
  background-color: #FF5806;
  color: #FFF;
  height: 88rpx;
  line-height:88rpx;
  font-size:32rpx;
  border-radius: 10rpx;
  font-weight: bold;
}
.pay-feature{
  padding-top:109rpx;
  margin:auto;
  width: 89%
}
.wxImg{
  margin-top: -4rpx;
  width: 37rpx;
  height:39rpx;
  margin-right: 14rpx;
}
.icon-gouxuan{
  color: #00C085;
  margin-top: -12rpx;
  font-size: 34rpx;
}
button:after {
  border: 0px;
}
pages/payOrder/paySuccess.js
New file
@@ -0,0 +1,142 @@
var util = require('../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    //拼团订单,进行中
    SHOW_MODEL_GROUP : 3,
    //拼团订单结束
    SHOW_MODEL_GROUP_END : 1,
    SHOW_MODEL_NORMAL:0,
    getBack:'',
    status:'',
    showModel:0,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if (options.getBack != undefined){
      this.setData({
        getBack: options.getBack
      })
    }
    if (options.status != undefined){
      this.setData({
        status: options.status
      })
    }
    if (options.showModel != undefined) {
      this.setData({
        showModel: options.showModel
      })
    }
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    var _this=this;
    var shareData =wx.getStorageSync('shareData');
    let url = "pages/groupbuy/groupDetails?id=" + shareData.id + "&shopId=" + shareData.shopId + "&gjId=" + shareData.gjId;
    return {
      title: shareData.title,
      imageUrl: shareData.imageUrl,
      path: url,
    }
  },
  // 返回至订单页面
  withdraw(){
    var getBack = this.data.getBack;
    var status = this.data.status;
    if(getBack == '1'){
      let pages = getCurrentPages();//当前页面
      let prevPage = pages[pages.length - 2];//上一页面
      prevPage.setData({//直接给上移页面赋值
        refresh: true
      });
      wx.navigateBack({
        delta: 1
      })
    } else if (getBack == '2'){
      let pages = getCurrentPages();//当前页面
      let prevPage = pages[pages.length - 3];//上一页面
      prevPage.setData({//直接给上移页面赋值
        refresh: true
      });
      wx.navigateBack({
        delta: 2
      })
    } else {
      if (status == '2'){
        wx.navigateTo({
          url: '../order/order?status=3',
        })
      } else {
        wx.navigateTo({
          url: '../order/order?status=2',
        })
      }
    }
  }
})
pages/payOrder/paySuccess.json
New file
@@ -0,0 +1 @@
{}
pages/payOrder/paySuccess.wxml
New file
@@ -0,0 +1,15 @@
<view class="main">
  <view class='payStatus'>
    <icon type="success" size="90" color='#00C085'/>
    <view class="pay-success">支付成功</view>
  </view>
  <view>
    <button class="return" bindtap='withdraw'  wx:if="{{showModel==SHOW_MODEL_NORMAL}}" >返回</button>
    <button class="return" open-type="share"   wx:if="{{showModel==SHOW_MODEL_GROUP}}" >邀请好友参加拼团</button>
    <button class="return" bindtap='withdraw'   wx:if="{{showModel==SHOW_MODEL_GROUP_END}}" >拼团成功,返回</button>
  </view>
</view>
pages/payOrder/paySuccess.wxss
New file
@@ -0,0 +1,28 @@
page{
  background-color: #F7F7F7;
}
.main{
  background: #fff;
  margin: 40rpx 22rpx;
  border-radius: 20rpx;
  padding-bottom:94rpx;
}
.payStatus{
  margin: auto;
  text-align: center;
  padding:195rpx 0 135rpx 0;
}
.pay-success{
  font-size: 38rpx;
  color: #333333;
  font-weight: bold;
  margin-top: 16rpx
}
.return{
  background-color: #FF5806;
  margin: 0 20rpx;
  font-size: 30rpx;
  font-weight: bold;
  color: #fff;
  line-height:88rpx;
}
pages/phone/phone.js
New file
@@ -0,0 +1,81 @@
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var app=getApp();
Page({
  data: {
    phoneNumber: "",
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
  },
  //提交表单
  formSubmit: function(e) {
    var _this = this;
    var data = e.detail.value;
    data.shopId=app.shopInfo.id;
    var rules = {};
    rules["phoneNumber"] = {
      "rule": "$tel"
    };
    if (util.validForm(data, rules)) {
     util.request({
       api: api.auth.bindingPhoneNumber,
       data:data,
       callback:function(data){
         wx.showModal({
           title: data.info,
           showCancel: false,
           cancelText: "否",
           cancelColor: 'skyblue',
           confirmText: "确定",
           success: function (res) {
             wx.navigateBack({
               delta: 1
             })
           }
         })
       }
     });
    }
  },
  getPhoneNumber(e) {
    if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
      wx.showToast({
        title: '取消授权',
        duration: 2000,
      })
      return;
    }
    //请求解密数据
    var _this = this;
    util.request({
      api: '/wxapi/shopBindingPhoneNumber/deciphering',
      data: e.detail,
      callback: function (data) {
        var result = JSON.parse(data.mapInfo.decipher);
        if (result == null || result.phoneNumber == null) {
          wx.showToast({
            title: '获取手机号码失败',
            duration: 2000,
          })
        } else {
          _this.setData({
            phoneNumber: result.phoneNumber
          })
          getApp().userInfo.phoneNumber = result.phoneNumber;
        }
      }
    });
  }
})
pages/phone/phone.json
New file
@@ -0,0 +1,3 @@
{
 "navigationBarTitleText": "绑定手机号"
}
pages/phone/phone.wxml
New file
@@ -0,0 +1,17 @@
<view class="main">
  <text class="name exlpain-text">为了能及时给您预约,请您绑定正确的手机号</text>
  <form bindsubmit="formSubmit">
    <view class="phone-container">
      <view class="dsplay">
        <view class="grey-bg">
          <text class="name">+86</text>
          <input name="phoneNumber" maxlength="11" value="{{phoneNumber}}" type='number' bindinput="phoneInput" />
        </view>
        <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" >自动获取手机号</button>
      </view>
    </view>
    <view class="btn-area">
      <button   formType="submit">完成</button>
    </view>
  </form>
</view>
pages/phone/phone.wxss
New file
@@ -0,0 +1,54 @@
.exlpain-text{
  padding: 30rpx 20rpx;
  display: block
}
.grey-bg{
  padding: 30rpx;
  display: flex;
  align-items: center;
}
.phone-container{
    background: #fff;
    margin: 0 20rpx;
    border-radius: 10rpx;
}
input{padding-left: 10rpx;font-size: 30rpx;width: 100%;}
.dsplay{
  display: flex;
  align-items: center
}
.dsplay button {
  line-height: 60rpx;
  height: 60rpx;
  border: none;
  text-align: center;
  font-size: 26rpx;
  padding-left: 0;
  padding-right: 0;
  width: 28%;
  color: #fff;
  background: #00C085;
  border-radius: 10rpx
}
button:after {
  border: 0px;
  color: #fff;
}
.dsplay .grey-bg{
  width: 58%;
  white-space: nowrap
}
.btn-area button{
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #ff5806;
  color: #fff;
  height: 106rpx;
  line-height: 106rpx;
  text-align: center;
  font-size: 28rpx;
  border-radius: 0;
  border: none;
}
pages/productEvaluate/productEvaluate.js
New file
@@ -0,0 +1,135 @@
var util = require('../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    productList:[],
    //productList:[],
    stardata:[1,2,3,4,5],
    flag:0,
    fatherDom:0, //父级节点
    order:{},
    getBack:''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getGoodsList(options.id);
    if (options.getBack != undefined){
      this.setData({
        getBack : options.getBack
      })
    }
  },
  changeColor(e){
    var myindex = e.currentTarget.dataset.myindex + 1;
    var index = e.currentTarget.dataset.index;
    var _this = this;
    var productList = _this.data.productList;
    productList[index].comScore = myindex;
    console.log(index);
    _this.setData({
      productList: productList
    })
  },
  //根据订单id获取产品信息
  getGoodsList:function(id){
    var _this = this;
    util.request({
      method:"GET",
      api: "/wxapi/shopOrder/getOrderInfoById/" + id,
      callback: function (data) {
      if (data.status == '200') {
        console.log(data.rows[0]);
        var productList = _this.data.productList;
        for (var i = 0; i < data.rows[0].details.length; i++){
          var product = {
            productId:data.rows[0].details[i].shopProduct.id,
            orderNum: data.rows[0].orderNo,
            orderId: data.rows[0].id,
            comScore: 0,
            imgMobile: data.rows[0].details[i].shopProduct.imgMobile,
            content:''
          }
          productList.push(product);
        }
        _this.setData({
          productList: productList
        })
      }
    }});
  },
  // 提交评价
  commitEvaluate(){
    var _this = this;
    var commitContentList = []; //提交内容
    console.log(_this.data.productList);
    for (var i = 0; i < _this.data.productList.length; i++){
      var commitContent = {
        productId: _this.data.productList[i].productId,
        orderId: _this.data.productList[i].orderId,
        comContent: _this.data.productList[i].content,
        comScore: _this.data.productList[i].comScore,
      }
      commitContentList.push(commitContent);
    }
    console.log(commitContentList);
    util.request({
      api: '/wxapi/ProductComment/saveProductComment',
      data:commitContentList,
      callback:function (data) {
      if (data.status == '200') {
        wx.showToast({
          title: '评价成功',
          icon: "none",
          duration: 2000,
        });
        setTimeout(function () {
          var getBack = _this.data.getBack;
          let pages = getCurrentPages();//当前页面
          let prevPage = pages[pages.length - 2];//上一页面
          if (getBack == '1'){
            prevPage = pages[pages.length - 3]
          }
          prevPage.setData({//直接给上移页面赋值
            refresh: true
          });
          if (getBack == '1') {
            wx.navigateBack({
              delta: 2
            })
          } else {
            wx.navigateBack({
              delta: 1
            })
          }
        }, 1000)
      }
    }});
  },
  // 数据绑定
  formName: function (e) {
    var index = e.currentTarget.dataset.index;
    var productList = this.data.productList;
    productList[index].content = e.detail.value;
    this.setData({
      productList: productList
    })
  },
})
pages/productEvaluate/productEvaluate.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "产品评价",
  "usingComponents": {}
}
pages/productEvaluate/productEvaluate.wxml
New file
@@ -0,0 +1,29 @@
<view class="main">
  <view class='productEv-container'>
    <block wx:for="{{productList}}" wx:key="ids">
      <view class="evaluate-list radius" data-index="{{index}}">
        <text class='grey order-number'>订单编号:{{item.orderNum}}</text>
        <view class='evaluate-info'>
          <image class='evaluate-image' src='{{item.imgMobile}}'> </image>
          <view class='explain-detail'>
            <text class='explain-text'>描述相符:</text>
            <view class='star' data-id="{{item.productId}}">
              <image class='stars' bindtap="changeColor"
                data-index='{{index}}'
                data-value="{{item}}"
                data-myindex="{{id}}"
                wx:for-index="id"
                wx:for-item="star"
                wx:for="{{stardata}}"
                src="{{item.comScore>=star? '/image/star1.png': '/image/star2.png'}}" />
            </view>
          </view>
        </view>
        <view class='orders-textarea'>
          <textarea class="orders-bottom-text-input radius" value="{{item.content}}"  bindinput='formName' data-index="{{index}}"  bindblur="bindTextAreaBlur" placeholder='分享您对本产品心得…' focus maxlength="-1" />
        </view>
      </view>
    </block>
  </view>
  <cover-view class='btn-release' bindtap='commitEvaluate'>发布</cover-view>
</view>
pages/productEvaluate/productEvaluate.wxss
New file
@@ -0,0 +1,23 @@
.evaluate-list{margin-left: 30rpx;margin-right: 30rpx;margin-bottom: 10rpx;background: #fff;padding:0 34rpx}
.productEv-container{padding-top: 30rpx;padding-bottom: 126rpx}
.evaluate-image{width: 125rpx;height: 96rpx;margin-right: 20rpx;}
.evaluate-info{display: flex;margin: 30rpx 0;align-items: center}
.explain-text{font-size: 26rpx;color: #000;margin-right: 20rpx}
.order-number{padding: 40rpx 0 23rpx 0;display: block;border-bottom:1rpx solid #eee}
.orders-bottom-text-input{
  width:576rpx;
height:236rpx;
background:#E1E8ED;
border:2rpx solid #A9A9A9;
opacity:0.3;
/* display: inline-block; */
font-size:22rpx;
padding:32rpx 28rpx
}
.orders-textarea{
padding-bottom: 30rpx
}
.btn-release{width: 100%;height: 106rpx;line-height: 106rpx;background: #FF5806;position: fixed;bottom: 0;text-align: center;color: #fff;font-size: 28rpx;z-index: 999}
.star image{width: 39rpx;height: 37rpx;margin-right: 9rpx}
.explain-detail{display: flex;align-items: center}
.star{margin-top: -4rpx}
pages/refund/refund.js
New file
@@ -0,0 +1,148 @@
// pages/refund/refund.js
var util = require('../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    productList:[],
    shippingMethod:0, // 1 物流  2 自提
    orderStatus: 0,
    getBack:''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 根据订单id查询商品
    this.getGoodsList(options.id)
    // console.log(options.status)
    if (options.getBack != undefined){
      this.setData({
        getBack: options.getBack
      })
    }
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  },
  //根据订单id获取产品信息
  getGoodsList: function (id) {
    var _this = this;
    util.request({
      method:"GET",
      api: "/wxapi/shopOrder/getOrderInfoById/" + id,
      callback: function (data) {
      if (data.status == '200') {
        console.log(data.rows[0]);
        var productList = _this.data.productList;
        for (var i = 0; i < data.rows[0].details.length; i++) {
          var product = {
            productId: data.rows[0].details[i].shopProduct.id,
            orderNum: data.rows[0].orderNo,
            orderId: data.rows[0].id,
            imgMobile: data.rows[0].details[i].shopProduct.imgMobile,
            name: data.rows[0].details[i].shopProduct.title,
            sku: data.rows[0].details[i].shopSku.name,
            price: data.rows[0].orderMoney,
            status: data.rows[0].details[i].shopProduct.status,
            delflag: data.rows[0].details[i].shopProduct.delFlag
          }
          productList.push(product);
        }
        // console.log(data.rows[0].orderStatus)
        _this.setData({
          productList: productList,
          shippingMethod: data.rows[0].shippingMethod,
          orderStatus: data.rows[0].orderStatus
        })
      }
    }});
  },
  // 我要退款
  wantRefund(e){
    var _this = this
    var status = e.currentTarget.dataset.status
    // console.log(status)
    var orderStatus = this.data.orderStatus;
    console.log(orderStatus)
    var productList = _this.data.productList
    wx.setStorageSync("model", productList)
    var getBack = _this.data.getBack;
    wx.redirectTo({
      url: '../applyRefund/applyRefund?status=' + status + '&&getBack=' + getBack + '&&orderStatus=' + orderStatus
    })
  },
  // 进入商品页面
  intoGoods(e){
    var id = e.currentTarget.dataset.id
    var status = e.currentTarget.dataset.status;
    var delflag = e.currentTarget.dataset.delflag;
    if (status == 2 || delflag == 1) {
      wx.showToast({
        title: "商品已失效",
        icon: "none"
      });
    } else {
      wx.navigateTo({
        url:  '../details/details?id=' + id
      })
    }
  }
})
pages/refund/refund.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "选择服务类型",
  "usingComponents": {}
}
pages/refund/refund.wxml
New file
@@ -0,0 +1,23 @@
<view class="main">
  <view class="refund-container">
      <view class='refund-top radius refund-list'>
       <view wx:for="{{productList}}" wx:key="ids" data-id="{{item.productId}}" data-status="{{item.status}}"  data-delflag="{{item.delflag}}" bindtap="intoGoods">
         <image src="{{item.imgMobile}}" class='refund-image'></image>
          <view class='refund-info'>
            <text class='name'>{{item.name}}</text>
            <text class='grey'>规格:{{item.sku}}</text>
          </view>
       </view>
      </view>
      <view class='refund-content radius refund-list'>
        <view>
          <text class='name' bindtap='wantRefund' data-status='1'>我要退款(无需退货)</text>
          <view class="iconfont icon-youbian"></view>
        </view>
        <view wx:if="{{shippingMethod == 1 && orderStatus == 3}}">
          <text class='name' bindtap='wantRefund' data-status='2' >我要退货退款</text>
          <view class="iconfont icon-youbian"></view>
        </view>
      </view>
    </view>
</view>
pages/refund/refund.wxss
New file
@@ -0,0 +1,42 @@
.refund-image {
  width: 120rpx;
  height: 80rpx;
}
.refund-container {
  padding-top: 20rpx;
}
.refund-list {
  background: #fff;
  margin: 0 20rpx 10rpx 20rpx;
}
.refund-content>view {
  display: flex;
  line-height: 80rpx;
  padding: 0 30rpx;
}
.iconfont {
  margin-top: 3rpx;
  color: #cacaca;
}
.name {
  white-space: nowrap;
  width: 96%;
}
.refund-top>view {
  padding: 30rpx;
  display: flex;
}
.refund-info{
  width: 76%;
}
.refund-info>text {
  display: block;
  margin-left: 21rpx;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}
.refund-info .grey {
  margin-top: 6rpx;
}
pages/refundOrder/refundOrder.js
New file
@@ -0,0 +1,184 @@
var util = require('../../utils/util.js');
Page({
  data: {
    orderList: [],
    money:'',
    refundShow:false,
    limit:5,
    offset:0
  },
  onLoad: function (options) {
    var status = options.status;
    if (status != undefined) {
      this.getOrderInfo(status);
      this.setData({
        currentIndex: status
      })
    } else {
      this.getOrderInfo(0);
      this.goTap();
    }
  },
  //一键回到顶部
  goTap() {
    util.goTap();
  },
  //获取滚动条当前位置
  onPageScroll: function (e) {
    // console.log(e)
    if (e.scrollTop > 200) {
      this.setData({
        floorstatus: true
      });
    } else {
      this.setData({
        floorstatus: false
      });
    }
  },
  onTabsItemEvent(e) {
    var index = e.currentTarget.dataset.index;
    this.getOrderInfo(index);
    this.setData({
      currentIndex: index
    })
  },
  // 根据状态获取订单信息
  getOrderInfo: function () {
    var _this = this;
    util.request({
      api: "/wxapi/RefundRecord/findRefundRecord",
      data:{ "limit": 10, "offset": 0 },
      callback: function (data) {
      console.log(data)
      _this.setData({
        orderList: data.rows,
      });
      console.log(data.rows)
      if(data.rows.length ==0){
        _this.setData({
          refundShow:true
        })
      }
      if (data.rows.length != 0){
        _this.getMoney(data.rows[0].orderId);
      }
    }});
  },
  //跳转链接
  refund(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../refunding/refunding?id='+id,
    })
  },
  // 获取退款金额
  getMoney:function(id){
    var _this = this;
    util.request({
      api:"/wxapi/RefundRecord/getRefundMoneyByOrderId/"+id,
      callback, function (data) {
      _this.setData({
        money: data.rows[0].refundMoney,
      });
    }});
  },
  // 取消退款
  cannelRefund(e){
    var _this = this;
    var id = e.currentTarget.dataset.id;
    console.log(id)
    wx.showModal({
      title: '提示',
      content: '确定取消退款吗?',
      success: function (sm) {
        if (sm.confirm) {
          util.request({
            api: "/wxapi/RefundRecord/cancelRefund/" + id, callback: function (data) {
            if(data.status=='200'){
              _this.getOrderInfo()
            }
          }});
        } else if (sm.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
  // 查看详情
  lookDetail(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../refunding/refunding?id=' + id,
    })
  },
  // 查看取消详情
  lookCannel(e) {
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../cannelRefund/cannelRefund?id=' + id,
    })
  },
  // 成功退款
  successRefund(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../refunDetail/refunDetail?id=' + id + '&&status=1',
    })
  },
  // 退款失败
  errorRefund(e){
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../refunDetail/refunDetail?id=' + id + '&&status=2',
    })
  },
  // 进入商品页面
  intoGoods(e) {
    var id = e.currentTarget.dataset.id
    var status = e.currentTarget.dataset.status;
    var delflag = e.currentTarget.dataset.delflag;
    if (status == 2 || delflag == 1) {
      wx.showToast({
        title: "商品已失效",
        icon: "none"
      });
    } else {
      wx.navigateTo({
        url: '../details/details?id=' + id
      })
    }
  },
  // 上拉加载
  onReachBottom: function () {
    var _this = this;
    var offset = _this.data.offset;
    var limit = _this.data.limit;
    var orderList = _this.data.orderList;
    _this.setData({
      offset: offset + limit
    });
    offset = _this.data.offset;
    util.request({
      api: '/wxapi/RefundRecord/findRefundRecord',
      data:{ "limit": limit, "offset": offset },
      callback: function (data) {
      for (var i = 0; i < data.rows.length; i++) {
        orderList.push(data.rows[i])
      }
      _this.setData({
        orderList: orderList
      })
    }});
  }
})
pages/refundOrder/refundOrder.json
New file
@@ -0,0 +1,4 @@
{
  "navigationBarTitleText": "退款订单",
  "usingComponents": {}
}
pages/refundOrder/refundOrder.wxml
New file
@@ -0,0 +1,40 @@
<view class="order-container" wx:if="{{!refundShow}}">
    <view class="order-list radius" wx:for="{{orderList}}" wx:key="ids"  data-id="{{item.id}}">
      <view class='order-top'>
        <text class='grey'>订单编号:{{item.shopOrder[0].orderNo}}</text>
        <text wx:if="{{item.refundStatus == 1}}" class='explain'>退款成功</text>
        <text wx:if="{{item.refundStatus == 2}}" class='explain'>退款失败</text>
        <text wx:if="{{item.refundStatus == 3 || item.refundStatus == 5}}" class='explain'>处理中</text>
        <text wx:if="{{item.refundStatus == 4}}" class='explain'>已取消</text>
      </view>
      <view  class='order-middle' wx:for="{{item.shopOrder[0].details}}" wx:for-item="goods" wx:key="ids" data-id="{{goods.shopProduct.id}}" data-status="{{goods.shopProduct.status}}" data-delflag="{{goods.shopProduct.delFlag}}" bindtap="intoGoods">
        <image mode="aspectFit" src='{{goods.shopProduct.imgMobile}}' class='order-image'></image>
        <view class='order-info'>
          <view class='name'>{{goods.shopProduct.title}}</view>
          <view class='grey norms'>规格:{{goods.shopSku.name}}</view>
          <view class='price'>¥{{goods.shopSku.price}}</view>
        </view>
        <text class='grey'>x{{goods.count}}</text>
      </view>
      <view class='order-number'>
        <text class='grey'>共计{{item.shopOrder[0].purchaseQuantity}}件商品</text>
        <text class='total-text'>合计</text>
        <text class='price'>¥{{item.refundMoney}}</text>
      </view>
      <view class='order-bottom'>
        <text class='cancel-details' bindtap='lookDetail'  wx:if="{{item.refundStatus != 1 && item.refundStatus != 2&& item.refundStatus != 4}}" data-id='{{item.id}}'>查看详情</text>
        <text class='cancel-details' bindtap='lookCannel'  wx:if="{{item.refundStatus == 4}}" data-id='{{item.id}}'>查看详情</text>
        <text class='cancel-details' wx:if="{{item.refundStatus == 1}}" bindtap='successRefund' data-id='{{item.id}}'>查看详情</text>
        <text class='cancel-details' wx:if="{{item.refundStatus == 2}}" bindtap='errorRefund' data-id='{{item.id}}'>查看详情</text>
        <text class='cancel-success' bindtap='cannelRefund' wx:if="{{item.refundStatus == 3}}" data-id='{{item.id}}'>取消退款</text>
      </view>
    </view>
  </view>
  <view class="no-refund" wx:if="{{refundShow}}">
    <image src='/image/61.png'></image>
    <text class='no-text'>亲,没有退款的订单哦!</text>
  </view>
<view class="toTap" bind:tap="goTap" hidden='{{!floorstatus}}' >
  <view class="iconfont icon-zhiding1"></view>
</view>
pages/refundOrder/refundOrder.wxss
New file
@@ -0,0 +1,116 @@
@import "/common/css/refund.wxss";
.order-container{margin-top: 20rpx}
.order-list {
  background: #fff;
  margin: 0 19rpx;
  padding: 30rpx 32rpx;
  margin-bottom: 10rpx;
}
.order-middle {
  padding: 19rpx 0;
}
.explain {
  color: #ff5806;
  font-size: 26rpx;
  width: 30%;
  text-align: right;
}
.order-image {
  width: 167rpx;
  height: 159rpx;
  margin-right: 21rpx;
}
.order-list>view {
  display: flex;
}
.order-top .grey {
  width: 70%;
}
.order-bottom>text {
  width: 120rpx;
  height: 44rpx;
  line-height: 44rpx;
  display: block;
  font-size: 22rpx;
  text-align: center;
  border-radius: 10rpx;
}
.pay {
  margin-left: 18rpx;
  background: #ff5806;
  color: #fff;
  border: 1rpx solid #fff;
}
.cancel-order {
  color: #999;
  border: 1rpx solid #b3b3b3;
}
.order-number {
  justify-content: flex-end;
}
.order-bottom {
  justify-content: flex-end;
}
.order-list .price {
  color: #ff4606;
}
.norms {
  margin: 10rpx 0 30rpx 0;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.order-info {
  width: 70%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.order-number {
  font-size: 26rpx;
  margin-bottom: 30rpx;
}
.total-text {
  margin-left: 20rpx;
  color: #999;
}
.order-number .price {
  color: #666;
}
.evaluate, .receiving-goods {
  border: 1rpx solid#FF5806;
  margin-left: 18rpx;
  color: #ff5806;
}
.logistics {
  margin-left: 18rpx;
}
.cancel-details{border:1rpx solid #FF5806;color: #FF5806}
.cancel-success{border: 1rpx solid #999999;color: #999}
.no-refund {text-align: center;color: #666;font-size: 30rpx}
.no-refund image{width: 281rpx;height: 258rpx;margin: 200rpx 0 109rpx 0}
.no-text{display: block}
.cancel-success{margin-left: 15rpx}
.order-info>view{
  display: block
}
pages/service/details.js
New file
@@ -0,0 +1,590 @@
const app = getApp()
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
var shopcart = require('../../utils/shopcart.js');
Page({
  data: {
    userInfo: '', //用户信息
    stardata: [1, 2, 3, 4, 5],
    interval: 2000,
    duration: 1000,
    imgUrls: [],
    imagetext: ['商品介绍', '规格与包装'],
    currentTabsIndex: 0,
    checkCollect: true,
    goodsInfo: {},
    adverList: '',
    adverLists: '',
    normspopup: false,
    currentIndex: 0,
    id: '',
    num: 1,
    whetherSpecification: false, //是否选择规格
    specification: '', //规格
    specificationId: '', //规格id
    specificationPrice: '', //规格价格
    price: '', //价格
    originalPrice: '', //划线价
    normsList: [],
    couponList: [],
    activity:[],//满减活动
    evaluateList: [], // 评论列表
    evaluateNum: 0, // 评论数量
    currentIndexs: 0,
    currentIndex: 0,
    hidden: false,
    limit: 10,
    offset: 0,
    inform: true,
    hidden: true,
    shareShow: false,
    cartProductId: "", //商品id
    title: "", //商品名
    imgSrc: "", //商品图片
    isShare: 0,
    qrcode:false,
  },
  onLoad: function(options) {
    var _this = this;
 //debugger;
    var goodsId = options.id;
    var shopId = options.shopId;
    if (goodsId == undefined || goodsId == null) {
      const scene = decodeURIComponent(options.scene);
      console.log("scene", scene)
      var params=scene.split(",");
      goodsId = params[1];
      shopId = params[0];
      app.shopInfo = { id: shopId};
      //获取门店信息
      util.request({
        api: api.yuyue.findShopInfoById + "/" + shopId,
        callback: function (data) {
          app.shopInfo = data.rows[0];
        },
        checkLogin:true,
      });
    }
    if (goodsId == undefined || goodsId == null) {
      wx.showModal({
        title: '提示',
        content: '产品信息加载失败',
        showCancel: false
      })
    }
    _this.showGoods(goodsId);
    _this.setData({
      id: goodsId,
    });
    // 判断是否从通知跳进来
    if (options.isShare == 1) {
      this.setData({
        isShare: options.isShare
      })
    }
  },
  onShow(options) {
  },
  // 回到首页
  goBack() {
    wx.switchTab({
      url: '../index/index'
    })
  },
  goIndex() {
    wx.reLaunch({
      url: '/pages/index/index'
    })
  },
  //转发
  onShareAppMessage(res) {
    var title = this.data.goodsInfo.title;
    var shopCoupon=this.data.goodsInfo.shopCoupon;
    if (shopCoupon){
      title = title +" - "+ shopCoupon.cname;
    }
    var index = this.data.index
    var id = this.data.id;
    if (res.from === "button") {}
    return {
      title: title,
      imageUrl: this.data.imgUrls[0].imgPath,
      path: "pages/service/details?id=" + id + "&shopId="+app.shopInfo.id+"&isShare=" + 1,
      success(res) {
      },
      fail(res) {
      }
    }
  },
  // 咨询药师
  consult(e) {
    this.setData({
      telShow: true
    })
  },
  // 分享
  share(e) {
    this.setData({
      shareShow: true,
      popupShow: true
    })
  },
  //跳转到购物车
  goCart(e) {
    wx.switchTab({
      url: '../shopCar/shopCar',
    })
  },
  // 图文选项卡
  onTabsItemEvent(e) {
    var index = e.currentTarget.dataset.index;
    // console.log(index)
    this.setData({
      currentTabsIndex: index
    })
  },
  // 收藏
  collect() {
    var _this = this;
    var id = _this.data.id;
    util.request("POST", "/wxapi/Collection/saveCollection", {
      "collProductid": id
    }, function(data) {
      if (data.status == 200) {
        _this.setData({
          checkCollect: true
        })
      }
    }, false);
  },
  // 取消收藏
  cancel() {
    var _this = this;
    var id = _this.data.id;
    console.log(id)
    util.request("POST", "/wxapi/Collection/deleteByProductId/" + id, {}, function(data) {
      console.log(data.rows)
      if (data.status == 200) {
        _this.setData({
          checkCollect: false
        })
      }
    }, false);
  },
  // 查询商品详情
  showGoods: function(id) {
    var _this = this;
    util.request({
      api: "/wxapi/ShopProduct/getProductById/"+app.shopInfo.id+"/" + id,
      callback:function(data){
        if (data.rows[0].mobileDetails != null) {
          data.rows[0].mobileDetails = data.rows[0].mobileDetails.replace(/<img /g, '<img class="rich_img" ');
          console.log(data.rows[0].mobileDetails);
        }
        _this.setData({
          goodsInfo: data.rows[0],
          imgUrls: data.rows[0].productImgs,
          normsList: data.rows[0].skus,
          specification: data.rows[0].skus[0].name,
          specificationPrice: data.rows[0].skus[0].price,
          price: data.rows[0].skus[0].price,
          specificationId: data.rows[0].skus[0].id,
          imgSrc: data.rows[0].imgMobile,
          title: data.rows[0].title,
          hidden: true,
          activity: data.mapInfo.activity,
          couponList: data.mapInfo.couponList,
          evaluateNum: data.mapInfo.evaluateNum,
          checkCollect: data.mapInfo.checkCollect,
        })
      }
    });
  },
yuyue(){
    if (util.isBlank(getApp().userInfo.nickName)) {
        wx.navigateTo({
            url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
        })
    } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
        wx.navigateTo({
            url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
        })
    } else {
        var product = this.data.goodsInfo;
        wx.setStorageSync('chooseService', product);
        wx.switchTab({
            url: '/pages/yuyue/khyuyue'
        });
    }
},
  //规格选择
  norms(e) {
    var index = e.currentTarget.dataset.index;
    var value = e.currentTarget.dataset.value;
    var price = e.currentTarget.dataset.price;
    var id = e.currentTarget.dataset.id;
    this.setData({
      currentIndex: index,
      specification: value,
      specificationPrice: price,
      specificationId: id
    })
  },
  // 显示规格
  showNorms() {
    this.setData({
      whetherSpecification: true,
      normspopup: true
    })
  },
  //隐藏规格
  cancelNorms() {
    this.setData({
      normspopup: false
    })
  },
  /**
   * 绑定加数量事件
   */
  addCount(e) {
    var _this = this;
    let num = _this.data.num;
    num = num + 1;
    this.setData({
      num: num
    });
  },
  /**
   * 绑定减数量事件
   */
  minusCount(e) {
    var _this = this;
    let num = _this.data.num;
    if (num <= 1) {
      return false;
    }
    num = num - 1;
    this.setData({
      num: num
    });
  },
  // 立即购买
  buy(e) {
    var _this = this;
    //获取用户信息
    console.log("立即购买");
        // 判断是否绑定过手机号
      if (util.isBlank(getApp().userInfo.phoneNumber)) {
          wx.navigateTo({
            url: '../phone/phone',
          })
        } else {
          let goodsInfo = _this.data.goodsInfo;
          if (!_this.data.whetherSpecification) {
            console.log("存在多个规格,且没有选择过规格,弹出请选择");
            _this.setData({
              whetherSpecification: true,
              normspopup: true
            });
          } else {
            var id = _this.data.goodsInfo.id; // 商品id
            var cartSkuId = _this.data.specificationId; //规格id
            var cartNumber = _this.data.num; //数量
            var stockNum = goodsInfo.stockNum;
            if (stockNum < 1) {
              wx.showToast({
                title: "您来晚了,商品已经抢光了",
                icon: 'none',
              });
              return;
            }
            //取消所有购物车选中项目
            util.request({
              method: "POST",
              api: api.shoppingCart.updateCartAllSelected + app.shopInfo.id +"/2",
              callback: function () {
                //加入购物车
                comReq.addShoppingCar(cartSkuId, cartNumber, function (totalNum) {
                  //隐藏规格
                  _this.cancelNorms();
                  //进入结算
                  wx.navigateTo({
                    url: '/pages/service/shopOrder?model=2',
                  })
                });
              }
            });
        }
      }
  },
  // 轮播图预览保存
  onSwiperEvent(e) {
    let index = e.currentTarget.dataset.index;
    let imgArr = [];
    for (var i = 0; i < this.data.imgUrls.length; i++) {
      imgArr.push(this.data.imgUrls[i].imgPath);
    }
    wx.previewImage({
      current: imgArr[index],
      urls: imgArr,
    })
    // console.log(1111)
    console.log(imgArr[index])
  },
  //领券
  couple(e) {
    this.setData({
      popup: true
    })
  },
  //取消领券弹窗选择
  popupTap(e) {
    this.setData({
      popup: false,
      normspopup: false,
      telShow: false,
      shareShow: false
    })
  },
  // 领取优惠券
  getCoupon(e) {
    var _this = this;
    var index = e.currentTarget.dataset.index;
    var value = e.currentTarget.dataset.value;
    var couponList = _this.data.couponList;
    // console.log(value);
    //获取用户信息
    wx.getStorage({
      key: 'userInfo',
      success: function(res) {
        let userInfo = res.data
        if (!userInfo.phoneNumber) {
          wx.navigateTo({
            url: '../phone/phone',
          })
        } else {
          util.request("GET", "/wxapi/shopCoupon/receiveCoupon/" + value.id, {}, function(data) {
                couponList[index].canReceive = 0;
              _this.setData({
                couponList: couponList
              })
          }, null,true)
        }
      }
    })
  },
  evaluate(e) {
    wx.navigateTo({
      url: '../wholeEvaluate/whoeEvaluate?id=' + e.currentTarget.dataset.id,
    })
  },
  // 生成卡片跳转
  card(e) {
    var id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../card/card?id=' + id,
    })
  },
  /**
   * 获取二维码
   */
  getQrcode: function () {
    var _this = this;
    if (_this.data.qrcode) {
      wx.previewImage({
        current: _this.data.qrcode, // 当前显示图片的http链接
        urls: [_this.data.qrcode] // 需要预览的图片http链接列表
      })
    } else {
      var shopId = app.shopInfo.id;
      var id = _this.data.id;
      var data = {
        shopId: shopId,
        productId: id,
        scene: shopId + "," + id,
        path: "pages/service/details"
      };
      util.request({
        method: "POST",
        api:'/wxapi/shareProduct/getProductShareQrcode/',
        data:data,
        callback: function (data2) {
          var qrcode = data2.rows[0].qrcodeUrl
          console.log(qrcode);
          _this.setData({
            qrcode: qrcode,
          })
          wx.previewImage({
            current: _this.data.qrcode, // 当前显示图片的http链接
            urls: [_this.data.qrcode], // 需要预览的图片http链接列表
            success:function(){
              wx.downloadFile({
                url: _this.data.qrcode,
                success: function (res) {
                  console.log(res);
                  //图片保存到本地
                  wx.saveImageToPhotosAlbum({
                    filePath: res.tempFilePath,
                    success: function (data) {
                      wx.showToast({
                        title: '保存成功',
                        icon: 'success',
                        duration: 2000
                      })
                    },
                    fail: function (err) {
                      console.log(err);
                      if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
                        console.log("当初用户拒绝,再次发起授权")
                        wx.openSetting({
                          success(settingdata) {
                            console.log(settingdata)
                            if (settingdata.authSetting['scope.writePhotosAlbum']) {
                              console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
                            } else {
                              console.log('获取权限失败,给出不给权限就无法正常使用的提示')
                            }
                          }
                        })
                      }
                    },
                    complete(res) {
                      console.log(res);
                    }
                  })
                }
              })
            }
          })
        }})
    }
  },
  /**
    * 分享
    */
  formSubmit: function (e) {
    console.log('获取二维码:', e)
    this.getQrcode()
  },
})
pages/service/details.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "商品详情"
}
pages/service/details.wxml
New file
@@ -0,0 +1,325 @@
<view class="detail_container">
  <swiper indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='#00C085' indicator-color='#BDD8D0'>
    <block wx:for="{{imgUrls}}" wx:key="key">
      <swiper-item>
        <image src="{{item.imgPath}}" class="slide-image" bind:tap="onSwiperEvent" data-id="{{item.id}}" data-index="{{index}}" mode="widthFix"></image>
      </swiper-item>
    </block>
  </swiper>
  <view class="detail_section">
    <view class="detail_content">
      <view class="detail_top">
        <view class="detail-group">
          <view class='iprice detail_iprice'>¥{{goodsInfo.price}}</view>
          <view class='grey original_iprice' wx:if="{{goodsInfo.markedPrice != null}}">¥{{goodsInfo.markedPrice}}</view>
          <view class="share" bind:tap="share">
            <image src="/image/share.png"></image>
          </view>
          <!-- <button open-type="share" class="share"><image src="/image/share.png"></image></button> -->
        </view>
        <view class="detail_info">
          <view class="detail_name threeblack">{{goodsInfo.title}}</view>
          <view class='grey'>月销:{{goodsInfo.dsVolume}}</view>
        </view>
        <view class='grey explain'>{{goodsInfo.briefIntroduction}}</view>
      </view>
    </view>
    <view class="detail_middle">
      <view class="couple">
       <!--
        <view class='firms'>
          <view class='threeblack'>促销活动</view>
          <view class='couple_right'>
            <view wx:if="{{activity.length>0}}">
              <block wx:for="{{activity}}">
                <text style="margin-right:20rpx;" class="coupon-lable">{{item.cname}}</text>
              </block>
            </view>
          </view>
        </view>
        <view class='couple-list' wx:if="{{couponList.length!=0}}" bind:tap="couple">
          <text class='threeblack'>领券</text>
          <view class='couple_right'>
            <view class='couple_icon' wx:for="{{couponList}}" wx:if="{{index<2}}" wx:key="ids">
              <view class='price'>{{item.offsetAmount}}元</view>
              <image wx:if="{{index<2}}" src='/image/pocon.png' class='couple-image'></image>
            </view>
          </view>
          <view class=" iconfont icon-youbian"></view>
        </view>
        -->
        <view class='firms' bind:tap="showNorms">
          <view class='threeblack'>规格</view>
          <view class='couple_right'>
            <text>{{specification}}</text>
            <view class=" iconfont icon-youbian"></view>
          </view>
        </view>
      </view>
<!--
      <view class='evaluate_container' wx:if="{{evaluateNum>0}}">
        <view class='evaluate_box grey'>
          <view class="product_eval" data-id="{{goodsInfo.id}}" bind:tap="evaluate">
            <view class='threeblack eval_text'>商品评价({{evaluateNum}})</view>
            <view class="all">
              <text>查看全部</text>
              <text class='iconfont icon-youbian'></text>
            </view>
          </view>
          <view class="evaluate_detail" wx:for="{{evaluateList}}" wx:for-item="evaluate">
            <view>
              <view class="evaluate-info">
                <image src='{{evaluate.avatarUrl}}' class="avatarUrl"></image>
                <view class='user_name'>{{evaluate.nickName}}</view>
              </view>
              <view class='star'>
                <image class='stars' bindtap="changeColor" data-index='{{index}}' data-value="{{item}}" wx:for-index="id" wx:for-item="star" wx:for="{{stardata}}" wx:key="ids" src="{{evaluate.comScore>=star? '/image/star1.png': '/image/star2.png'}}" />
              </view>
              <text>{{evaluate.dateToStrTime}}</text>
            </view>
            <text class='status' wx:if="{{evaluate.comContent != ''}}">{{evaluate.comContent}}</text>
            <text class='status' wx:else>默认好评</text>
          </view>
        </view>
      </view>
      <view class='evaluate_container' wx:else>
        <view class='evaluate_box grey'>
          <view class="product_eval" data-id="{{goodsInfo.id}}">
            <view class='threeblack eval_text'>暂无评价</view>
          </view>
        </view>
      </view>
-->
      <!-- 图文说明 -->
      <view class='detail_imagetext'>
        <view class='imagetext_box'>
          <block wx:for="{{imagetext}}" wx:key="ids">
            <view class="imagetext_item {{currentTabsIndex==index?'selected':''}}" bindtap='onTabsItemEvent' data-index="{{index}}">
              {{item}}
            </view>
          </block>
        </view>
        <view class="imagetext_detail_box">
          <view class="tabs_content" hidden="{{currentTabsIndex!=0}}">
            <view>
              <rich-text  class='price_content' nodes="{{goodsInfo.mobileDetails}}"></rich-text>
            </view>
          </view>
          <view class="tabs_content explain_tabs" hidden="{{currentTabsIndex!=1}}">
            <view wx:for="{{goodsInfo.params}}" wx:key="ids">
              <view class='title'>{{item.paramName}}</view>
              <view class='content name'>{{item.paramValue}}</view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <!--下架后进入产品页控制操作 -->
  <view class="detail_footer footer-grey" wx:if="{{goodsInfo.status == 2 || goodsInfo.delFlag == 1}}">
    <view class='detail_collected' bindtap="goIndex" >
      <view class="iconfont icondianpu"></view>
      <text>店铺</text>
    </view>
    <view class='service'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          客服
        </button>
      </view>
    </view>
    <view class='detail_cart detail_pay'>加入购物车</view>
    <view class='detail_buy detail_pay'>已下架</view>
  </view>
  <!--下架后进入产品页控制操作END -->
  <view class="detail_footer " wx:if="{{(goodsInfo.status == 1 && goodsInfo.delFlag == 2) && goodsInfo.isPrescription !=1}}">
  <!--  <view class='service'>
      <view class='contact_list'>
        <button open-type='contact' send-message-title="{{title}}" send-message-img="{{imgSrc}}" show-message-card="true" send-message-path="../details/details?id={{id}}&&isShare=1">
          <view class="iconfont icon-kefu1"></view>
          客服
        </button>
      </view>
    </view>
    <view wx:if="{{!checkCollect}}" class='detail_collected' bindtap='collect'>
      <view class="iconfont icon-soucang"></view>
      <text>收藏</text>
    </view>
    <view wx:else class='detail_collected' bindtap='cancel'>
      <view class="iconfont icon-shoucang"></view>
      <text>收藏</text>
    </view> -->
    <view class='detail_collected' bindtap="goIndex">
      <view class="iconfont icondianpu"></view>
      <text>店铺</text>
    </view>
    <view class='service'>
      <view class='contact_list'>
        <button open-type='contact'>
          <view class="iconfont iconkefu"></view>
          客服
        </button>
      </view>
    </view>
    <view wx:if="{{goodsInfo.stockNum>0 && goodsInfo.isService==2 }}" class='detail_cart detail_pay' bindtap='buy'>立刻购买</view>
     <view wx:if="{{goodsInfo.stockNum>0 && goodsInfo.isService==1 }}" class='detail_cart detail_pay' bindtap='yuyue'>预约</view>
    <view wx:if="{{goodsInfo.stockNum<1}}" class='detail_cart detail_pay'>已售罄</view>
  </view>
  <view class="detail_couple">
    <view class='detail_coupon'></view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{normspopup}}">
    <view class='popup' bind:tap="popupTap"></view>
    <view class='norms-container'>
      <view class="norms-list">
        <view>
          <view class='norms-detail'>
            <block wx:for="{{normsList}}" wx:key="ids">
              <view class='norms-item' hidden="{{currentIndex!=index}}">
                <image src='{{item.imgPath}}'></image>
                <view class='norms-content'>
                  <text class='title'>{{goodsInfo.title}}</text>
                  <text class='stock grey'>库存:{{item.stock}}</text>
                  <text class='price'>¥{{item.price}}</text>
                </view>
              </view>
            </block>
            <view class='close iconfont icon-quxiao' bind:tap="cancelNorms"></view>
          </view>
        </view>
        <view class='norms-select'>
          <text class='threeblack'>规格</text>
          <view>
            <view class='norms-box'>
              <block wx:for="{{normsList}}" wx:key="ids">
                <view class='norms-box-item {{currentIndex == index?"selectedNorms":""}}' bindtap="norms" data-index="{{index}}" data-value="{{item.name}}" data-price="{{item.price}}" data-id="{{item.id}}">{{item.name}}</view>
              </block>
            </view>
          </view>
        </view>
        <view class='norms-number'>
          <text class='threeblack'>数量</text>
          <view class="cart-count-box">
            <!-- iconfont icon-jian -->
            <view class="cart-count-down " bindtap="minusCount" data-obj="{{obj}}" data-index="{{index}}">
              <image src='/image/jian.png'></image>
            </view>
            <text class="cart-count-num">{{num}}</text>
            <view class="cart-count-add" bindtap="addCount" data-index="{{index}}">
              <image src='/image/jia.png'></image>
            </view>
          </view>
        </view>
      </view>
      <view class='norms-footer'>
        <view class='norms-join' bindtap='buy'>立刻购买</view>
      </view>
    </view>
  </view>
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\规格选择END\\\\\\\\\\\\\\\\\   -->
  <!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\优惠券\\\\\\\\\\\\\\\\\   -->
  <view class='popup-container' wx:if="{{popup}}">
    <view class='popup' bind:tap="popupTap"></view>
    <view class='coupons-list'>
      <view wx:for="{{couponList}}" wx:key="ids" data-id="{{item.id}}">
        <view class='coupons  counpons-list'>
          <view class="coupons-explain">
            <text>满减券</text>
          </view>
          <view class='money'>
            <view class='money-num'>
              <text style='font-size:34rpx'>¥</text>
              <text style='font-size:60rpx'>{{item.offsetAmount}}</text>
            </view>
            <view class='money-info'>
              <text>满{{item.minAmount}}元可用</text>
            </view>
          </view>
          <view class='content'>
            <view class="content-title">{{item.cname}}</view>
            <view class='content-info'></view>
            <view class='content-time'>有效期至{{item.endTimeWx}}</view>
          </view>
          <view class='right'>
            <view class='draw radius {{drawIndex==index?"active":""}}' wx:if="{{item.canReceive == 1}}" bindtap="getCoupon" data-value="{{item}}" data-index="{{index}}">
              <text>立即领取</text>
            </view>
            <view wx:else class='draw radius alreadyGet' bindtap="drawevent" data-value="{{item}}" data-index="{{index}}">
              <text>领取成功</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>
<!--\\\\\\\\\\\\\\\\\\\\\\\\\\\\\优惠券END\\\\\\\\\\\\\\\\\   -->
<view class="popup-item" wx:if="{{shareShow}}">
  <view class='popup' bind:tap="popupTap" wx:if="{{popupShow}}"></view>
  <view class="pupup-bottom popup-content">
    <view class="share-container">
      <view class="hr"></view>
      <text class="share-text">分享到</text>
    </view>
    <view class="share-box">
      <button open-type="share" data-index="{{index}}" bind:tap="popupTap">
        <image src="/image/wx.png"></image>
        微信
      </button>
      <view class="card">
        <form bindsubmit="formSubmit">
          <button  formType="submit" style="width:200rpx;" >
            <image src="/image/tp.png"></image>
            生成卡片 </button>
        </form>
      </view>
    </view>
    <view class="cancel padding" bind:tap="popupTap">取消</view>
  </view>
</view>
<!-- 回到首页 -->
<view class="index" bind:tap="goIndex" wx:if="{{isShare}}">
  <image src="/image/goIndex.png"></image>
</view>
pages/service/details.wxss
New file
@@ -0,0 +1,582 @@
@import "../../icon/iconfont.wxss";
swiper {
  height: 750rpx;
  width: 100%;
}
.slide-image {
  width: 100%;
  height: 100%;
}
swiper-item{
  background: #fff
}
.detail_top {
  font-size: 34rpx;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 40rpx 0;
}
.detail-group{
  display: flex;
  align-items: center
}
.detail_collected text{
    font-size: 10px;
}
.original_iprice{
  text-decoration:line-through;
  margin-left: 10rpx;
}
.share {
  width: 90%;
  text-align: right;
}
.share image{width: 42rpx;height: 42rpx}
.detail_top>view {
  width: 90%;
  margin: auto;
}
.detail_name {
  width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail_info {
  display: flex;
  padding: 11rpx 0 28rpx 0;
  align-items: center
}
textarea{position: absolute}
.stock{margin-top: 20rpx}
.explain {
  font-size: 26rpx;
  line-height: 48rpx;
}
.detail_iprice {
  font-size: 35rpx;
  font-weight: bold;
}
.detail_middle {
  font-size: 30rpx;
}
.couple {
  background: #fff;
  margin: 10rpx 0;
}
.couple>view {
  display: flex;
  width: 90%;
  margin: auto;
  line-height: 70rpx;
}
.couple_right {
  width: 90%;
  display: flex;
  justify-content: flex-end;
  align-items: center
}
.couple .threeblack {
  font-weight: bold;
}
.couple_right .icon-31gouwuquan {
  width: 72rpx;
  height: 38rpx;
  position: absolute;
  left: -73rpx;
}
.couple_icon {
  background: url("http://file.micromall.xczhyf.cn/wxxcx/image/70.png");
  margin-left: 23rpx;
  width: 88rpx;
  height: 29rpx;background-size: 100% 100%;
  text-align: center
}
.couple_icon .price {
  font-size: 24rpx;
  color: #fff;
  margin-top: -19rpx
}
.couple-list .icon-youbian {
  margin-top: 6rpx;
}
.avatarUrl {
  width: 50rpx;
  height: 50rpx;
  border-radius: 50%;
}
.eval_text {
  font-weight: bold;
  width: 77%;
}
.product_eval {
  display: flex;
  line-height: 80rpx
}
.all {
  display: flex;
  line-height: 80rpx;
}
.evaluate_container {
  background: #fff;
}
.evaluate_container>view {
  width: 90%;
  margin: auto;
}
.star {
  display: flex;
  align-items: center;
  width: 45%;
  padding-left: 62rpx;
}
.star image {
  width: 30rpx;
  height: 29rpx;
  margin-right: 17rpx;
}
.evaluate_detail>view {
  display: flex;
  align-items: center;
}
.evaluate-info{display: flex;align-items: center;width: 21%}
.user_name {
  margin-left: 20rpx;
  font-size: 26rpx;
  width: 48%;
}
.evaluate_detail {
  padding-bottom: 40rpx;
}
.status {
  padding-top: 34rpx;
  display: block;
  color: #999;
  font-size: 28rpx;
}
.detail_imagetext {
  margin-top: 10rpx;
  background: #fff;
}
.imagetext_box {
  display: flex;
  width: 90%;
  margin: auto;
}
.imagetext_item {
  padding: 30rpx 0;
  color: #999;
  font-size: 28rpx;
  border-bottom: 1px solid #b3b3b3;
  width: 50%;
  text-align: center;
}
.tabs_content {
  width: 100%;
  margin: auto;
}
.price_content {
  color: #666;
  font-size: 24rpx;
  line-height: 36rpx;
}
.rich_img {
  max-width: 100%;
  margin: 0rpx;
  padding: 0rpx;
  border: none;
}
.carriage .couple_right{width: 73%}
.imagetext_detail_box .title {
  background: #F1F1F1;
  border-bottom: 1rpx solid #E1E1E1;
  color: #333;
  width: 30%;
  padding: 20rpx 0;
  font-size: 26rpx;
  align-items: center;
  display: flex;
  justify-content: center;
  border-left: 1rpx solid #E1E1E1;
  border-right: 1rpx solid #E1E1E1;
  white-space: nowrap
}
.explain_tabs>view {
  display: flex;
}
.explain_tabs{width: 93%}
.explain_tabs .content {
  width: 70%;
  padding: 20rpx 24rpx;
  font-size: 26rpx;
  color: #666;
  border-top: #E1E1E1 solid 1px;
  border-right: 1rpx solid #E1E1E1;
  line-height: 36rpx;
  margin-top: -1rpx;
  margin-left: 0;
  box-sizing: border-box;
 word-wrap:break-word;
}
.imagetext_detail_box {
  padding: 29rpx 0;
}
.explain_tabs>view:nth-child(1) .content{margin-top: 0px}
.explain_tabs>view:nth-child(1) .title{border-top: 1rpx solid #E1E1E1}
.explain_tabs .content:last-child {
  border-bottom: 1rpx solid #E1E1E1;
}
.explain_tabs .title_explain {
  border-top: 1px solid #E1E1E1;
}
.imagetext_box .selected {
  font-size: 28rpx;
  color: #333;
}
.imagetext_item:nth-child(1)::after {
  content: '';
  height: 100%;
  margin-left: 40%;
  display: inline-block;
  vertical-align: middle;
  border-right: 1px solid #b3b3b3;
}
.imagetext_item:nth-child(1) {
  padding-left: 10%;
}
.detail_footer {
  height: 106rpx;
  width: 100%;
  position: fixed;
  bottom: 0;
  display: flex;
  line-height: 106rpx;
  background: #f7f7f7;
}
.detail_section {
  padding-bottom: 106rpx;
}
button {
  border: none;
  color: #666;
  display: inherit;
}
.footer-grey .detail_buy{background: #666666}
.detail_buy {
  background: #ff5806;
}
.footer-grey .detail_cart{background: #B3B3B3}
.detail_cart {
  background: #00C085;
}
.detail_pay {
  width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_collected {
  width: 15%;
  text-align: center;
  line-height: 36rpx;
  font-size: 20rpx;
  margin-top: 20rpx;
  color: #666;
}
.button-hover {
  background: #f7f7f7;
  color: #666;
}
.service {
  margin-top: 20rpx;
  width: 15%;
  position: relative;
}
.detail_footer .iconfont {
  padding-bottom: 5rpx;
}
button {
  line-height: 36rpx;
  border: none;
  width: 100%;
  align-items: center;
  font-size: 20rpx;
  padding-left: 0;
  padding-right: 0;
}
button:after {
  border: 0px;
  color: #414141;
}
.contact_list {
  width: 100%;
  position: absolute;
  height: 100%;
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
}
.icon-soucang {
  font-size: 32rpx;
}
.icon-shoucang {
  font-size: 36rpx;
  color: #ff3f3a;
}
.couple-image {
  width: 88rpx;
  height: 29rpx;
}
.couple .threeblack {
  width: 20%;
}
.icon-youbian {
  color: #cacaca;
  padding-left: 15rpx;
}
.norms-container {
  background: #fff;
  width: 750rpx;
  background: rgba(255, 255, 255, 1);
  border-radius: 10rpx 10rpx 0rpx 0rpx;
}
.norms-container {
  position: absolute;
  bottom: 0;
}
.norms-item image {
  width: 180rpx;
  height: 180rpx;
  margin-right: 35rpx;
}
.norms-item {
  display: flex;
  width: 96%;
}
.norms-detail {
  display: flex;
}
.norms-content {
  display: flex;
  flex-direction: column;
}
.norms-list {
  width: 90%;
  margin: auto;
}
.norms-list .threeblack {
  font-size: 26rpx;
}
.norms-box-item {
  font-size: 24rpx;
  background: #eee;
  color: #333;
  padding: 9rpx 30rpx;
  border-radius: 30rpx;
  text-align: center;
  margin-right: 20rpx;
  margin-top: 20rpx
}
.selectedNorms {
  color: #ff3f3a;
  background: #fff;
  border: 1px solid #ff3f3a;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  padding: 30rpx 0;
  height: 500rpx;
  overflow-y: auto
}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons-container{margin: 0}
.alreadyGet{
  background-color: #999999
  }
.coupons-list>view{
  position: relative
}
.coupons .money::after{
left: 280rpx;
}
.detail_info .grey{white-space: nowrap;width: 30%;text-align: right}
.cart-list .cart-count-box{
    display: flex;align-items: center;
    margin-top:55rpx;
}
.cart-count-box image{width: 32rpx;height: 33rpx}
.cart-count-down,.cart-count-add{
    height: 100%;
}
.cart-count-num{
    background: #f9f9f9;
    font-size: 26rpx;
    border-radius:5rpx;
    color: #B3B3B3;
    text-align: center;
      width: 43rpx;
    height: 41rpx;
    line-height: 41rpx;
    margin-left: 15rpx;
    margin-right: 15rpx;
    margin-top: 8rpx
}
.detail-tel{display: flex;width: 100%}
.detail-tel .detail_pay{width: 85%;letter-spacing: 1rpx}
.tel-text{background: #00C085;position: absolute;top: 10rpx;font-size: 26rpx;right: 23rpx;border-radius: 17rpx;padding: 0 20rpx;color: #fff}
.popup-item{width: 100%;height: 100%;position: fixed;bottom: 0;z-index: 99}
.pupup-bottom{position: absolute;bottom: 0;width: 100%}
.detail_buy .button-hover{
  background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.detail_buy button{
   background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.tel{
  font-size: 34rpx;
}
.popup-item .cancel{
  font-size: 36rpx;
  margin-top: 12rpx
}
.popup-item .padding{
  height: 100rpx;
  line-height: 100rpx;
  background: #fff;
  text-align: center;
  color: #000;
}
.goIndex{
  position: fixed;z-index: 9999;
  bottom: 0;width: 163rpx;
  display: flex;
  flex-direction: column;
  font-size: 26rpx;
  color:#fff;
  height: 78rpx;
  right: 0;
  top: 80%;
}
.goIndex image{
  width: 100%;
  height: 100%
}
.popup-content{background: #fff;border-radius:10px 10px 0px 0px;height: 492rpx}
.popup-content button{background: #fff;width: 50%;font-size: 30rpx;display: flex;flex-direction: column}
.popup-content .button-hover{
  background: #fff;
  text-align: right;
}
.share-box{
  display: flex;padding: 40rpx 0;
}
.card{width: 50%;font-size: 30rpx;display: flex;flex-direction: column;align-items: center;color:#666 }
.popup-content .hr{
  display:block;content:'';width:100%;position:absolute;top:50%;border-top:2rpx solid #c3c3c3;opacity:0.6
}
.popup-content .share-container{
  text-align:center;position:relative;padding:44rpx 0;width:33%;margin:auto;letter-spacing:1rpx;
}
.popup-content .share-text{
  position:relative;padding:0 20rpx;color:#666;background-color:#fff;font-size: 30rpx
}
.popup-content .padding{
  background: #FF5806;margin-top: 0;font-size: 26rpx;
  color: #fff;position: absolute;bottom: 0;width: 100%;
  line-height: 74rpx;
  height: 74rpx
}
.share-box image{
  width: 125rpx;height: 125rpx;padding-bottom: 20rpx
}
.explain-images image{
  width: 100%;
  height: 1342rpx
}
.explain-image image{
  width: 100%;
  height: 1941rpx
}
.index image{
  width: 163rpx;
  height: 78rpx
}
.index{position: fixed;bottom:140rpx;right: 0;z-index: 999;}
pages/service/service.js
New file
@@ -0,0 +1,204 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
    /**
     * 页面的初始数据
     */
    data: {
        currentIndex: 0,
        secondIndex: -1,
        tabs: [],
        secondTabs: [],
        productList: [],
        offset: 0,
        limit: 8,
    },
    //用户点击tab时调用
    titleClick: function (e) {
        let currentPageIndex = e.currentTarget.dataset.idx;
        let secondTabs = this.data.tabs[currentPageIndex].shopProductAttributeList;
        this.setData({
            //拿到当前索引并动态改变
            currentIndex: currentPageIndex,
            secondTabs: secondTabs,
            secondIndex: -1,
        })
        this.getProduct();
    },
    onLoad: function (options) {
        this.getProductAttribute();
    },
    //获取产品分类
    getProductAttribute() {
        var _this = this;
        util.request({
            api: api.productAttribute.getByCode + "cpfl",
            callback: function (data) {
                _this.setData({
                    tabs: data.rows,
                    secondTabs: data.rows[0].shopProductAttributeList
                });
                //加载产品
                _this.getProduct();
            }
        });
    },
    //选择二级分类产品
    chooseSecondCata(e) {
        var index = e.currentTarget.dataset.index;
        this.setData({
            secondIndex: index
        });
        this.getProduct();
    },
    // 加载第一页产品数据
    getProduct: function () {
        var _this = this;
        var limit = _this.data.limit;
        var currentIndex = this.data.currentIndex;
        var secondIndex = this.data.secondIndex;
        var categoryId = this.data.tabs[currentIndex].attrId;
        if (secondIndex != -1) {
            categoryId = this.data.tabs[currentIndex].shopProductAttributeList[secondIndex].attrId;
        }
        util.request({
            api: api.goods.searchGoods,
            data: {
                "limit": limit,
                "categoryId": categoryId,
                "offset": 0,
                "shopIds": app.shopInfo.id
            },
            callback: function (data) {
                _this.setData({
                    productList: data.rows,
                });
                var productList = _this.data.productList;
                if (productList.length == 0) {
                    _this.setData({
                        orderShow: true,
                    })
                } else {
                    _this.setData({
                        orderShow: false
                    })
                }
            }
        });
    },
    onTabsItemEvent(e) {
        var index = e.currentTarget.dataset.index;
        this.setData({
            currentIndex: index,
            offset: 0
        })
        this.getProduct(index);
    },
    // 进入详情
    intoDetail(e) {
        var _this = this;
        var id = e.currentTarget.dataset.id;
        wx.navigateTo({
            url: '/pages/yuyue/yyInfo?model=2&id=' + id,
        })
    },
    // 上拉加载
    onReachBottom: function () {
        var _this = this;
        var limit = _this.data.limit;
        var offset = _this.data.offset + limit;
        var currentIndex = this.data.currentIndex;
        var secondIndex = this.data.secondIndex;
        var categoryId = this.data.tabs[currentIndex].attrId;
        if (secondIndex != -1) {
            categoryId = this.data.tabs[currentIndex].shopProductAttributeList[secondIndex].attrId;
        }
        _this.setData({
            offset: offset
        });
        util.request({
            api: api.goods.searchGoods,
            data: {
                "limit": limit,
                "offset": offset,
                "categoryId": categoryId,
            },
            callback: function (data) {
                var productList = _this.data.productList;
                for (var i = 0; i < data.rows.length; i++) {
                    productList.push(data.rows[i]);
                }
                _this.setData({
                    productList: productList
                });
            }
        });
    },
    //预约项目
    yuyue(e) {
        this.checkUserInfoIsBuding()
        var index = e.currentTarget.dataset.index;
        var product = this.data.productList[index];
        wx.setStorageSync('chooseService', product);
        wx.switchTab({
            url: '/pages/yuyue/khyuyue'
        });
    },
    checkUserInfoIsBuding() {
        if (util.isBlank(getApp().userInfo.nickName)) {
            wx.navigateTo({
                url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
            })
        } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
            wx.navigateTo({
                url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
            })
        }
    },
    //一键回到顶部
    goTap() {
        util.goTap();
    },
    //获取滚动条当前位置
    onPageScroll: function (e) {
        // console.log(e)
        if (e.scrollTop > 400) {
            this.setData({
                floorstatus: true
            });
        } else {
            this.setData({
                floorstatus: false
            });
        }
    },
})
pages/service/service.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/service/service.wxml
New file
@@ -0,0 +1,38 @@
<view class='ticket-container'>
  <scroll-view scroll-y bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
    <!--Tab布局-->
    <view class='title'>
      <block wx:for="{{tabs}}" wx:key>
        <view class="{{index == currentIndex ? 'title-sel-selected' : 'title-sel'}}" bindtap='titleClick'
        data-idx='{{index}}'>
            <text>{{item.attrName}}</text>
            <hr class="line-style" />
        </view>
      </block>
    </view>
    <!--内容布局-->
    <view class='swiper'>
      <scroll-view class="top"   scroll-x>
        <view class="cate-item  {{secondIndex==-1?'active':''}} " data-index="-1" bindtap="chooseSecondCata" >全部</view>
        <view wx:for="{{secondTabs}}"   wx:key
          class="cate-item {{secondIndex==index?'active':''}} "  bindtap="chooseSecondCata" data-index="{{index}}" >{{item.attrName}}</view>
      </scroll-view>
      <view class="service-wrap" wx:for="{{productList}}"  wx:key >
        <navigator url="/pages/service/details?id={{item.id}}" >
        <image mode="aspectFill" class="simg" src="{{item.imgMobile}}" ></image>
        <view class="ser-title">{{item.title}}</view>
        <view class="s-info" wx:if="{{item.isService==1}}" >
          <text class="iconfont iconshijian" ></text>
          <text >{{item.serviceTime}} 分钟</text>
        </view>
        <view class="price-info">
          <view class="price">¥ {{item.price}} </view>
          <view  wx:if="{{item.isService==1}}"  class="yy" capture-catch:touchstart="yuyue" data-index="{{index}}" >预约</view>
          <view  wx:if="{{item.isService!=1}}"  class="yy"   data-index="{{index}}" >购买</view>
        </view>
        </navigator>
      </view>
    </view>
  </scroll-view>
</view>
pages/service/service.wxss
New file
@@ -0,0 +1,137 @@
.container {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.title {
  width: 100%;
  height: 88rpx;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.title-sel {
  color: #24272c;
  font-size: 32rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title-sel  .line-style{
  background: #fff;
  height: 6rpx;
  width: 40rpx;
  position: relative;
  margin-top: 10rpx;
}
.title-sel-selected{
  color: #00C085;
  font-size: 32rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title-sel-selected .line-style{
  background: #00C085;
  height: 4rpx;
  width: 90rpx;
  position: relative;
  margin-top: 10rpx;
}
.swiper {
  width: 90%;
  flex: 1;
  overflow: scroll;
  margin: 0 auto;
}
.record-item {
  margin-top: 10rpx;
  background-color: white;
  padding-bottom: 5rpx;
  padding-top: 5rpx;
  font-size: 30rpx;
}
.top{
  height: 50px;
  width: 100%;
  white-space: nowrap;
  z-index: 999999;
  background: #f7f7f7;
}
.cate-item{
height: 20px;
overflow: hidden;
padding: 5px 10px;
color: #999;
display: inline-block;
line-height: 20px;
font-size: 14px;
margin: 10px 2px 10px 2px;
text-align: center;
}
.active{
 color: #ffffff;
background: #00C085;
border-radius: 30rpx;
}
.service-wrap{
  overflow: hidden;
  background: #ffffff;
  border-radius: 20rpx;
  margin-bottom: 20rpx;
}
.simg{
  width: 100%;
}
.ser-title{
  font-size: 16px;
  margin: 20rpx 0rpx 20rpx 20rpx;
}
.s-info{
  color: #aeaeae;
  font-size: 14px;
}
.iconshijian{
  margin-right: 3rpx;
  margin-left: 20rpx;
}
.price-info{
  margin-top: 20rpx;
}
.price-info .price{
    float: left;
    margin-left: 20rpx;
}
.yy{
 float: right;
padding: 5rpx 35rpx;
border: 1px solid #00C085;
border-radius: 60rpx;
margin: -10rpx 20rpx 20rpx 0rpx;
overflow: hidden;
}
pages/service/service2.js
New file
@@ -0,0 +1,319 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
var shopcart = require('../../utils/shopcart.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    currentIndex: 0,
    tabs: [],
    productList: [],
    offset: 0,
    limit: 8,
    queryKey: '',
    isEnd: false,
    shopId:'',
    toTopIcon:false,
    top_num:0,
    totalNum: 0,
    hasCarts: true,
    hide_good_box: true,
    needAni: -1,
  },
  onLoad: function(options) {
    var _this = this;
    this.getProductAttribute();
    this.setData({
      shopId:app.shopInfo.id,
    });
    //  获取页面的有关信息
    wx.getSystemInfo({
      success: function (res) {
        wx.setStorageSync('systemInfo', res)
        var ww = res.windowWidth;
        var hh = res.windowHeight;
        _this.busPos = {};
        _this.busPos['x'] = ww - 35;
        _this.busPos['y'] = hh - 65;
      }
    });
  },
  onShow(){
    //切换店铺重新加载产品
    if (this.data.shopId && app.shopInfo.id != this.data.shopId){
      this.cleanSearchCondition();
      this.getProductAttribute();
      this.setData({
        shopId:app.shopInfo.id,
      });
      //刷新购物车数量
      this.refreshUserCartCount();
    }
  },
  //切换分类
  titleClick: function(e) {
    let currentPageIndex = e.currentTarget.dataset.idx;
    this.setData({
      currentIndex: currentPageIndex,
    })
    this.cleanSearchCondition();
    this.getProduct();
  },
  /**
   * 清空数据加载条件
   */
  cleanSearchCondition(){
    this.setData({
      productList: [],
      offset: 0,
      isEnd: false,
    })
  },
  //获取产品分类
  getProductAttribute() {
    var _this = this;
    util.request({
      api: api.productAttribute.getByCode+app.shopInfo.id+"/cpfl",
      callback: function(data) {
        _this.setData({
          tabs: data.rows,
        });
        //加载产品
        _this.getProduct();
      }
    });
  },
  formTitle: function(e) {
    this.setData({
      queryKey: e.detail.value
    })
  },
  onSearching() {
    if (this.queryKey.length > 0) {
      this.setData({
        currentIndex: -1
      });
      this.cleanSearchCondition();
      this.getProduct();
    }
  },
  // 加载产品数据
  getProduct: function() {
    var _this = this;
    var limit = _this.data.limit;
    var offset = _this.data.offset;
    var queryKey = _this.data.queryKey;
    var currentIndex = this.data.currentIndex;
    var categoryId = '';
    if (this.data.tabs.length >0 && currentIndex != -1) {
       categoryId = this.data.tabs[currentIndex].attrId;
    }
    util.request({
      api: api.goods.searchGoods,
      data: {
        "limit": limit,
        "categoryId": categoryId,
        "offset": offset,
        "shopIds": app.shopInfo.id,
        "title": queryKey
      },
      callback: function(data) {
        if (data.rows.length == 0) {
          _this.setData({
            isEnd: true
          });
        } else {
          var productList = _this.data.productList;
          for (var i = 0; i < data.rows.length; i++) {
            productList.push(data.rows[i])
          }
          //更新下次调用的角标
          _this.setData({
            productList: productList,
            offset: offset + limit,
          });
        }
      }
    });
  },
  // 进入详情
  intoDetail(e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var service = e.currentTarget.dataset.service;
    if (service == 1) {
      this.checkUserInfoIsBuding()
      var index = e.currentTarget.dataset.index;
      var product = this.data.productList[index];
      wx.setStorageSync('chooseService', product);
      wx.switchTab({
        url: '/pages/yuyue/khyuyue'
      });
    } else {
      wx.navigateTo({
        url: '/pages/service/details?id=' + id,
      })
    }
  },
  //检查用户信息是否绑定
  checkUserInfoIsBuding() {
    if (util.isBlank(getApp().userInfo.nickName)) {
      wx.navigateTo({
        url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
      })
    } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
      wx.navigateTo({
        url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
      })
    }
  },
  //点击购物车事件
  touchOnGoods: function (e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    var stockNum = e.currentTarget.dataset.stockNum;
    if (stockNum < 1) {
      wx.showToast({
        title: "您来晚了,商品已经抢光了",
        icon: 'none',
      });
      return;
    }
    var productInfo = {};
    var _this = this;
    //查询产品信息
    util.request({method:"GET",
    api: api.goods.productInfo + app.shopInfo.id+"/"+ id,
    callback: function (data) {
      productInfo = data.rows[0];
      if (productInfo.skus.length == 1) {
        var skuId = productInfo.skus[0].id;
        _this.busAnimation(e);
        shopcart.playAnimation({
          page: _this,
          event: e,
        }, function () {
          comReq.addShoppingCar(skuId, 1,function(totalNum){
            _this.setData({
              totalNum: totalNum
            });
          });
        });
      } else {
        //存在多个库存
        _this.setData({
          normsList: data.rows[0].skus,
          currentGoodsInfo: data.rows[0],
          currentSku: data.rows[0].skus[0],
          normspopup: true
        });
      }
    }});
  },
  //刷新购物车数量
  refreshUserCartCount() {
    var _this = this;
    util.request({method:"POST",
    api: api.goods.getUserCartCount+app.shopInfo.id,
    callback: function (data) {
        _this.setData({
          totalNum: data.mapInfo.userCartCount
        });
      }});
  },
  //购物车放大效果
  busAnimation: function (e) {
    var id = e.currentTarget.dataset.id;
    var that = this;
    that.setData({
      needAni: id
    });
    setTimeout(function () {
      that.setData({
        needAni: -1
      });
    }, 500);
  },
  //一键回到顶部
  goTap() {
    this.setData({ top_num: 0 })
  },
  scroll_distance: function (event) {
    this.setData({
      toTopIcon: event.detail.scrollTop > 300 ? true : false
    })
  },
  backtop: function () {
      this.setData({ top_num: 0 })
  },
  //转发
  onShareAppMessage(res) {
  },
})
pages/service/service2.json
New file
@@ -0,0 +1,5 @@
{
  "navigationBarBackgroundColor": "#fff",
  "navigationBarTitleText": "产品服务"
}
pages/service/service2.wxml
New file
@@ -0,0 +1,83 @@
<!--主盒子-->
<view class="container">
  <!-- 搜索框 -->
  <view class="header">
    <view class='type_box'>
      <input class="marked" placeholder="{{queryKey}}" bindinput='formTitle' />
      <view class='search_text' bindtap='onSearching'>搜索</view>
    </view>
  </view>
  <!--左侧栏-->
  <scroll-view scroll-y="true" class="nav_left">
    <block wx:for="{{tabs}}" wx:key="ids">
      <view class="nav_left_items {{currentIndex == index ? 'active' : ''}}"
            bindtap='titleClick'
            data-idx='{{index}}'>{{item.attrName}}</view>
    </block>
  </scroll-view>
  <!--右侧栏-->
  <scroll-view bindscrolltolower="getProduct" scroll-y="true" class="nav_right"  scroll-top="{{top_num}}" bindscroll="scroll_distance">
    <!--如果有数据,才遍历项-->
    <block wx:for="{{productList}}" wx:key="ids">
      <view
      data-id='{{item.id}}'
      data-service="{{item.isService}}"
      data-index="{{index}}"
      class="nav_right_items" bindtap='intoDetail'>
        <view wx:if="{{item.stockNum<1}}" class="sold-out">抢光了</view>
        <image src="{{item.imgMobile}}" mode="aspectFill"></image>
        <view class="content_right">
          <view class="right_top">
            <view class="nodata_text">{{item.title}}</view>
            <view class="author">{{item.briefIntroduction}} </view>
         </view>
          <view class="count">
            <text class="price">¥{{item.price}}</text>
            <text
             catchtap="touchOnGoods" data-stock-num="{{item.stockNum}}" data-id='{{item.id}}'
             class=" {{item.id==needAni ? 'bus scale': 'bus'}} iconfont icongouwuche litel_car liter_car_right "></text>
          </view>
        </view>
      </view>
    </block>
    <!-- 浮动购物车功能 -->
    <navigator open-type="switchTab" url="../shopCar/shopCar">
      <view class="carts-icon {{scaleCart?'on':''}}">
        <view class="iconfont icongouwuche2"></view>
        <text class="carts-icon-num" wx:if="{{hasCarts}}">{{totalNum}}</text>
      </view>
    </navigator>
    <view class="toTap" bind:tap="backtop" hidden='{{!toTopIcon}}' >
      <view class="iconfont icontop"></view>
    </view>
    <view wx:if="{{productList.length==0}}" class="nodata">该分类暂无数据</view>
    <view wx:if="{{productList.length!=0&&isEnd}}" class="nodata " >没有更多了</view>
    <!-- 购物车跳动点 -->
    <view class="dot" hidden="{{hide_good_box}}"   style="left: {{bus_x}}px; top: {{bus_y}}px;"></view>
    <!-- \\\\\\\\\\\\\\\\\\\\\\\\\\多规格弹出框\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
    <view>
      <skuList bindrefresh="refreshUserCartCount"  goodsInfo="{{currentGoodsInfo}}"
               normsList="{{normsList}}"
               normspopup="{{normspopup}}"
               currentSku="{{currentSku}}"
      >
      </skuList>
    </view>
    <!-- ///////////////////////////多规格礼弹出框////////////////////////////////// -->
</scroll-view >
</view>
pages/service/service2.wxss
New file
@@ -0,0 +1,243 @@
.header {
    width: 95%;
    border-radius: 10rpx;
    margin: 0rpx auto;
    padding-top: 10rpx;
    background: #fff;
}
.type_box {
    width: 100%;
    display: flex;
    align-items: center;
    font-size: 26rpx;
    color: #b2b2b2;
    height: 70rpx;
    background: #fff;
    border-radius: 10rpx;
    border: 1px solid #e6e6ea;
}
/*总体主盒子*/
.container {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #fff;
    color: #939393;
}
/*左侧栏主盒子*/
.nav_left {
    /*设置行内块级元素(没使用定位)*/
    position: absolute;
    top: 97rpx;
    left: 0;
    width: 150rpx;
    height: 92%;
    /*主盒子设置背景色为灰色*/
    background: #f5f5f5;
    text-align: center;
}
/*左侧栏list的item*/
.nav_left .nav_left_items {
    border-bottom: 1px solid #fff;
    /*文字14px*/
    font-size: 26rpx;
    position: absolue;
    top: 0;
    left: 0;
    padding: 33rpx 0;
}
/*左侧栏list的item被选中时*/
.nav_left .nav_left_items.active {
    /*背景色变成白色*/
    background: white;
    color: #00a39f;
}
.nav_left .nav_left_items.active::before {
    border-left: 2px solid #00a39f;
    content: "";
    display: block;
    position: absolute;
    height: 100rpx;
    margin-top: -31rpx;
}
.icon-xiazai17 {
    margin-left: 10rpx;
    font-size: 28rpx;
    margin-top: 2rpx;
}
.marked {
    margin-left: 10rpx;
    width: 80%;
}
/*右侧栏主盒子*/
.nav_right {
    /* 右侧盒子使用了绝对定位  */
    position: absolute;
    top: 97rpx;
    right: 0;
    flex: 1;
    /*宽度75%,高度占满,并使用百分比布局*/
    width: 590rpx;
    height: 92%;
    margin-left: 20rpx;
    box-sizing: border-box;
    background: #ffffff;
}
.right_top{
  height: 155rpx;
}
.icongouwuche{
  color: #000000;
  font-size: 42rpx;
  font-weight: bold;
  text-align: right;
}
/*右侧栏list的item*/
.nav_right .nav_right_items {
    /*浮动向左*/
    float: left;
    /*每个item设置宽度是33.33%*/
    width: 100%;
    height: 200rpx;
    margin-bottom: 30rpx;
}
.nav_right .nav_right_items image {
    float: left;
    width: 240rpx;
    height: 200rpx;
}
.sold-out{
   width: 240rpx;
    height: 200rpx;
  background: rgba(0, 0, 0, 0.4);
  position: absolute;
  line-height: 200rpx;
  color: #fff;
  text-align: center;
  font-size: 28rpx;
}
.content_right {
    float: left;
    width: 330rpx;
    margin-left: 10rpx;
}
.nodata_text {
    display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
  color: #000000;
  font-size: 32rpx;
  font-weight: bold;
}
.author{
  font-size: 30rpx;
  color: #939393;
  line-height: 30rpx;
}
.count{
    font-size: 22rpx;
    color: #939393;
    height: 55rpx;
    display: flex;
    justify-content :space-between;
}
.marked {
    display: block;
    margin-top: -4rpx;
}
page {
    background-color: #fff;
}
.search_text {
  color: #00C085;
  font-size: 26rpx;
  margin-right: 21rpx;
  white-space:nowrap;
  cursor: pointer;
  width: 10%;
  text-align: center;
}
.author{
  color: #b2b2b2;
  font-size: 24rpx;
  margin: 15rpx 0rpx;
}
.carts-icon {
    position: fixed;
    z-index: 999;
    right: 26rpx;
    bottom: 155rpx;
    width: 59rpx;
    height: 59rpx;
    line-height: 60rpx;
    color: #fff;
    background: #00c085;
    border-radius: 50%;
}
.carts-icon .iconfont {
    font-size: 32rpx;
    text-align: center;
    color: #ffffff;
}
.carts-icon-num {
    position: absolute;
    right: -2rpx;
    width: 28rpx;
    height: 28rpx;
    line-height: 27rpx;
    top: -2rpx;
    border-radius: 50%;
    background: #f00;
    color: #fff;
    font-size: 18rpx;
    text-align: center;
}
pages/service/shopOrder.js
New file
@@ -0,0 +1,404 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
Page({
  data: {
    address: {},
    addrDefault: "",
    hasAddress: false,
    total: 0,
    couponsShow: false, //优惠券
    delivery: [],
    key: 0,
    keydelivery: 0,
    isShow: true,
    selected: "",
    hidden: false,
    goodsList: [],
    skuList: [],
    usefulCoupon: [],
    coupons: '暂无可用优惠券', // 优惠券金额
    couponReceiveId: null, // 优惠券Id
    postage: '', //邮费
    showCoupon: false, //是否存在优惠券
    carId: '', //购物车id
    buttonClicked: false,
    checkedValue: false,
    deliverySelect: "物流配送",
    qsfy: "",
    pageScen: "",
    discountExplain: {},
    shopInfo:{},
  },
  onLoad(options) {
    var _this = this;
  this.setData({
    shopInfo:app.shopInfo
  });
  },
  onShow: function () {
    var _this = this;
    _this.jsjg();
    //获取收货地址
    _this.getAddress();
  },
  //计算订单价格
  jsjg() {
    var _this = this;
    var param = {
      deliverySelect: _this.data.deliverySelect,
      shopId:app.shopInfo.id,
    };
    if (this.data.address) {
      param["receiveAddrId"] = this.data.address.addrId;
    }
    if (this.data.couponReceiveId) {
      param["couponReceiveId"] = this.data.couponReceiveId;
    }
    util.request({
      method: "POST",
      api: api.order.calculationCartOrder,
      data: param,
      callback: function(data) {
        var goodsList = [];
        goodsList = goodsList.concat(data.rows);
        var skuList = [];
        for (var i = 0; i < goodsList.length; i++) {
          var sku = {
            "skuId": goodsList[i].cartSkuId,
            "count": goodsList[i].cartNumber
          }
          skuList.push(sku);
        }
        if (data.mapInfo.defaultAddress) {
          _this.setData({
            "hasAddress": true,
          })
        }
        if (data.mapInfo.shopCoupon.receiveId) {
          _this.setData({
            "coupons": data.mapInfo.shopCoupon.cName,
            "couponReceiveId": data.mapInfo.shopCoupon.receiveId,
            "showCoupon": true
          });
        }
        _this.setData({
          "goodsList": goodsList,
          "skuList": skuList,
          "discountExplain": data.mapInfo.discountExplain,
          "address": data.mapInfo.defaultAddress,
          "usefulCoupon": data.mapInfo.usefulCoupon,
          "shopCoupon": data.mapInfo.shopCoupon,
          "deliverySelect": data.mapInfo.deliverySelect,
        });
      }
    });
  },
  mySelect(e) {
    var name = e.currentTarget.dataset.name
    this.setData({
      tihuoWay: name,
      select: false
    })
  },
  //获取textarea里的值
  txtInput(e) {
    this.setData({
      txtContent: e.detail.value
    })
  },
  onShowText(e) {
    this.setData({
      isShow: true,
    })
  },
  onReady() {
    this.getTotalPrice();
  },
  /**
   * 计算总价
   */
  getTotalPrice() {
  },
  bindTextAreaBlur(event) {
    var value = event.detail.value;
    this.setData({
      txtContent: value,
    });
  },
  // 支付
  startPayment() {
    // console.log("支付");
    var _this = this;
    if (!_this.data.address) {
      wx.showToast({
        title: "请选择收货地址",
        icon: "none"
      });
      return;
    }
    wx.showLoading({
      title: '加载中',
      mask: true,
      duration: 2000
    });
    util.buttonClicked(this);
    var goods = this.data.goodsList[0];
    var couponReceiveId = _this.data.couponReceiveId;
    var checkedValue = _this.data.checkedValue;
    if (checkedValue) {
      couponReceiveId: ''
    }
    var sendData = {
      receiveAddrId: this.data.address.addrId, //收货地址ID
      couponReceiveId: couponReceiveId, //优惠券ID
      remarks: this.data.txtContent,
      skuId: goods.cartSkuId,
      productId: goods.cartProductId,
      number: goods.cartNumber,
      shopId: app.shopInfo.id,
      deliverySelect: this.data.deliverySelect,
    }
    console.log("订单请求参数", sendData)
    util.request({
      api: "/wxapi/shopOrder/addShopOrder",
      data: sendData,
      callback: function(data) {
        var couponReceiveId = _this.data.couponReceiveId;
        wx.requestPayment({
          'timeStamp': data.rows[0].timeStamp,
          'nonceStr': data.rows[0].nonceStr,
          'package': data.rows[0].prepay_id,
          'signType': 'MD5',
          'paySign': data.rows[0].paySign,
          'success': function(res) {
            // console.log(res.errMsg)
            console.log("成功后的回调")
            console.log(res)
            if (res.errMsg == 'requestPayment:ok') {
              // console.log(data.mapInfo.orderId);
              //成功后的回调;
              util.request({
                method: "GET",
                api: '/wxapi/shopOrder/findOrderPayStatus/' + data.mapInfo.orderId,
                mask: true,
                callback: function(payRes) {
                  if (payRes.mapInfo.status == 'success') {
                    wx.redirectTo({
                      url: '../payOrder/paySuccess',
                    });
                    wx.showToast({
                      title: payRes.mapInfo.msg,
                      icon: 'success'
                    })
                  } else {
                    wx.showToast({
                      title: payRes.mapInfo.msg,
                      duration: 2000,
                      image: "/image/fail.png"
                    })
                    wx.redirectTo({
                      url: '../payOrder/payError',
                    })
                  }
                }
              });
            } else {
              // console.log("支付失败");
              wx.redirectTo({
                url: '../order/order',
              })
            }
            //{errMsg: "requestPayment:ok"}
          },
          'fail': function(res) {
            wx.redirectTo({
              url: '../order/order?status=1',
            })
          }
        });
      }
    });
  },
  // 进入收货地址列表
  goAddress(e) {
    wx.navigateTo({
      url: '../editAddress/editAddress?pageScen=2',
    })
  },
  // 进入添加收货地址
  addAddress() {
    wx.navigateTo({
      url: '../editAddress/editAddress?pageScen=2',
    })
  },
  //设置地址
  setAddress(address) {
    debugger
    this.setData({
      "address": address,
      hasAddress: true
    });
  },
  //隐藏弹窗
  popupTap(e) {
    this.setData({
      couponsShow: false,
      isShow: false
    })
  },
  total(e) {
    this.setData({
      isShow: true
    })
  },
  // 获取默认地址
  getAddress() {
    var _this = this;
    util.request({
      api: api.address.queryaddress,
      callback: function(data) {
        if (data.rows.length != 0) {
          _this.setData({
            address: data.rows[0],
            hasAddress: true
          });
        } else {
          _this.setData({
            hasAddress: false
          })
        }
      }
    });
  },
  // 不使用优惠券按钮
  checkedTap: function () {
    var checked = this.data.checkedValue;
    var couponReceiveId = this.data.couponReceiveId;
    if (!checked) {
      couponReceiveId = 1
      this.setData({
        coupons: '不使用优惠券',
        couponReceiveId: couponReceiveId
      })
    }
    this.setData({
      checkedValue: !checked,
      couponsShow: false
    })
    this.jsjg();
  },
  //优惠券
  couponsChoice(e) {
    this.setData({
      couponsShow: true,
      isShow: true
    })
  },
  //优惠券
  radioCouponsChange(e) {
    var checked = e.detail.value;
    var changed = {}
  },
  //优惠券选择
  couponsEvent(e) {
    var _this = this;
    var coupon = e.currentTarget.dataset.coupon;
    var index = e.currentTarget.dataset.index;
    var id = e.currentTarget.dataset.id;
    var usefulCoupon = _this.data.usefulCoupon;
    var changed = {};
    for (var i = 0; i < usefulCoupon.length; i++) {
      if (i == index) {
        changed['usefulCoupon[' + i + '].checked'] = true;
      } else {
        changed['usefulCoupon[' + i + '].checked'] = false
      }
    }
    _this.setData(changed)
    _this.setData({
      coupons: coupon.cName,
      couponsShow: false,
      isShow: false,
      couponReceiveId: id,
      checkedValue: false
    })
    this.jsjg();
  },
})
pages/service/shopOrder.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "订单详情"
}
pages/service/shopOrder.wxml
New file
@@ -0,0 +1,154 @@
<view class="main">
  <view class="order-add-address">
    <view wx:if="{{hasAddress}}" class="orders-address" bindtap='goAddress' data-id="{{address.addrId}}">
      <view class="iconfont icon-address"></view>
      <view class="order-list">
        <view>
          <text class="orders-address-name threeblack">{{address.addrLiaisonman}}</text>
          <text class="orders-address-phone grey">{{address.addrTelephone}}</text>
        </view>
        <view class='orders-address-item'>
          <text wx:if="{{address.addrDefault==1}}" class="default">默认</text>
          <view class="orders-address-detail">{{address.addrRegion}}</view>
        </view>
      </view>
    </view>
    <view wx:else class="orders-no-address" bindtap='addAddress'>
      <text class="iconfont icontianjia"></text>
      <text decode="{{true}}">&ensp;添加收货地址</text>
    </view>
    <image  src='http://file.micromall.xczhyf.cn/wxxcx/image/15.png' class="division"></image>
  </view>
  <view class="orders-box">
    <view wx:for="{{goodsList}}" wx:key="index" class="orders-list">
      <view wx:if="{{item != null}}">
        <image mode="aspectFit" class="orders-thumb" src="{{item.imgMobile}}"></image>
        <view class='order-detail'>
          <view>
            <view class="orders-pro-name">{{item.title}}</view>
            <view class="order-norms">规格:{{item.name}}</view>
            <view class="orders-pro-price">¥{{item.price}}</view>
          </view>
        </view>
        <view class="orders-count-num">×{{item.cartNumber}}</view>
      </view>
    </view>
  </view>
<view class="orders-bottom">
    <view class="orders-bottom-text">
      <text>下单门店</text>
      <view class="orders-bottom-text-right"  >
        <text> {{shopInfo.shopShortName}}</text>
      </view>
    </view>
    <view class="orders-bottom-text">
      <text>配送方式</text>
      <view class="orders-bottom-text-right"  >
        <text>{{deliverySelect}}</text>
        <text wx:if="{{deliverySelect=='立即配送' && discountExplain.postage>0  }}">(注:满{{qsfy}}元免配送费)</text>
      </view>
    </view>
    <view class="orders-bottom-text" bind:tap="couponsChoice">
      <text>优惠券</text>
      <view class='orders-bottom-text-right'>
        <text class=" orders-bottom-text-right-last">{{coupons}}</text>
        <view class="iconfont icon-youbian"></view>
      </view>
    </view>
    <view class="orders-bottom-text remarks">
      <text>买家留言</text>
      <input class='orders-bottom-text-input' bindchange="bindTextAreaBlur" type='text' placeholder='买家留言'></input>
    </view>
  </view>
  <view class="orders-bottom-yh youhui-box">
    <view class="youhui-item">
      <text class="left">商品金额</text>
      <text class="right">¥{{discountExplain.billPrice}}</text>
    </view>
    <view class="youhui-item">
      <text class="left">满减满折</text>
      <text class="right">-¥{{discountExplain.activity}}</text>
    </view>
     <view class="youhui-item">
      <text class="left">优惠券</text>
      <text class="right">-¥{{discountExplain.coupon}}</text>
    </view>
    <view class="youhui-item">
      <text class="left">运费 </text>
      <text class="right">¥{{discountExplain.postage}}</text>
    </view>
    <view class="line"></view>
    <view class="youhui-item">
      <text class="left">实际支付</text>
      <text class="right orders-footer-total-money">¥{{discountExplain.payPrice}}</text>
    </view>
  </view>
  <cover-view class="orders-footer" bind:tap="total">
    <cover-view class="orders-footer-total">合计金额:
      <cover-view class='orders-footer-total-money'>¥{{discountExplain.payPrice}}</cover-view>
    </cover-view>
    <cover-view class="orders-footer-btn" bindtap="startPayment">确认订单 </cover-view>
  </cover-view>
</view>
<view class='popup-container' wx:if="{{couponsShow && showCoupon}}">
  <view class='popup' bindtap='popupTap'></view>
  <view class='coupons-list'>
    <radio-group class="radio" bindchange="radioCouponsChange">
      <view class='coupons-one'>
        <label class=" checked-lable" catchtap='checkedTap'>
          不使用此优惠券
          <view class='radio-one'>
            <radio checked="{{checkedValue}}" color='#00C085' />
          </view>
        </label>
      </view>
      <view wx:for="{{usefulCoupon}}" wx:key="ids" data-id="{{item.receiveId}}" class='coupons-container' wx:keys="ids"
      data-index="{{index}}"
      data-coupon="{{item}}" bindtap="couponsEvent">
        <label>
          <view class='coupons  counpons-list'>
            <view class="coupons-explain">
              <text>满减券</text>
            </view>
            <view class='money'>
              <view class='money-num'>
                <text style='font-size:34rpx'>¥</text>
                <label class='value' for="{{item.offsetAmount}}">
                  <text style='font-size:60rpx'>{{item.offsetAmount}}</text>
                </label>
              </view>
              <view class='money-info'>
                <text>满{{item.minAmount}}可用</text>
              </view>
            </view>
            <view class='content'>
              <view class="content-title">{{item.cName}}</view>
              <view class='content-info'></view>
              <view class='content-time'>有效期至{{item.endTimeWx}}</view>
            </view>
          </view>
        </label>
      </view>
    </radio-group>
  </view>
</view>
pages/service/shopOrder.wxss
New file
@@ -0,0 +1,396 @@
.main {
  margin: 0 18rpx;
  padding-bottom: 20rpx;
}
.icon-address{color: #00C085;font-size: 40rpx;margin: 25rpx 22rpx 0 22rpx}
.orders-address {
  position: relative;
  padding: 25rpx 0;
  display: flex;
  font-size: 14px;
  line-height: 25px;
  color: #adadad;
}
.orders-address-detail{font-size: 26rpx;color: #666;line-height: 30rpx;width: 459rpx}
.orders-address::after {
  position: absolute;
  right: 40rpx;
  top: 60rpx;
  content: '';
  width: 20rpx;
  height: 20rpx;
  border-top: 4rpx solid #999;
  border-right: 4rpx solid #999;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.default {
  width: 44rpx;
  height: 23rpx;
  font-size: 14rpx;
  border-radius: 9rpx;
  color: #fff;
  display: block;
  text-align: center;
  line-height: 23rpx;
  background-color: #FF4606;
  margin-top: 6rpx;
  margin-right: 5rpx
}
.order-list{width: 470rpx;}
.orders-address-item{display:flex}
.orders-address-name {
  display: inline-block;
  font-size: 34rpx;
  margin-right: 20rpx
}
.orders-no-address {
  font-size: 26rpx;
  position: relative;
  line-height: 100rpx;
  color: #666;
  text-align: center;
}
.orders-box {
  padding-bottom: 0rpx;
}
.orders-list {
  position: relative;
  height: 180rpx;
  margin-bottom: 10rpx;
  background-color: #fff;
  border-radius: 10rpx;
  display: flex;
  padding: 30rpx 0;
}
.orders-list>view {
  display: flex;
}
.orders-thumb {
  width: 167rpx;
  height: 159rpx;
  margin: 0 23rpx;
}
.orders-pro-name {
  color: #333;
  margin: 10rpx 0 10rpx 0;
  font-weight: bold;
  font-size: 30rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-norms {
  color: #999;
  font-size: 26rpx;
}
.order-detail {
  width: 417rpx;
}
.orders-pro-price {
  margin-top: 29rpx;
  color: #ff4606;
  font-size: 32rpx;
  font-weight: bold;
}
.orders-count-num {
  margin-top: 125rpx;
  font-size: 34rpx;
  width: 50rpx;
  color: #b3b3b3;
}
.orders-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 106rpx;
  line-height: 106rpx;
  background: #fff; box-sizing: border-box;
  display: flex;z-index: 99;
  overflow: hidden
}
.orders-footer .orders-footer-total {
  width: 504rpx;
  padding-left: 38rpx;
  color: #666;
  font-size: 26rpx;
  display: flex;align-items: center;line-height: 106rpx
}
.orders-footer-total-money {
  color: #ff5e10;
  font-weight: bold;
  font-size: 32rpx;
}
.orders-footer .orders-footer-btn {
  display: inline-block;
  width: 246rpx;
  height: 106rpx;
  text-align: center;
  color: #fff;
  background: #e74a05;
  font-size: 28rpx;
  padding: 0 5rpx;
  line-height: 106rpx
}
.orders-bottom-text {
  display: flex;
  line-height: 100rpx;
  font-size: 26rpx;
  margin: 0 20rpx;
}
.orders-bottom-text>text {
  color: #333;
  font-weight: bold;
  font-size: 30rpx;
}
.orders-bottom {
  padding-bottom: 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 10rpx;
}
.orders-bottom-text text {
  margin: 0 15rpx;
}
/* .remarks {
  flex-direction: column;
} */
.orders-bottom-text>text {
  width: 30%;
}
.orders-bottom-text-right {
  display: flex;
  width: 70%;
  justify-content: flex-end;
  color: #666;
}
.orders-bottom-text-right-last {
  color: #ff3f3a;
}
.orders-bottom-text-input {
  margin: 0rpx 20rpx;
  height: 100rpx;
  width: 100%;
  padding-left: 10rpx;
  border-radius: 10rpx;
  font-size: 26rpx;
  line-height: 100rpx;text-align: right
}
.youhui-box{
  line-height: 100rpx;
  font-size: 26rpx;
  padding-bottom: 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 100rpx;
}
.youhui-item{
  width: 100%;
}
.youhui-box .left{
  text-align: left;
  padding-left: 15px;
  display: inline-block;
  width: 20%;
}
.youhui-box .right{
  text-align: right;
   padding-right: 15px;
  display: inline-block;
   width: 60%;
}
/* 下拉列表 */
.list-msg {
  background-color: #fff;
  position: relative;
}
.list-msg .list-msg2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.select_box {
  background-color: #fff;
  width: 93%;
  position: absolute;
  top: 80rpx;
  z-index: 1;
  overflow: hidden;
  animation: myfirst 0.5s;
}
.select_one {
  height: 60rpx;
  line-height: 60rpx;
  border-bottom: 1px solid #ccc;
}
.icon-jia {
  color: #666;
  font-weight: bold;
}
.division{
  height: 6rpx;
  display: block;
  margin-bottom: 10rpx;
}
.getShopStore, .delivery {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 688rpx;
  background: #fff;
  border-radius: 10px 10px 0px 0px;
}
.getShopStore, .delivery text {
  font-size: 26rpx;
  font-weight: bold;
}
/* page{
  background-color: skyblue!important
} */
.choice {
  width: 686rpx;
  margin: auto;
  color: #999;
  display: flex;
  align-items: center;
  padding-top: 28rpx;
}
.choice .title {
  width: 96%;
  display: block;
}
.icon-quxiao {
  font-size: 38rpx;
}
.label-2 {
  font-size: 30rpx;
  line-height: 100rpx;
}
.label-2__icon {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 40rpx;
  height: 40rpx;
  border-radius: 50%;
  border: 1px solid #999;
  left: 88%;
}
.icon-checked {
  background-image: url(http://file.micromall.xczhyf.cn/wxxcx/image/20.png);
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
}
.active .label-2__icon {
  background: #00c085;
  border: none;
}
radio-group {
  height: 500rpx;
  overflow-y: scroll;
  margin-top: 29rpx;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  height: 500rpx;
  overflow-y: hidden;
  padding-bottom: 143rpx;
}
.coupons-container{margin: 0;position: relative}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons .money::after{
left: 280rpx;
}
.coupons-list .coupons-container:last-child{padding-bottom: 106rpx}
button {
  line-height: 106rpx;
  border-radius: 0;
  border: none;
  display: flex;
  background-color: #fff;
  width: 100%;
  align-items: center;
  font-size: 30rpx;
  padding-left: 0;
  padding-right: 0;
  color: #333;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden
}
.button-hover{
  /* color:#fff; */
  background-color: rgba(0,0,0,0);
}
button:after {
  border: 0px;
  color: #333;
}
.coupons-list radio-group{margin-top: 0}
.coupons-one{
  font-size: 30rpx;
  color: #333;
  display: flex;
  align-items: center;
  width: 90%;
  margin: 30rpx auto;
}
.checked-lable{
  width: 100%;display: flex;white-space: nowrap
}
.radio-one{
  width: 70%;text-align: right
}
radio{
    transform: scale(0.8);
}
pages/shalong/shalongDetail.js
New file
@@ -0,0 +1,160 @@
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var app=getApp();
Page({
  data: {
    //常量定义
    JOIN_STATUS_NOT_JOIN : 0,
    //1加入状态确认中
    JOIN_STATUS_ING : 1,
    //1加入状态加入成功
    JOIN_STATUS_Y : 2,
    //1加入状态加入失败
    JOIN_STATUS_N : 3,
    JOIN_STATUS_END : 4,
    interval: 2000,
    duration: 1000,
    art: { },
    products: [ ],
    //展示相册
    imgUrls: [],
    imagetext: ['活动说明'],
    currentTabsIndex: 0,
    shareShow: false,
    isShare: 0,
    qrcode:false,
    lxdh:{},
    showModel:0,
  },
  onLoad: function(options) {
    console.log(options)
    var id = options.id;
    this.setData({ id: id,shopId:app.shopInfo.id });
    var _this = this;
    util.request({
      method: 'GET',
      api: api.shalong.findSalongById + id,
      callback: function (data) {
        let activity = data.mapInfo.activity;
        activity.actContent = activity.actContent.replace(/<img /g, '<img class="rich_img" ');
        let userRecord=data.mapInfo.userRecord;
        let showModel=_this.showModel;
        if(userRecord){
          showModel=userRecord.status;
        }
        if(data.mapInfo.status==2){
          showModel=_this.data.JOIN_STATUS_END;
        }
        _this.setData({
          activity: activity,
          imgUrls:[ activity.actImg ],
          showModel:showModel,
        });
      },
      checkLogin:true,
    });
  },
  formSubmit(e){
    let _this=this;
    console.log('form发生了submit事件,携带数据为:', e.detail.value)
    util.request({
      api:api.shalong.joinSalong,
      data:{
        actId:_this.data.id,
        attrLists:e.detail.value,
        shopId:_this.data.shopId
      },
      callback:function(data){
          wx.showToast({
            title: data.info,
          });
          if(data.info.indexOf('成功')>0){
            _this.setData({
              showModel:_this.data.JOIN_STATUS_ING
            });
          }
      }
    });
  },
  onShow(options) {
  },
  // 回到首页
  goBack() {
    wx.switchTab({
      url: '../index/index'
    })
  },
  goIndex() {
    wx.reLaunch({
      url: '/pages/index/index'
    })
  },
  //转发
  onShareAppMessage(res) {
    var _this=this;
    var shopId=this.shopId;
    var title = this.data.activity.actName;
    var id = this.data.id;
    return {
      title: title,
      imageUrl: _this.data.activity.actImg,
      path: "/pages/shalong/shalongDetail?id=" + id + "&&shopId=" +shopId ,
    }
  },
  // 分享
  share(e) {
    this.setData({
      shareShow: true,
      popupShow: true
    })
  },
  // 图文选项卡
  onTabsItemEvent(e) {
    var index = e.currentTarget.dataset.index;
    this.setData({
      currentTabsIndex: index
    })
  },
  // 生成卡片跳转
  card(e) {
    var id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../card/card?id=' + id,
    })
  },
  popupTap(e) {
    this.setData({
      shareShow: false
    })
  },
  // 进入商品页
  intoDetail(e) {
    var id = e.currentTarget.dataset.id;
    console.log(id);
    wx.navigateTo({
      url: '/pages/product/details?id=' + id,
    })
  },
})
pages/shalong/shalongDetail.json
New file
@@ -0,0 +1,5 @@
{
  "navigationBarBackgroundColor": "#fff",
  "navigationBarTitleText": "沙龙活动",
  "usingComponents": {}
}
pages/shalong/shalongDetail.wxml
New file
@@ -0,0 +1,76 @@
<view class="detail_container">
    <swiper indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='#00C085' indicator-color='#BDD8D0'>
        <block wx:for="{{imgUrls}}" wx:key="key">
            <swiper-item>
                <image src="{{item}}" class="slide-image" mode="aspectFill"></image>
            </swiper-item>
        </block>
    </swiper>
    <view class="detail_section">
        <view class="detail_content">
            <view class="detail_top">
                <view class="detail-group">
                    <view class="detail-left">
                        <view class='detail_iprice'>{{activity.actName}}</view>
                        <view class='grey  author'>
                            <text class="nam">{{activity.actBeginTime}}</text>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <view class="joinForm">
            <form bindsubmit="formSubmit">
                <view wx:if="{{showModel==JOIN_STATUS_NOT_JOIN }}">
                    <view class="form-item" wx:for="{{activity.attributes}}" wx:key="id">
                        <text>{{item.attrName}}:</text>
                        <input name="{{item.attrName}}" />
                    </view>
                </view>
                <button formType="submit" wx:if="{{showModel==JOIN_STATUS_NOT_JOIN }}" class='detail_cart detail_pay_big cleanbtn btn-center'>报名参加</button>
                <button wx:if="{{showModel==JOIN_STATUS_Y }}" class='detail_cart detail_pay_big cleanbtn btn-center'>报名成功</button>
                <button wx:if="{{showModel==JOIN_STATUS_ING }}" class='detail_cart detail_pay_big cleanbtn btn-center'>报名确认中...</button>
                <view wx:if="{{showModel==JOIN_STATUS_N }}" class='detail_cart detail_pay_over cleanbtn'>报名失败</view>
                <view wx:if="{{showModel==JOIN_STATUS_END }}" class='detail_cart detail_pay_over cleanbtn'>活动结束</view>
            </form>
        </view>
        <!-- 图文说明 -->
        <view class='detail_imagetext'>
            <view class="imagetext_detail_box">
                <view class="tabs_content">
                    <view>
                        <rich-text class='price_content' nodes="{{activity.actContent}}"></rich-text>
                    </view>
                </view>
            </view>
        </view>
    </view>
</view>
<view class="popup-item" wx:if="{{shareShow}}">
    <view class='popup' bind:tap="popupTap" wx:if="{{popupShow}}"></view>
    <view class="pupup-bottom popup-content">
        <view class="share-container">
            <view class="hr"></view>
            <text class="share-text">分享到</text>
        </view>
        <view class="share-box">
            <button open-type="share" data-index="{{index}}" bind:tap="popupTap">
                <image src="/image/wx.png"></image>
                微信
            </button>
        </view>
        <view class="cancel padding" bind:tap="popupTap">取消</view>
    </view>
</view>
<!-- 回到首页 -->
<view class="index" bind:tap="goIndex" wx:if="{{isShare}}">
    <image src="/image/goIndex.png"></image>
</view>
pages/shalong/shalongDetail.wxss
New file
@@ -0,0 +1,922 @@
@import "../../icon/iconfont.wxss";
.indexVideo {
  width: 100%;
}
swiper {
  height: 500rpx;
  width: 100%;
}
.slide-image {
  width: 100%;
  height: 100%;
}
swiper-item {
  background: #fff;
}
.detail_top {
  font-size: 34rpx;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 40rpx 0;
}
.detail-group {
  display: flex;
  align-items: center;
}
.detail-left {
  width: 90%;
}
.author .iconfont {
  margin-right: 5rpx;
}
.author .nam {
  text-indent: 5rpx;
}
.author text {
  font-size: 25rpx;
  color: #00C085;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.share {
  width: 30%;
  text-align: right;
}
.share image {
  width: 42rpx;
  height: 42rpx;
}
.detail_top>view {
  width: 90%;
  margin: auto;
}
.detail_name {
  width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail_info {
  display: flex;
  padding: 11rpx 0 0rpx 0;
  align-items: center;
}
.detail_iprice {
  font-size: 35rpx;
  font-weight: bold;
  margin-bottom: 15rpx;
}
.couple {
  background: #fff;
  margin: 10rpx 0;
}
.couple>view {
  display: flex;
  width: 90%;
  margin: auto;
  line-height: 70rpx;
}
.couple_right {
  width: 90%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.couple .threeblack {
  font-weight: bold;
}
.couple_right .icon-31gouwuquan {
  width: 72rpx;
  height: 38rpx;
  position: absolute;
  left: -73rpx;
}
.couple_icon {
  background: url("http://file.micromall.xczhyf.cn/wxxcx/image/70.png");
  margin-left: 23rpx;
  width: 88rpx;
  height: 29rpx;
  background-size: 100% 100%;
  text-align: center;
}
.couple_icon .price {
  font-size: 24rpx;
  color: #fff;
  margin-top: -19rpx;
}
.couple-list .icon-youbian {
  margin-top: 6rpx;
}
.avatarUrl {
  width: 50rpx;
  height: 50rpx;
  border-radius: 50%;
}
.eval_text {
  font-weight: bold;
  width: 77%;
}
.product_eval {
  display: flex;
  line-height: 80rpx;
}
.all {
  display: flex;
  line-height: 80rpx;
}
.evaluate_container {
  background: #fff;
}
.evaluate_container>view {
  width: 90%;
  margin: auto;
}
.star {
  display: flex;
  align-items: center;
  width: 45%;
  padding-left: 62rpx;
}
.star image {
  width: 30rpx;
  height: 29rpx;
  margin-right: 17rpx;
}
.evaluate_detail>view {
  display: flex;
  align-items: center;
}
.evaluate-info {
  display: flex;
  align-items: center;
  width: 21%;
}
.user_name {
  margin-left: 20rpx;
  font-size: 26rpx;
  width: 48%;
}
.evaluate_detail {
  padding-bottom: 40rpx;
}
.status {
  padding-top: 34rpx;
  display: block;
  color: #999;
  font-size: 28rpx;
}
.detail_imagetext {
  margin-top: 10rpx;
  background: #fff;
}
.imagetext_box {
  display: flex;
  width: 90%;
  margin: auto;
}
.imagetext_item {
  padding: 30rpx 0;
  color: #999;
  font-size: 28rpx;
  width: 100%;
  text-align: center;
}
.tabs_content {
width: 100%;
  margin: auto;
}
.price_content {
  color: #666;
  font-size: 24rpx;
  line-height: 36rpx;
}
.rich_img {
  max-width: 100%;
  margin: 0rpx;
  padding: 0rpx;
  border: none;
}
.carriage .couple_right {
  width: 73%;
}
.imagetext_detail_box .title {
  color: #00C085;
  font-size: 36rpx;
  white-space: nowrap;
  line-height: 80rpx;
}
.explain_tabs>view {
  display: flex;
  flex-direction: column;
  margin-bottom: 40rpx;
}
.explain_tabs {
  width: 93%;
}
.explain_tabs .content {
  font-size: 26rpx;
  color: #666;
  line-height: 36rpx;
}
.imagetext_detail_box {
  padding: 29rpx 0;
}
.imagetext_box .selected {
  font-size: 28rpx;
  font-weight: bold;
  color: #00C085;
  border-bottom: 2px solid #00C085;
}
button {
  border: none;
  color: #666;
  display: inherit;
}
button {
  line-height: 36rpx;
  border: none;
  width: 100%;
  align-items: center;
  font-size: 20rpx;
  padding-left: 0;
  padding-right: 0;
}
button:after {
  border: 0px;
  color: #414141;
}
.popup-item {
  width: 100%;
  height: 100%;
  position: fixed;
  bottom: 0;
  z-index: 99;
}
.pupup-bottom {
  position: absolute;
  bottom: 0;
  width: 100%;
}
.popup-item .cancel {
  font-size: 36rpx;
  margin-top: 12rpx;
}
.popup-item .padding {
  height: 100rpx;
  line-height: 100rpx;
  background: #fff;
  text-align: center;
  color: #000;
}
.goIndex {
  position: fixed;
  z-index: 9999;
  bottom: 0;
  width: 163rpx;
  display: flex;
  flex-direction: column;
  font-size: 26rpx;
  color: #fff;
  height: 78rpx;
  right: 0;
  top: 80%;
}
.goIndex image {
  width: 100%;
  height: 100%;
}
.popup-content {
  background: #fff;
  border-radius: 10px 10px 0px 0px;
  height: 492rpx;
}
.popup-content button {
   width: 180rpx;
  font-size: 30rpx;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: none;
  background: none;
}
.popup-content .button-hover {
  background: #fff;
  text-align: right;
}
.share-box {
  display: flex;
  padding: 40rpx 0;
}
.card {
  width: 50%;
  font-size: 30rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #666;
}
.popup-content .hr {
  display: block;
  content: '';
  width: 100%;
  position: absolute;
  top: 50%;
  border-top: 2rpx solid #c3c3c3;
  opacity: 0.6;
}
.popup-content .share-container {
  text-align: center;
  position: relative;
  padding: 44rpx 0;
  width: 33%;
  margin: auto;
  letter-spacing: 1rpx;
}
.popup-content .share-text {
  position: relative;
  padding: 0 20rpx;
  color: #666;
  background-color: #fff;
  font-size: 30rpx;
}
.popup-content .padding {
  background: #ff5806;
  margin-top: 0;
  font-size: 26rpx;
  color: #fff;
  position: absolute;
  bottom: 0;
  width: 100%;
  line-height: 74rpx;
  height: 74rpx;
}
.share-box image {
  width: 125rpx;
  height: 125rpx;
  padding-bottom: 20rpx;
}
.index image {
  width: 163rpx;
  height: 78rpx;
}
.index {
  position: fixed;
  bottom: 140rpx;
  right: 0;
  z-index: 999;
}
.detail_footer {
  height: 106rpx;
  width: 100%;
  position: fixed;
  bottom: 0;
  display: flex;
  line-height: 106rpx;
  background: #f7f7f7;
}
.detail_section {
  padding-bottom: 106rpx;
}
button {
  border: none;
  color: #666;
  display: inherit;
}
.footer-grey .detail_buy{background: #666666}
.detail_buy {
  background: #ff5806;
}
.footer-grey .detail_cart{background: #B3B3B3}
.detail_cart {
  background: #00C085;
}
.detail_pay {
  width: 35%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_pay_big {
  width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
}
.detail_pay_over{
   width: 70%;
  color: #fff;
  font-size: 28rpx;
  text-align: center;
  background:#999999;
}
.singer{
  background: rgb(155, 235, 211);
}
.detail_collected {
  width: 15%;
  text-align: center;
  line-height: 36rpx;
  font-size: 20rpx;
  margin-top: 20rpx;
  color: #666;
}
.button-hover {
  background: #f7f7f7;
  color: #666;
}
.service {
  margin-top: 20rpx;
  width: 15%;
  position: relative;
}
.detail_footer .iconfont {
  padding-bottom: 5rpx;
}
button {
  line-height: 36rpx;
  border: none;
  align-items: center;
  font-size: 20rpx;
  padding-left: 0;
  padding-right: 0;
}
.btn-center{
  display: flex;
  justify-content: center;
}
button:after {
  border: 0px;
  color: #414141;
}
.contact_list {
  width: 100%;
  position: absolute;
  height: 100%;
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
}
.icon-soucang {
  font-size: 32rpx;
}
.icon-shoucang {
  font-size: 36rpx;
  color: #ff3f3a;
}
.couple-image {
  width: 88rpx;
  height: 29rpx;
}
.couple .threeblack {
  width: 20%;
}
.icon-youbian {
  color: #cacaca;
  padding-left: 15rpx;
}
.norms-container {
  background: #fff;
  width: 750rpx;
  background: rgba(255, 255, 255, 1);
  border-radius: 10rpx 10rpx 0rpx 0rpx;
}
.norms-container {
  position: absolute;
  bottom: 0;
}
.norms-item image {
  width: 180rpx;
  height: 180rpx;
  margin-right: 35rpx;
}
.norms-item {
  display: flex;
  width: 96%;
}
.norms-detail {
  display: flex;
}
.norms-content {
  display: flex;
  flex-direction: column;
}
.norms-list {
  width: 90%;
  margin: auto;
}
.norms-list .threeblack {
  font-size: 26rpx;
}
.norms-box-item {
  font-size: 24rpx;
  background: #eee;
  color: #333;
  padding: 9rpx 30rpx;
  border-radius: 30rpx;
  text-align: center;
  margin-right: 20rpx;
  margin-top: 20rpx
}
.selectedNorms {
  color: #ff3f3a;
  background: #fff;
  border: 1px solid #ff3f3a;
}
.coupons-list{
  width: 100%;
  background:#F3F3F3;
  border-radius:20px 20px 0px 0px;
  position: absolute;bottom: 0;
  padding: 30rpx 0;
  height: 500rpx;
  overflow-y: auto
}
.coupons{margin: auto;margin-bottom: 10rpx}
.coupons-container{margin: 0}
.alreadyGet{
  background-color: #999999
  }
.coupons-list>view{
  position: relative
}
.coupons .money::after{
left: 280rpx;
}
.detail_info .grey{white-space: nowrap;width: 30%;text-align: right}
.cart-list .cart-count-box{
    display: flex;align-items: center;
    margin-top:55rpx;
}
.cart-count-box image{width: 32rpx;height: 33rpx}
.cart-count-down,.cart-count-add{
    height: 100%;
}
.cart-count-num{
    background: #f9f9f9;
    font-size: 26rpx;
    border-radius:5rpx;
    color: #B3B3B3;
    text-align: center;
      width: 43rpx;
    height: 41rpx;
    line-height: 41rpx;
    margin-left: 15rpx;
    margin-right: 15rpx;
    margin-top: 8rpx
}
.detail-tel{display: flex;width: 100%}
.detail-tel .detail_pay{width: 85%;letter-spacing: 1rpx}
.tel-text{background: #00C085;position: absolute;top: 10rpx;font-size: 26rpx;right: 23rpx;border-radius: 17rpx;padding: 0 20rpx;color: #fff}
.popup-item{width: 100%;height: 100%;position: fixed;bottom: 0;z-index: 99}
.pupup-bottom{position: absolute;bottom: 0;width: 100%}
.detail_buy .button-hover{
  background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.detail_buy button{
   background: #ff5806;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  font-size: 34rpx;
  color: #fff
}
.tel{
  font-size: 34rpx;
}
.popup-item .cancel{
  font-size: 36rpx;
  margin-top: 12rpx
}
.popup-item .padding{
  height: 100rpx;
  line-height: 100rpx;
  background: #fff;
  text-align: center;
  color: #000;
}
.goIndex{
  position: fixed;z-index: 9999;
  bottom: 0;width: 163rpx;
  display: flex;
  flex-direction: column;
  font-size: 26rpx;
  color:#fff;
  height: 78rpx;
  right: 0;
  top: 80%;
}
.goIndex image{
  width: 100%;
  height: 100%
}
.popup-content{background: #fff;border-radius:10px 10px 0px 0px;height: 492rpx}
.popup-content button{background: #fff;width: 50%;font-size: 30rpx;display: flex;flex-direction: column}
.popup-content .button-hover{
  background: #fff;
  text-align: right;
}
.share-box{
  display: flex;padding: 40rpx 0;
}
.card{width: 50%;font-size: 30rpx;display: flex;flex-direction: column;align-items: center;color:#666 }
.popup-content .hr{
  display:block;content:'';width:100%;position:absolute;top:50%;border-top:2rpx solid #c3c3c3;opacity:0.6
}
.popup-content .share-container{
  text-align:center;position:relative;padding:44rpx 0;width:33%;margin:auto;letter-spacing:1rpx;
}
.popup-content .share-text{
  position:relative;padding:0 20rpx;color:#666;background-color:#fff;font-size: 30rpx
}
.popup-content .padding{
  background: #FF5806;margin-top: 0;font-size: 26rpx;
  color: #fff;position: absolute;bottom: 0;width: 100%;
  line-height: 74rpx;
  height: 74rpx
}
.share-box image{
  width: 125rpx;height: 125rpx;padding-bottom: 20rpx
}
.explain-images image{
  width: 100%;
  height: 1342rpx
}
.explain-image image{
  width: 100%;
  height: 1941rpx
}
.index image{
  width: 163rpx;
  height: 78rpx
}
.index{position: fixed;bottom:140rpx;right: 0;z-index: 999;}
 .djs{
  height: 80rpx;
  background: #fc464f;
  color: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items:center;
 }
 .js{
  font-weight: bold;
   font-size: 38rpx;
 }
 .time{
   font-weight: bold;
 }
 .groupNums{
   display: flex;
   flex-direction:row-reverse;
   align-items: center;
   height: 100rpx;
 }
 .groupNum{
   padding: 2rpx 10rpx;
   border: 1px solid  #fc464f;
   font-size: 20rpx;
   text-align: center;
   background: #ffffff;
   width: 100rpx;
   border-radius: 5rpx;
    margin-left: 10rpx;
    font-weight: bold;
    color:  #fc464f;
    height: 40rpx;
    line-height: 40rpx;
    overflow: hidden;
 }
.groupNums .active{
  background: #fc464f;
  color: white;
}
.cllist{
  display: flex;
  justify-content: space-between;
}
.headimg{
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  vertical-align: middle
}
.slide-item text{
  margin-left:10rpx;
}
.slide-item button{
  vertical-align: middle;
}
navigator{
 display: inline;
}
.ctbtn{
  background: #00C085;
  border: noen;
  color:#ffffff;
}
.grtitle{
  height: 50rpx;
  line-height: 50rpx;
}
.userBox{
  display: flex;
  justify-content: center;
  height: 200rpx;
}
.tzFlag{
  width: 60rpx;
  height: 30rpx;
  font-size: 25rpx;
  line-height: 30rpx;
  border-radius: 5rpx;
  background: #fc464f;
  color: #fff;
  text-align: center;
}
.userItem{
  margin-top: 60rpx;
}
.queshi{
  text-align: center;
  height: 80rpx;
  line-height: 80rpx;
}
.cleanbtn{
  border-radius: 0rpx;
  text-align: center !important;
  height: 80rpx;
  margin: 20rpx 0rpx;
  width: 100%;
  line-height: 80rpx;
}
.headDjs{
  display: flex;
}
.headBuy{
  display: flex;
  flex-direction: column;
}
.headBuy view{
  height: 40rpx;
}
.headprice{
  font-size:20rpx;
}
.joinForm{
  margin:20rpx 40rpx;
}
.title{
  text-align: center;
  font-size: 30rpx;
  line-height: 60rpx;
}
.form-item{
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  height: 80rpx;
  align-items: center;
}
.form-item >text{
  height: 60rpx;
  line-height: 60rpx;
}
.form-item >input{
  height: 60rpx;
}
pages/shalong/shalongList.js
New file
@@ -0,0 +1,156 @@
const app = getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    activeList: [],
    offset: 0,
    limit: 10,
    isEnd: false,
    shopId: '',
    toTopIcon: false,
    top_num: 0,
    totalNum: 0,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getActiveList();
    this.setData({
      shopId: app.shopInfo.id,
    });
  },
  /**
   * 加沙龙列表
   */
  getActiveList: function () {
    var _this = this;
    var limit = _this.data.limit;
    var offset = _this.data.offset;
    util.request({
      api: api.shalong.findSalong,
      data: {
        "limit": limit,
        "offset": offset,
        "shopId": app.shopInfo.id,
      },
      callback: function (data) {
        if (data.rows.length == 0) {
          _this.setData({
            isEnd: true
          });
        } else {
          var activeList = _this.data.activeList;
          for (var i = 0; i < data.rows.length; i++) {
            activeList.push(data.rows[i])
          }
          //更新下次调用的角标
          _this.setData({
            activeList: activeList,
            offset: offset + limit,
          });
        }
      }
    });
  },
  // 进入详情
  intoDetail(e) {
    var _this = this;
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/shalong/shalongDetail?id=' + id,
    })
  },
  //一键回到顶部
  goTap() {
    this.setData({ top_num: 0 })
  },
  scroll_distance: function (event) {
    this.setData({
      toTopIcon: event.detail.scrollTop > 300 ? true : false
    })
  },
  backtop: function () {
    this.setData({ top_num: 0 })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.getActiveList();
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})
pages/shalong/shalongList.json
New file
@@ -0,0 +1,5 @@
{
  "navigationBarBackgroundColor": "#fff",
  "navigationBarTitleText": "沙龙活动",
  "usingComponents": {}
}
pages/shalong/shalongList.wxml
New file
@@ -0,0 +1,18 @@
<scroll-view>
    <view class="shalongBox" wx:for="{{activeList}}" data-id="{{item.id}}"  wx:key="id" bindtap="intoDetail" >
        <image  mode="aspectFill" src="{{item.actImg}}"></image>
        <view class="actBox" >
            <view class="actTitle">
                <view class="title" >{{item.actName}}</view>
                <view class="gray">活动时间:{{item.actBeginTime}}</view>
            </view>
            <view class="btn">马上报名</view>
        </view>
    </view>
</scroll-view>
<view wx:if="{{activeList.length==0}}" class="nodata">暂无数据</view>
  <view wx:if="{{activeList.length!=0&&isEnd}}" class="nodata " >没有更多了</view>
pages/shalong/shalongList.wxss
New file
@@ -0,0 +1,45 @@
.shalongBox{
  margin : 10rpx;
  background: #ffffff;
  padding: 10rpx;
}
.shalongBox image{
}
.actBox{
  display: flex;
  justify-content: space-between;
  height: 120rpx;
  margin-top: 20rpx;
  align-items: center;
  padding-bottom: 20rpx;
}
.actTitle{
  width: 500rpx;
}
.btn{
  width: 180rpx;
height: 60rpx;
background: #1AAD19;
color: #ffffff;
text-align: center;
border-radius: 5rpx;
line-height: 60rpx;
margin-left: 10rpx;
}
.title{
  font-size:35rpx;
  font-weight: bold;
}
.gray{
  color:#9f9f9f;
}
pages/shopCar/shopCar.js
New file
@@ -0,0 +1,230 @@
const app=getApp();
var util = require('../../utils/util.js');
var api = require('../../utils/service-api.js');
var comReq = require('../../utils/common-request.js');
Page({
  data: {
    selectAllStatus: 1,
    carts: [], // 购物车列表
    totalPrice: 0, // 总价,初始为0
    totalNum: 0, // 总数,初始为0
    couponGroupList: [{}],
    selectCount: "",
  },
  onShow() {
    comReq.refreshUserCartCount();
    this.loadCarList();
  },
  onLoad() {},
  /**
   * 删除购物车当前商品
   */
  deleteList(e) {
    var _this = this;
    const id = e.currentTarget.dataset.id;
    util.request({
      method: "POST",
      api: api.shoppingCart.deleteByCartId + id,
      callback: function(data) {
        _this.loadCarList();
        comReq.refreshUserCartCount();
      }
    });
  },
  /**
   * 当前商品选中事件
   */
  selectList(e) {
    let id = e.currentTarget.dataset.id;
    let isSelected = e.currentTarget.dataset.selected;
    isSelected = (isSelected == 1 ? 2 : 1);
    var _this = this;
    util.request({
      method: "POST",
      api: api.shoppingCart.updateCartSelected,
      data: {
        "cartId": id,
        "isSelected": isSelected
      },
      callback: function() {
        _this.loadCarList();
      }
    });
  },
  /**
   * 购物车全选事件
   */
  selectAll(e) {
    var _this = this;
    let selectAllStatus = this.data.selectAllStatus;
    selectAllStatus = (selectAllStatus == 1 ? 2 : 1);
    this.setData({
      "selectAllStatus": selectAllStatus,
    });
    util.request({
      method: "POST",
      api: api.shoppingCart.updateCartAllSelected + app.shopInfo.id +"/"+ selectAllStatus,
      callback: function() {
        _this.loadCarList();
      }
    });
  },
  /**
   * 绑定加数量事件
   */
  updateCarNumber(e) {
    var _this = this;
    const type = e.currentTarget.dataset.type;
    var id = e.currentTarget.dataset.id;
    let increaseAndDecrease = "1";
    if (type == "down") {
      increaseAndDecrease = "2";
    }
    util.request({
      method: "POST",
      api: api.shoppingCart.updateCarNumberByCartId,
      data: {
        "cartId": id,
        "increaseAndDecrease": increaseAndDecrease
      },
      callback: function(data) {
        _this.loadCarList();
        comReq.refreshUserCartCount();
      }
    });
  },
  /**
   *  结算
   */
  castAccount() {
    var _this = this;
    var ids = '';
    if (_this.data.selectCount == 0) {
      wx.showToast({
        title: '请选择商品',
        icon: 'success',
        duration: 2000
      })
    } else {
      //判断是否绑定手机号
      if (util.isBlank(getApp().userInfo.nickName)) {
        wx.navigateTo({
          url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
        })
      } else if (util.isBlank(getApp().userInfo.phoneNumber)) {
        wx.navigateTo({
          url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
        })
      }
      wx.navigateTo({
        url: '/pages/service/shopOrder?model=2',
      })
    }
  },
  // 进入商品详情
  goGoods(e) {
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../details/details?id=' + id, //把id传到product页面
    })
  },
  // 上拉加载
  onReachBottom: function() {
  },
  //加载购物车列表
  loadCarList() {
    var _this = this;
    util.request({
      method: "POST",
      data:{shopId:app.shopInfo.id},
      api: api.shoppingCart.findShoppingCart,
      callback: function(data) {
        if (data.mapInfo.cartCount == data.mapInfo.selectCount) {
          _this.setData({
            "selectAllStatus": 1,
          });
        } else {
          _this.setData({
            "selectAllStatus": 2,
          });
        }
        _this.setData({
          "couponGroupList": data.rows,
          "billTotal": data.mapInfo.billTotal,
          "billCouponTotal": data.mapInfo.billCouponTotal,
          "selectCount": data.mapInfo.selectCount,
          "cartCount": data.mapInfo.cartCount,
        });
      }
    });
  },
  /**
   * 凑单
   */
  coudan(e) {
    var coupon = e.currentTarget.dataset.coupon;
    console.log(coupon);
    if (coupon) {
      wx.navigateTo({
        url: '../shopTypeSecond/shopTypeSecond?content=' + coupon,
      })
    } else {
      console.log("没有优惠券");
      wx.switchTab({
        url: '../shopType/shopType',
        success: function() {
          console.log(1);
        },
        fail: function(e) {
          console.log(e);
        }
      })
    }
  },
  //一键回到顶部
  goTap() {
    util.goTap();
  },
  //获取滚动条当前位置
  onPageScroll: function(e) {
    if (e.scrollTop > 400) {
      this.setData({
        floorstatus: true
      });
    } else {
      this.setData({
        floorstatus: false
      });
    }
  },
})
pages/shopCar/shopCar.json
New file
@@ -0,0 +1,3 @@
{
  "navigationBarTitleText": "购物车"
}
pages/shopCar/shopCar.wxml
New file
@@ -0,0 +1,83 @@
<view class="main">
  <view class="cartWarp" wx:if="{{couponGroupList.length>0}}">
    <view wx:for="{{couponGroupList}}" wx:key="index" wx:for-item="couponGroup">
      <view class="couponGroup radius">
        <text class="lable" wx:if="{{couponGroup.coupon}}">满减</text>
        <text class="iconfont icon-icon-" wx:else></text> {{couponGroup.msg}}
        <text class="choudan" data-coupon="{{couponGroup.coupon.cname}}" bindtap="coudan" wx:if="{{couponGroup.satisfactionCoupon==false}}"> 去凑单>> </text>
      </view>
      <view class="cart-box">
        <view class="cart-list " wx:for="{{couponGroup.cartList}}" wx:key="index">
          <view bindtap="selectList" data-id="{{item.cartId}}" data-selected="{{item.isSelected}}">
            <icon wx:if="{{item.isSelected==1}}" class="iconfont icongouxuan-xuanzhong-yuankuang cart-pro-select" data-index="{{index}}" />
            <icon wx:else class="iconfont iconweigouxuan cart-pro-select" data-index="{{index}}" />
          </view>
          <navigator url="/pages/service/details?id={{item.cartProductId}}" style="margin-right: 10rpx;">
            <image mode="aspectFit" class="cart-thumb" src="{{item.imgMobile}}"></image>
          </navigator>
          <view class='cart_content' data-id='{{item.cartProductId}}' bindtap='goGoods'>
            <text class="cart-pro-name">{{item.title}}</text>
            <text class='grey norms'>规格:{{item.name}}</text>
            <text class="cart-pro-price">¥{{item.price}}</text>
          </view>
          <view>
            <text class="cart-del iconfont iconquxiao" bindtap="deleteList" data-index="{{index}}" data-id="{{item.cartId}}"></text>
            <view class="cart-count-box">
              <!-- iconfont icon-jian -->
              <view class="cart-count-down " bindtap="updateCarNumber" data-type="down" data-id="{{item.cartId}}">
                <image src='/image/jian.png'></image>
              </view>
              <text class="cart-count-num">{{item.cartNumber}}</text>
              <view class="cart-count-add" bindtap="updateCarNumber" data-type="up" data-id="{{item.cartId}}">
                <image src='/image/jia.png'></image>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 没有更多数据 -->
    <view class='text-center pd-10' wx:if="{{noMore}}">
      <view>
        <text class="color_gray font-12">没有更多了~</text>
      </view>
    </view>
    <view class="cart-footer">
      <icon wx:if="{{selectAllStatus==1}}" class="iconfont icongouxuan-xuanzhong-yuankuang total-select" bindtap="selectAll" />
      <icon wx:else class="iconfont iconweigouxuan total-select" bindtap="selectAll" />
      <view class="order-icon">
        <button class="car-pay" bindtap='castAccount'>结算({{selectCount}})</button>
      </view>
      <text class="choose-all">全选</text>
      <view class="all-money">
        <text class="cart-toatl-price">¥{{billTotal}}</text>
        <text class="freight">已优惠 ¥{{billCouponTotal}}</text>
      </view>
    </view>
  </view>
  <view wx:else>
    <view class='no-cart'>
      <image src='/image/56.png'></image>
      <view class="cart-no-data">您的购物车还是空的,快去逛逛吧!~</view>
    </view>
  </view>
</view>
<view class="toTap" bind:tap="goTap" hidden='{{!floorstatus}}'>
  <view class="iconfont icon-zhiding1"></view>
</view>
pages/shopCar/shopCar.wxss
New file
@@ -0,0 +1,226 @@
@import '../../common/css/common.wxss';
@import '../../icon/iconfont.wxss';
.couponGroup {
  background: #fcfbf7;
  padding: 30rpx 20rpx;
  margin: 10rpx 20rpx 0rpx 20rpx;
  font-size: 25rpx;
}
.cartWarp{
  padding-bottom: 110rpx;
}
.lable {
  font-size: 24rpx;
  display: inline-block;
  width: 60rpx;
  height: 35rpx;
  background: #ef8438;
  margin-right: 20rpx;
  text-align: center;
  line-height: 39rpx;
  color: #fff;
  border-radius: 2rpx;
}
.cart-list {
  display: flex;
  padding: 30rpx 20rpx;
  background-color: #fff;
  margin: 0rpx 20rpx 0rpx 20rpx;
}
.cart-list .cart-pro-select {
  font-size: 40rpx;
  margin-top: 56rpx;
}
.cart_content {
  width: 60%;
  line-height: 35rpx;
}
.cart-list .cart-thumb {
  margin: 0 31rpx 0 30rpx;
  width: 167rpx;
  height: 159rpx;
}
.cart-list .cart-pro-name {
  font-size: 30rpx;
  color: #333;
  font-weight: bold;
  /*设置文字溢出部分为...*/
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 270rpx;
  display: block;
}
.norms {
  font-size: 26rpx;
  display: flex;
  margin-top: 10rpx;
}
.cart-list .cart-pro-price {
  display: inline-block;
  margin-top: 47rpx;
  color: #fc081f;
  font-size: 32rpx;
  font-weight: bold;
}
.cart-list .cart-count-box {
  display: flex;
  align-items: center;
  margin-top: 55rpx;
}
.cart-count-box image {
  width: 32rpx;
  height: 33rpx;
}
.cart-count-down, .cart-count-add {
  height: 100%;
}
.cart-count-num {
  background: #f9f9f9;
  font-size: 26rpx;
  border-radius: 5rpx;
  color: #b3b3b3;
  text-align: center;
  width: 43rpx;
  height: 41rpx;
  line-height: 41rpx;
  margin-left: 15rpx;
  margin-right: 15rpx;
  margin-top: 8rpx;
}
.cart-del {
  color: #9b9b9b;
  font-size: 35rpx;
  margin-left: 105rpx;
  margin-top: -20rpx;
  display: block;
}
.cart-footer {
  font-size: 28rpx;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 106rpx;
  line-height: 106rpx;
  padding: 0 100rpx 0 80rpx;
  box-sizing: border-box;
  background: #fff;
  color: #000;
}
.total-select {
  position: absolute;
  left: 36rpx;
  font-size: 44rpx;
}
.order-icon {
  position: absolute;
  right: 0rpx;
  width: 246rpx;
  height: 74rpx;
}
.order-icon image, .order-icon navigator {
  display: block;
  width: 120rpx;
  height: 45rpx;
}
.cart-toatl-price {
  color: #fc081f;
  font-size: 28rpx;
  font-weight: bold;
}
.car-pay {
  font-weight: bold;
  border-radius: 0rpx;
  width: 246rpx;
  height: 106rpx;
  line-height: 106rpx;
  background-color: #e74a05;
  color: #fff;
  font-size: 30rpx;
}
.choose-all {
  margin-left: 10rpx;
  font-size: 24rpx;
  color: #333;
  font-weight: bold;
  margin-top: -1rpx;
  display: block;
}
.all-money {
  width: 50%;
  line-height: 44rpx;
  display: flex;
  text-align: right;
  flex-direction: column;
  font-size: 28rpx;
  margin-top: 8rpx;
  position: absolute;
  top: 0;
}
.icon-gouxuan {
  color: #00c085;
}
.icon-icon- {
   font-size: 30rpx;
  font-weight: bold;
  color: #00c085;
  line-height: 10rpx;
}
.icon-quan {
  color: #9b9b9b;
}
.freight {
  color: #b3b3b3;
  font-size: 24rpx;
  font-weight: bold;
}
.no-cart {
  text-align: center;
  font-size: 30rpx;
}
.cart-no-data {
  color: #333;
}
.no-cart image {
  width: 236rpx;
  height: 206rpx;
  margin: 265rpx 0 70rpx 0;
}
.choudan{
   font-size: 24rpx;
  display: inline-block;
  float: right;
  width: 120rpx;
  height: 35rpx;
  color: #ef8438;
  border-radius: 2rpx;
}
Diff truncated after the above file
pages/showAddress/showAddress.js pages/showAddress/showAddress.json pages/showAddress/showAddress.wxml pages/showAddress/showAddress.wxss pages/webView/webView.js pages/webView/webView.json pages/webView/webView.wxml pages/webView/webView.wxss pages/welcome/welcome.js pages/welcome/welcome.json pages/welcome/welcome.wxml pages/welcome/welcome.wxss pages/yuyue/chose.js pages/yuyue/chose.json pages/yuyue/chose.wxml pages/yuyue/chose.wxss pages/yuyue/choseMasseuse.js pages/yuyue/choseMasseuse.json pages/yuyue/choseMasseuse.wxml pages/yuyue/choseMasseuse.wxss pages/yuyue/choseService.js pages/yuyue/choseService.json pages/yuyue/choseService.wxml pages/yuyue/choseService.wxss pages/yuyue/choseShop.js pages/yuyue/choseShop.json pages/yuyue/choseShop.wxml pages/yuyue/choseShop.wxss pages/yuyue/khyuyue.js pages/yuyue/khyuyue.json pages/yuyue/khyuyue.wxml pages/yuyue/khyuyue.wxss pages/yuyue/order.js pages/yuyue/order.json pages/yuyue/order.wxml pages/yuyue/order.wxss pages/yuyue/shopOrder.js pages/yuyue/shopOrder.json pages/yuyue/shopOrder.wxml pages/yuyue/shopOrder.wxss pages/yuyue/yuyue.wxml pages/yuyue/yyInfo.js pages/yuyue/yyInfo.json pages/yuyue/yyInfo.wxml pages/yuyue/yyInfo.wxss pages/yuyue/yySuccess.js pages/yuyue/yySuccess.json pages/yuyue/yySuccess.wxml pages/yuyue/yySuccess.wxss project.config.json sitemap.json utils/Enum.js utils/bmap-wx.min.js utils/common-request.js utils/constance.js utils/dataFilter.wxs utils/service-api.js utils/shopcart.js utils/util.js