From f864fb0eee3bdde078768786f3c2dce0a41f36d4 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Mon, 11 Jan 2021 16:31:14 +0800
Subject: [PATCH] 1
---
image/arrow-bottom_02.png | 0
image/shopping_active.png | 0
pages/phone/phone.json | 3
image/star2.png | 0
image/share.png | 0
image/tp.png | 0
image/head-bg2.png | 0
pages/service/details.js | 590 +
image/time.png | 0
pages/ads/showAdPage.wxss | 41
image/61.png | 0
pages/payOrder/payOrder.json | 3
image/user.png | 0
pages/checkRecord/recordList.js | 113
pages/payOrder/paySuccess.json | 1
pages/groupbuy/groupOrder.wxss | 396
pages/article/article.wxml | 2
pages/webView/webView.wxml | 5
pages/showAddress/showAddress.js | 188
pages/groupbuy/groupDetails.json | 3
pages/shopCar/shopCar.js | 230
pages/payOrder/paySuccess.wxss | 28
pages/miaosha/msList.wxml | 64
pages/ads/showAdPage.json | 3
pages/yuyue/yyInfo.json | 3
image/cart_grey.png | 0
pages/yuyue/khyuyue.json | 3
pages/checkRecord/recordList.wxss | 43
pages/index/index.wxml | 70
pages/shalong/shalongDetail.wxml | 76
pages/yuyue/yuyue.wxml | 0
pages/orderDetails/orderDetails.wxss | 44
image/card3.png | 0
utils/util.js | 582 +
pages/checkRecord/recordList.json | 4
pages/phone/phone.wxss | 54
image/587.png | 0
image/consult.png | 0
pages/miaosha/msDetails.wxml | 279
pages/yuyue/choseMasseuse.wxss | 74
pages/shopCar/shopCar.wxml | 83
pages/yuyue/order.wxss | 131
image/head.png | 0
pages/miaosha/msOrder.json | 3
app.wxss | 379
image/fail.png | 0
image/pocon.png | 0
pages/groupbuy/groupList.js | 226
pages/miaosha/msList.js | 248
pages/applyRefund/applyRefund.wxml | 69
pages/editAddress/editAddress.js | 143
utils/shopcart.js | 181
pages/miaosha/msOrder.wxss | 396
sitemap.json | 9
pages/yuyue/yySuccess.wxss | 28
image/home.png | 0
pages/groupbuy/allPt.wxml | 19
pages/order/order.wxml | 78
pages/shalong/shalongList.wxml | 18
image/home_active.png | 0
pages/refund/refund.wxml | 23
app.json | 104
pages/groupbuy/allPt.js | 102
pages/service/service2.js | 319
pages/yuyue/order.json | 3
components/skuList/skuList.wxml | 51
pages/yuyue/choseMasseuse.json | 3
pages/groupbuy/groupList.wxml | 32
pages/payOrder/payOrder.wxss | 85
pages/service/shopOrder.wxss | 396
pages/shopCar/shopCar.wxss | 226
pages/groupbuy/groupOrder.js | 448 +
pages/yuyue/choseMasseuse.wxml | 32
pages/service/details.wxml | 325
pages/yuyue/choseService.wxml | 34
image/user_active.png | 0
pages/ads/showAdPage.js | 153
pages/editAddress/editAddress.wxml | 33
models/address.js | 14
pages/customerCoupons/customerCoupons.wxml | 118
pages/order/order.json | 4
image/arrow-bottom_01.png | 0
pages/service/shopOrder.js | 404 +
image/icon_cj.png | 0
image/type.png | 0
image/62.png | 0
pages/yuyue/yySuccess.wxml | 9
pages/yuyue/chose.wxml | 2
pages/yuyue/choseShop.js | 116
components/search/index.wxss | 78
pages/index-back/index.wxss | 69
image/fh.png | 0
image/card2.png | 0
icon/iconfont.wxss | 164
image/56.png | 0
pages/order/order.wxss | 131
pages/productEvaluate/productEvaluate.js | 135
image/wx.png | 0
pages/yuyue/choseMasseuse.js | 100
pages/shalong/shalongList.wxss | 45
pages/yuyue/khyuyue.wxml | 105
pages/welcome/welcome.wxss | 36
pages/refund/refund.wxss | 42
pages/shalong/shalongList.json | 5
image/3.png | 0
pages/service/service.wxml | 38
pages/enterShopcoupon/enterShopcoupon.json | 6
pages/article/article.js | 84
image/spa_active.png | 0
image/icon_share.png | 0
components/search/index.json | 7
pages/groupbuy/groupDetails.wxml | 352
pages/index-back/index.json | 3
pages/yuyue/yySuccess.json | 3
image/2.png | 0
pages/article/article.json | 7
pages/logistics/logistics.wxml | 91
.gitignore | 34
pages/index/index.json | 3
pages/yuyue/choseShop.json | 3
components/skuList/skuList.js | 96
pages/refund/refund.json | 4
pages/welcome/welcome.js | 99
pages/article/article.wxss | 11
pages/refundOrder/refundOrder.js | 184
image/card1.png | 0
pages/customerCenter/customerCenter.wxss | 302
pages/checkRecord/recordInfo.wxml | 84
image/arrow-top_01.png | 0
pages/yuyue/khyuyue.js | 401
pages/enterShopcoupon/enterShopcoupon.wxss | 119
pages/service/service2.wxml | 83
pages/customerCenter/customerCenter.json | 6
pages/groupbuy/invited.js | 67
.vscode/settings.json | 5
pages/index/index.wxss | 60
pages/showAddress/showAddress.wxss | 119
pages/shalong/shalongDetail.js | 160
pages/order/order.js | 312
pages/yuyue/yyInfo.wxss | 46
pages/shopCar/shopCar.json | 3
pages/showAddress/showAddress.json | 3
pages/yuyue/choseShop.wxss | 62
utils/bmap-wx.min.js | 1
image/avatar.jpg | 0
image/shopping.png | 0
pages/yuyue/order.wxml | 61
pages/yuyue/yySuccess.js | 74
pages/logistics/logistics.wxss | 89
pages/miaosha/msOrder.js | 380
image/qb.png | 0
pages/groupbuy/groupList.json | 3
pages/yuyue/order.js | 201
pages/applyRefund/applyRefund.json | 3
pages/yuyue/shopOrder.json | 3
pages/applyRefund/applyRefund.wxss | 194
pages/logistics/logistics.json | 3
pages/payOrder/payError.json | 1
pages/miaosha/msOrder.wxml | 90
pages/yuyue/choseService.js | 137
image/nocoupon.png | 0
pages/service/service2.wxss | 243
pages/yuyue/shopOrder.js | 66
pages/payOrder/payOrder.js | 17
pages/groupbuy/groupDetails.js | 878 ++
pages/logistics/logistics.js | 125
pages/applyRefund/applyRefund.js | 302
pages/yuyue/choseShop.wxml | 23
image/card-bg.png | 0
pages/yuyue/choseService.json | 3
pages/groupbuy/groupList.wxss | 92
pages/enterShopcoupon/enterShopcoupon.js | 80
project.config.json | 224
pages/refundOrder/refundOrder.json | 4
pages/shalong/shalongDetail.json | 5
image/24.png | 0
pages/ads/showAdPage.wxml | 65
image/arrow-top_02.png | 0
pages/groupbuy/invited.wxml | 41
common/css/refund.wxss | 259
image/type_active.png | 0
pages/welcome/welcome.json | 3
pages/customerCoupons/customerCoupons.wxss | 115
image/gwc.png | 0
image/jia.png | 0
pages/groupbuy/groupOrder.wxml | 92
pages/phone/phone.js | 81
pages/index/index.js | 191
pages/refundOrder/refundOrder.wxss | 116
pages/miaosha/msDetails.json | 3
pages/service/service2.json | 5
utils/constance.js | 15
pages/orderDetails/orderDetails.js | 258
pages/payOrder/paySuccess.wxml | 15
pages/yuyue/chose.js | 66
pages/miaosha/msList.wxss | 125
pages/shalong/shalongDetail.wxss | 922 ++
pages/checkRecord/recordInfo.json | 7
pages/customerCoupons/customerCoupons.json | 3
image/head-bg.png | 0
pages/checkRecord/recordList.wxml | 7
pages/shalong/shalongList.js | 156
models/swiper.js | 0
image/tc.png | 0
pages/orderDetails/orderDetails.wxml | 154
pages/yuyue/shopOrder.wxss | 1
pages/phone/phone.wxml | 17
utils/Enum.js | 0
image/cart.png | 0
pages/miaosha/msDetails.wxss | 730 +
pages/payOrder/payError.wxss | 31
pages/productEvaluate/productEvaluate.wxml | 29
image/bg.png | 0
image/w-bg.png | 0
pages/index-back/index.js | 105
pages/groupbuy/invited.wxss | 36
pages/miaosha/msList.json | 3
image/11.png | 0
pages/customerCenter/customerCenter.wxml | 106
pages/service/shopOrder.json | 3
pages/checkRecord/recordInfo.wxss | 180
pages/refundOrder/refundOrder.wxml | 40
pages/enterShopcoupon/enterShopcoupon.wxml | 30
pages/productEvaluate/productEvaluate.json | 4
pages/groupbuy/allPt.wxss | 34
pages/payOrder/paySuccess.js | 142
pages/yuyue/chose.wxss | 1
image/time_active.png | 0
pages/yuyue/shopOrder.wxml | 2
image/zwjl1.png | 0
pages/showAddress/showAddress.wxml | 90
pages/groupbuy/invited.json | 3
pages/customerCoupons/customerCoupons.js | 165
image/star1.png | 0
utils/dataFilter.wxs | 21
components/skuList/skuList.wxss | 203
image/icon_zp.png | 0
pages/webView/webView.json | 3
pages/payOrder/payOrder.wxml | 19
pages/yuyue/yyInfo.wxml | 74
pages/service/shopOrder.wxml | 154
image/60.png | 0
pages/payOrder/payError.wxml | 9
pages/productEvaluate/productEvaluate.wxss | 23
utils/common-request.js | 87
image/goIndex.png | 0
pages/yuyue/choseService.wxss | 76
components/skuList/skuList.json | 4
pages/checkRecord/recordInfo.js | 136
pages/service/details.wxss | 582 +
pages/webView/webView.js | 68
utils/service-api.js | 189
pages/customerCenter/customerCenter.js | 117
pages/editAddress/editAddress.wxss | 110
image/spa.png | 0
pages/service/service.js | 204
app.js | 95
pages/yuyue/yyInfo.js | 208
pages/webView/webView.wxss | 4
pages/miaosha/msDetails.js | 508 +
components/search/index.js | 81
components/search/index.wxml | 20
pages/index-back/index.wxml | 34
pages/service/service.json | 3
pages/groupbuy/groupOrder.json | 3
pages/orderDetails/orderDetails.json | 3
pages/welcome/welcome.wxml | 9
pages/yuyue/khyuyue.wxss | 222
pages/editAddress/editAddress.json | 3
image/jian.png | 0
pages/groupbuy/allPt.json | 7
pages/refund/refund.js | 148
pages/service/service.wxss | 137
pages/service/details.json | 3
pages/yuyue/chose.json | 3
common/css/common.wxss | 427 +
pages/payOrder/payError.js | 3
image/logo.png | 0
pages/groupbuy/groupDetails.wxss | 730 +
279 files changed, 24,178 insertions(+), 21 deletions(-)
diff --git a/.gitignore b/.gitignore
index a1c2a23..3bfee46 100644
--- a/.gitignore
+++ b/.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/
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..12a62b0
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,5 @@
+{
+ "editor.fontSize": 14,
+ "files.autoSave": "afterDelay",
+ "editor.cursorStyle": "line-thin"
+}
\ No newline at end of file
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..9d5e4c2
--- /dev/null
+++ b/app.js
@@ -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({})
+ }
+ }
+ })
+ }
+ }
+ })
+ }
+
+})
\ No newline at end of file
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..855ca29
--- /dev/null
+++ b/app.json
@@ -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": "您的位置信息将用于收货地址"
+ }
+ }
+}
\ No newline at end of file
diff --git a/app.wxss b/app.wxss
new file mode 100644
index 0000000..8fbaccb
--- /dev/null
+++ b/app.wxss
@@ -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;
+}
diff --git a/common/css/common.wxss b/common/css/common.wxss
new file mode 100644
index 0000000..0bdcecb
--- /dev/null
+++ b/common/css/common.wxss
@@ -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;
+
+}
\ No newline at end of file
diff --git a/common/css/refund.wxss b/common/css/refund.wxss
new file mode 100644
index 0000000..4e52dcd
--- /dev/null
+++ b/common/css/refund.wxss
@@ -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 }
\ No newline at end of file
diff --git a/components/search/index.js b/components/search/index.js
new file mode 100644
index 0000000..d531604
--- /dev/null
+++ b/components/search/index.js
@@ -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);
+
+ }
+
+})
diff --git a/components/search/index.json b/components/search/index.json
new file mode 100644
index 0000000..0fdb611
--- /dev/null
+++ b/components/search/index.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarBackgroundColor": "#f7f7f7",
+ "navigationBarTitleText": "搜索",
+ "component": true,
+ "usingComponents": {}
+
+}
\ No newline at end of file
diff --git a/components/search/index.wxml b/components/search/index.wxml
new file mode 100644
index 0000000..9d3890a
--- /dev/null
+++ b/components/search/index.wxml
@@ -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>
\ No newline at end of file
diff --git a/components/search/index.wxss b/components/search/index.wxss
new file mode 100644
index 0000000..63bd665
--- /dev/null
+++ b/components/search/index.wxss
@@ -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;
+}
diff --git a/components/skuList/skuList.js b/components/skuList/skuList.js
new file mode 100644
index 0000000..5b23c82
--- /dev/null
+++ b/components/skuList/skuList.js
@@ -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
+ });
+ },
+
+
+
+
+ }
+
+})
diff --git a/components/skuList/skuList.json b/components/skuList/skuList.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/skuList/skuList.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/skuList/skuList.wxml b/components/skuList/skuList.wxml
new file mode 100644
index 0000000..484c579
--- /dev/null
+++ b/components/skuList/skuList.wxml
@@ -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\\\\\\\\\\\\\\\\\ -->
\ No newline at end of file
diff --git a/components/skuList/skuList.wxss b/components/skuList/skuList.wxss
new file mode 100644
index 0000000..7b78889
--- /dev/null
+++ b/components/skuList/skuList.wxss
@@ -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
+}
\ No newline at end of file
diff --git a/icon/iconfont.wxss b/icon/iconfont.wxss
new file mode 100644
index 0000000..3c99796
--- /dev/null
+++ b/icon/iconfont.wxss
@@ -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";
+}
diff --git a/image/11.png b/image/11.png
new file mode 100644
index 0000000..f3c1c03
--- /dev/null
+++ b/image/11.png
Binary files differ
diff --git a/image/2.png b/image/2.png
new file mode 100644
index 0000000..123cea6
--- /dev/null
+++ b/image/2.png
Binary files differ
diff --git a/image/24.png b/image/24.png
new file mode 100644
index 0000000..802cf30
--- /dev/null
+++ b/image/24.png
Binary files differ
diff --git a/image/3.png b/image/3.png
new file mode 100644
index 0000000..fe1533f
--- /dev/null
+++ b/image/3.png
Binary files differ
diff --git a/image/56.png b/image/56.png
new file mode 100644
index 0000000..af7901e
--- /dev/null
+++ b/image/56.png
Binary files differ
diff --git a/image/587.png b/image/587.png
new file mode 100644
index 0000000..28f3301
--- /dev/null
+++ b/image/587.png
Binary files differ
diff --git a/image/60.png b/image/60.png
new file mode 100644
index 0000000..5825844
--- /dev/null
+++ b/image/60.png
Binary files differ
diff --git a/image/61.png b/image/61.png
new file mode 100644
index 0000000..a7fd173
--- /dev/null
+++ b/image/61.png
Binary files differ
diff --git a/image/62.png b/image/62.png
new file mode 100644
index 0000000..064094c
--- /dev/null
+++ b/image/62.png
Binary files differ
diff --git a/image/arrow-bottom_01.png b/image/arrow-bottom_01.png
new file mode 100644
index 0000000..d492a94
--- /dev/null
+++ b/image/arrow-bottom_01.png
Binary files differ
diff --git a/image/arrow-bottom_02.png b/image/arrow-bottom_02.png
new file mode 100644
index 0000000..7051b6e
--- /dev/null
+++ b/image/arrow-bottom_02.png
Binary files differ
diff --git a/image/arrow-top_01.png b/image/arrow-top_01.png
new file mode 100644
index 0000000..6309396
--- /dev/null
+++ b/image/arrow-top_01.png
Binary files differ
diff --git a/image/arrow-top_02.png b/image/arrow-top_02.png
new file mode 100644
index 0000000..71b792f
--- /dev/null
+++ b/image/arrow-top_02.png
Binary files differ
diff --git a/image/avatar.jpg b/image/avatar.jpg
new file mode 100644
index 0000000..b6e12b1
--- /dev/null
+++ b/image/avatar.jpg
Binary files differ
diff --git a/image/bg.png b/image/bg.png
new file mode 100644
index 0000000..37610d5
--- /dev/null
+++ b/image/bg.png
Binary files differ
diff --git a/image/card-bg.png b/image/card-bg.png
new file mode 100644
index 0000000..1f63b85
--- /dev/null
+++ b/image/card-bg.png
Binary files differ
diff --git a/image/card1.png b/image/card1.png
new file mode 100644
index 0000000..b7ffb02
--- /dev/null
+++ b/image/card1.png
Binary files differ
diff --git a/image/card2.png b/image/card2.png
new file mode 100644
index 0000000..bbf8412
--- /dev/null
+++ b/image/card2.png
Binary files differ
diff --git a/image/card3.png b/image/card3.png
new file mode 100644
index 0000000..134e2dc
--- /dev/null
+++ b/image/card3.png
Binary files differ
diff --git a/image/cart.png b/image/cart.png
new file mode 100644
index 0000000..7aea1b5
--- /dev/null
+++ b/image/cart.png
Binary files differ
diff --git a/image/cart_grey.png b/image/cart_grey.png
new file mode 100644
index 0000000..53f2c78
--- /dev/null
+++ b/image/cart_grey.png
Binary files differ
diff --git a/image/consult.png b/image/consult.png
new file mode 100644
index 0000000..f4311d4
--- /dev/null
+++ b/image/consult.png
Binary files differ
diff --git a/image/fail.png b/image/fail.png
new file mode 100644
index 0000000..2c4454f
--- /dev/null
+++ b/image/fail.png
Binary files differ
diff --git a/image/fh.png b/image/fh.png
new file mode 100644
index 0000000..915db4a
--- /dev/null
+++ b/image/fh.png
Binary files differ
diff --git a/image/goIndex.png b/image/goIndex.png
new file mode 100644
index 0000000..d4b7be5
--- /dev/null
+++ b/image/goIndex.png
Binary files differ
diff --git a/image/gwc.png b/image/gwc.png
new file mode 100644
index 0000000..ab7cc5d
--- /dev/null
+++ b/image/gwc.png
Binary files differ
diff --git a/image/head-bg.png b/image/head-bg.png
new file mode 100644
index 0000000..0d8a451
--- /dev/null
+++ b/image/head-bg.png
Binary files differ
diff --git a/image/head-bg2.png b/image/head-bg2.png
new file mode 100644
index 0000000..8c97aff
--- /dev/null
+++ b/image/head-bg2.png
Binary files differ
diff --git a/image/head.png b/image/head.png
new file mode 100644
index 0000000..b652d78
--- /dev/null
+++ b/image/head.png
Binary files differ
diff --git a/image/home.png b/image/home.png
new file mode 100644
index 0000000..611556d
--- /dev/null
+++ b/image/home.png
Binary files differ
diff --git a/image/home_active.png b/image/home_active.png
new file mode 100644
index 0000000..90d1f51
--- /dev/null
+++ b/image/home_active.png
Binary files differ
diff --git a/image/icon_cj.png b/image/icon_cj.png
new file mode 100644
index 0000000..34d1010
--- /dev/null
+++ b/image/icon_cj.png
Binary files differ
diff --git a/image/icon_share.png b/image/icon_share.png
new file mode 100644
index 0000000..b621ae7
--- /dev/null
+++ b/image/icon_share.png
Binary files differ
diff --git a/image/icon_zp.png b/image/icon_zp.png
new file mode 100644
index 0000000..43855fd
--- /dev/null
+++ b/image/icon_zp.png
Binary files differ
diff --git a/image/jia.png b/image/jia.png
new file mode 100644
index 0000000..805129a
--- /dev/null
+++ b/image/jia.png
Binary files differ
diff --git a/image/jian.png b/image/jian.png
new file mode 100644
index 0000000..2ef0a52
--- /dev/null
+++ b/image/jian.png
Binary files differ
diff --git a/image/logo.png b/image/logo.png
new file mode 100644
index 0000000..66b519d
--- /dev/null
+++ b/image/logo.png
Binary files differ
diff --git a/image/nocoupon.png b/image/nocoupon.png
new file mode 100644
index 0000000..83b4665
--- /dev/null
+++ b/image/nocoupon.png
Binary files differ
diff --git a/image/pocon.png b/image/pocon.png
new file mode 100644
index 0000000..c4dd3c3
--- /dev/null
+++ b/image/pocon.png
Binary files differ
diff --git a/image/qb.png b/image/qb.png
new file mode 100644
index 0000000..f0ea3f3
--- /dev/null
+++ b/image/qb.png
Binary files differ
diff --git a/image/share.png b/image/share.png
new file mode 100644
index 0000000..133fd2e
--- /dev/null
+++ b/image/share.png
Binary files differ
diff --git a/image/shopping.png b/image/shopping.png
new file mode 100644
index 0000000..990c136
--- /dev/null
+++ b/image/shopping.png
Binary files differ
diff --git a/image/shopping_active.png b/image/shopping_active.png
new file mode 100644
index 0000000..5f7a77b
--- /dev/null
+++ b/image/shopping_active.png
Binary files differ
diff --git a/image/spa.png b/image/spa.png
new file mode 100644
index 0000000..38f15d6
--- /dev/null
+++ b/image/spa.png
Binary files differ
diff --git a/image/spa_active.png b/image/spa_active.png
new file mode 100644
index 0000000..a15fb55
--- /dev/null
+++ b/image/spa_active.png
Binary files differ
diff --git a/image/star1.png b/image/star1.png
new file mode 100644
index 0000000..7b53aed
--- /dev/null
+++ b/image/star1.png
Binary files differ
diff --git a/image/star2.png b/image/star2.png
new file mode 100644
index 0000000..9daf7c0
--- /dev/null
+++ b/image/star2.png
Binary files differ
diff --git a/image/tc.png b/image/tc.png
new file mode 100644
index 0000000..deb4117
--- /dev/null
+++ b/image/tc.png
Binary files differ
diff --git a/image/time.png b/image/time.png
new file mode 100644
index 0000000..185c14d
--- /dev/null
+++ b/image/time.png
Binary files differ
diff --git a/image/time_active.png b/image/time_active.png
new file mode 100644
index 0000000..897be8a
--- /dev/null
+++ b/image/time_active.png
Binary files differ
diff --git a/image/tp.png b/image/tp.png
new file mode 100644
index 0000000..e8f39b0
--- /dev/null
+++ b/image/tp.png
Binary files differ
diff --git a/image/type.png b/image/type.png
new file mode 100644
index 0000000..c8ce43e
--- /dev/null
+++ b/image/type.png
Binary files differ
diff --git a/image/type_active.png b/image/type_active.png
new file mode 100644
index 0000000..dc10b38
--- /dev/null
+++ b/image/type_active.png
Binary files differ
diff --git a/image/user.png b/image/user.png
new file mode 100644
index 0000000..472bc70
--- /dev/null
+++ b/image/user.png
Binary files differ
diff --git a/image/user_active.png b/image/user_active.png
new file mode 100644
index 0000000..69496b9
--- /dev/null
+++ b/image/user_active.png
Binary files differ
diff --git a/image/w-bg.png b/image/w-bg.png
new file mode 100644
index 0000000..e01801f
--- /dev/null
+++ b/image/w-bg.png
Binary files differ
diff --git a/image/wx.png b/image/wx.png
new file mode 100644
index 0000000..fe90ac8
--- /dev/null
+++ b/image/wx.png
Binary files differ
diff --git a/image/zwjl1.png b/image/zwjl1.png
new file mode 100644
index 0000000..883dea0
--- /dev/null
+++ b/image/zwjl1.png
Binary files differ
diff --git a/models/address.js b/models/address.js
new file mode 100644
index 0000000..357d06d
--- /dev/null
+++ b/models/address.js
@@ -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
+}
diff --git a/models/swiper.js b/models/swiper.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/models/swiper.js
diff --git a/pages/ads/showAdPage.js b/pages/ads/showAdPage.js
new file mode 100644
index 0000000..a48334b
--- /dev/null
+++ b/pages/ads/showAdPage.js
@@ -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) {
+
+ },
+
+
+
+})
\ No newline at end of file
diff --git a/pages/ads/showAdPage.json b/pages/ads/showAdPage.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/ads/showAdPage.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/ads/showAdPage.wxml b/pages/ads/showAdPage.wxml
new file mode 100644
index 0000000..3b69740
--- /dev/null
+++ b/pages/ads/showAdPage.wxml
@@ -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>
+
\ No newline at end of file
diff --git a/pages/ads/showAdPage.wxss b/pages/ads/showAdPage.wxss
new file mode 100644
index 0000000..455792c
--- /dev/null
+++ b/pages/ads/showAdPage.wxss
@@ -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;
+}
diff --git a/pages/applyRefund/applyRefund.js b/pages/applyRefund/applyRefund.js
new file mode 100644
index 0000000..d6e9b5c
--- /dev/null
+++ b/pages/applyRefund/applyRefund.js
@@ -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
+ })
+ }
+
+
+ }
+})
\ No newline at end of file
diff --git a/pages/applyRefund/applyRefund.json b/pages/applyRefund/applyRefund.json
new file mode 100644
index 0000000..e7d5adb
--- /dev/null
+++ b/pages/applyRefund/applyRefund.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "申请退款"
+}
\ No newline at end of file
diff --git a/pages/applyRefund/applyRefund.wxml b/pages/applyRefund/applyRefund.wxml
new file mode 100644
index 0000000..095b637
--- /dev/null
+++ b/pages/applyRefund/applyRefund.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/applyRefund/applyRefund.wxss b/pages/applyRefund/applyRefund.wxss
new file mode 100644
index 0000000..1ca2109
--- /dev/null
+++ b/pages/applyRefund/applyRefund.wxss
@@ -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%}
\ No newline at end of file
diff --git a/pages/article/article.js b/pages/article/article.js
new file mode 100644
index 0000000..0cce4f2
--- /dev/null
+++ b/pages/article/article.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/article/article.json b/pages/article/article.json
new file mode 100644
index 0000000..416e333
--- /dev/null
+++ b/pages/article/article.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "",
+ "backgroundColor": "#ffffff",
+ "backgroundTextStyle": "light"
+}
\ No newline at end of file
diff --git a/pages/article/article.wxml b/pages/article/article.wxml
new file mode 100644
index 0000000..8dfbe1c
--- /dev/null
+++ b/pages/article/article.wxml
@@ -0,0 +1,2 @@
+
+ <rich-text class='pd-10' nodes="{{article.artContent}}" bindtap="tap"></rich-text>
\ No newline at end of file
diff --git a/pages/article/article.wxss b/pages/article/article.wxss
new file mode 100644
index 0000000..9b08884
--- /dev/null
+++ b/pages/article/article.wxss
@@ -0,0 +1,11 @@
+page{
+ background: #fff;
+}
+.rich_img{
+ max-width: 100%;
+ margin: 0px;
+}
+
+rich-text p{
+ padding: 5px;
+}
\ No newline at end of file
diff --git a/pages/checkRecord/recordInfo.js b/pages/checkRecord/recordInfo.js
new file mode 100644
index 0000000..510ae54
--- /dev/null
+++ b/pages/checkRecord/recordInfo.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/checkRecord/recordInfo.json b/pages/checkRecord/recordInfo.json
new file mode 100644
index 0000000..61848a5
--- /dev/null
+++ b/pages/checkRecord/recordInfo.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black",
+ "backgroundColor": "#ffffff",
+ "backgroundTextStyle": "light",
+ "navigationBarTitleText": "皮肤检测记录"
+}
\ No newline at end of file
diff --git a/pages/checkRecord/recordInfo.wxml b/pages/checkRecord/recordInfo.wxml
new file mode 100644
index 0000000..1ef5305
--- /dev/null
+++ b/pages/checkRecord/recordInfo.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/checkRecord/recordInfo.wxss b/pages/checkRecord/recordInfo.wxss
new file mode 100644
index 0000000..adbbc26
--- /dev/null
+++ b/pages/checkRecord/recordInfo.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/checkRecord/recordList.js b/pages/checkRecord/recordList.js
new file mode 100644
index 0000000..0a1a5c8
--- /dev/null
+++ b/pages/checkRecord/recordList.js
@@ -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() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/checkRecord/recordList.json b/pages/checkRecord/recordList.json
new file mode 100644
index 0000000..5370760
--- /dev/null
+++ b/pages/checkRecord/recordList.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "皮肤检测记录"
+}
\ No newline at end of file
diff --git a/pages/checkRecord/recordList.wxml b/pages/checkRecord/recordList.wxml
new file mode 100644
index 0000000..92671a0
--- /dev/null
+++ b/pages/checkRecord/recordList.wxml
@@ -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>
+
\ No newline at end of file
diff --git a/pages/checkRecord/recordList.wxss b/pages/checkRecord/recordList.wxss
new file mode 100644
index 0000000..914e2fa
--- /dev/null
+++ b/pages/checkRecord/recordList.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/customerCenter/customerCenter.js b/pages/customerCenter/customerCenter.js
new file mode 100644
index 0000000..89d993a
--- /dev/null
+++ b/pages/customerCenter/customerCenter.js
@@ -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',
+ })
+ },
+
+
+
+})
\ No newline at end of file
diff --git a/pages/customerCenter/customerCenter.json b/pages/customerCenter/customerCenter.json
new file mode 100644
index 0000000..9013290
--- /dev/null
+++ b/pages/customerCenter/customerCenter.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText":"个人中心",
+ "navigationBarBackgroundColor": "#00C085",
+ "backgroundTextStyle": "light",
+ "navigationBarTextStyle":"white"
+}
\ No newline at end of file
diff --git a/pages/customerCenter/customerCenter.wxml b/pages/customerCenter/customerCenter.wxml
new file mode 100644
index 0000000..6212f3c
--- /dev/null
+++ b/pages/customerCenter/customerCenter.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/customerCenter/customerCenter.wxss b/pages/customerCenter/customerCenter.wxss
new file mode 100644
index 0000000..1879f8f
--- /dev/null
+++ b/pages/customerCenter/customerCenter.wxss
@@ -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;
+
+}
+
diff --git a/pages/customerCoupons/customerCoupons.js b/pages/customerCoupons/customerCoupons.js
new file mode 100644
index 0000000..d253fc5
--- /dev/null
+++ b/pages/customerCoupons/customerCoupons.js
@@ -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',
+ });
+
+
+ },
+
+
+
+
+
+
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/customerCoupons/customerCoupons.json b/pages/customerCoupons/customerCoupons.json
new file mode 100644
index 0000000..08f4c91
--- /dev/null
+++ b/pages/customerCoupons/customerCoupons.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "我的优惠券"
+}
\ No newline at end of file
diff --git a/pages/customerCoupons/customerCoupons.wxml b/pages/customerCoupons/customerCoupons.wxml
new file mode 100644
index 0000000..6e493a9
--- /dev/null
+++ b/pages/customerCoupons/customerCoupons.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/customerCoupons/customerCoupons.wxss b/pages/customerCoupons/customerCoupons.wxss
new file mode 100644
index 0000000..5136caf
--- /dev/null
+++ b/pages/customerCoupons/customerCoupons.wxss
@@ -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
+}
\ No newline at end of file
diff --git a/pages/editAddress/editAddress.js b/pages/editAddress/editAddress.js
new file mode 100644
index 0000000..8da8351
--- /dev/null
+++ b/pages/editAddress/editAddress.js
@@ -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
+ });
+ }
+ },
+
+
+
+})
\ No newline at end of file
diff --git a/pages/editAddress/editAddress.json b/pages/editAddress/editAddress.json
new file mode 100644
index 0000000..1d7d662
--- /dev/null
+++ b/pages/editAddress/editAddress.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "管理收货地址"
+}
\ No newline at end of file
diff --git a/pages/editAddress/editAddress.wxml b/pages/editAddress/editAddress.wxml
new file mode 100644
index 0000000..84fe92e
--- /dev/null
+++ b/pages/editAddress/editAddress.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/editAddress/editAddress.wxss b/pages/editAddress/editAddress.wxss
new file mode 100644
index 0000000..ae5168e
--- /dev/null
+++ b/pages/editAddress/editAddress.wxss
@@ -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
+}
\ No newline at end of file
diff --git a/pages/enterShopcoupon/enterShopcoupon.js b/pages/enterShopcoupon/enterShopcoupon.js
new file mode 100644
index 0000000..846fee7
--- /dev/null
+++ b/pages/enterShopcoupon/enterShopcoupon.js
@@ -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
+ })
+ }
+ }
+ });
+
+ }
+})
\ No newline at end of file
diff --git a/pages/enterShopcoupon/enterShopcoupon.json b/pages/enterShopcoupon/enterShopcoupon.json
new file mode 100644
index 0000000..e86e110
--- /dev/null
+++ b/pages/enterShopcoupon/enterShopcoupon.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "优惠券",
+ "navigationBarBackgroundColor": "#E13121",
+ "backgroundTextStyle": "light",
+ "navigationBarTextStyle": "white"
+}
\ No newline at end of file
diff --git a/pages/enterShopcoupon/enterShopcoupon.wxml b/pages/enterShopcoupon/enterShopcoupon.wxml
new file mode 100644
index 0000000..b018a78
--- /dev/null
+++ b/pages/enterShopcoupon/enterShopcoupon.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/enterShopcoupon/enterShopcoupon.wxss b/pages/enterShopcoupon/enterShopcoupon.wxss
new file mode 100644
index 0000000..7916ff1
--- /dev/null
+++ b/pages/enterShopcoupon/enterShopcoupon.wxss
@@ -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;
+}
diff --git a/pages/groupbuy/allPt.js b/pages/groupbuy/allPt.js
new file mode 100644
index 0000000..a1cfc50
--- /dev/null
+++ b/pages/groupbuy/allPt.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/groupbuy/allPt.json b/pages/groupbuy/allPt.json
new file mode 100644
index 0000000..5a403c0
--- /dev/null
+++ b/pages/groupbuy/allPt.json
@@ -0,0 +1,7 @@
+{
+
+
+ "navigationBarTitleText": "所有拼团",
+ "backgroundColor": "#eeeeee",
+ "backgroundTextStyle": "light"
+}
\ No newline at end of file
diff --git a/pages/groupbuy/allPt.wxml b/pages/groupbuy/allPt.wxml
new file mode 100644
index 0000000..2953f5d
--- /dev/null
+++ b/pages/groupbuy/allPt.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/groupbuy/allPt.wxss b/pages/groupbuy/allPt.wxss
new file mode 100644
index 0000000..50461d1
--- /dev/null
+++ b/pages/groupbuy/allPt.wxss
@@ -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;
+}
diff --git a/pages/groupbuy/groupDetails.js b/pages/groupbuy/groupDetails.js
new file mode 100644
index 0000000..974b529
--- /dev/null
+++ b/pages/groupbuy/groupDetails.js
@@ -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()
+ },
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/groupbuy/groupDetails.json b/pages/groupbuy/groupDetails.json
new file mode 100644
index 0000000..b5778ad
--- /dev/null
+++ b/pages/groupbuy/groupDetails.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "商品详情"
+}
\ No newline at end of file
diff --git a/pages/groupbuy/groupDetails.wxml b/pages/groupbuy/groupDetails.wxml
new file mode 100644
index 0000000..5415a85
--- /dev/null
+++ b/pages/groupbuy/groupDetails.wxml
@@ -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>
diff --git a/pages/groupbuy/groupDetails.wxss b/pages/groupbuy/groupDetails.wxss
new file mode 100644
index 0000000..2c0ff2e
--- /dev/null
+++ b/pages/groupbuy/groupDetails.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/groupbuy/groupList.js b/pages/groupbuy/groupList.js
new file mode 100644
index 0000000..d3091da
--- /dev/null
+++ b/pages/groupbuy/groupList.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/groupbuy/groupList.json b/pages/groupbuy/groupList.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/groupbuy/groupList.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/groupbuy/groupList.wxml b/pages/groupbuy/groupList.wxml
new file mode 100644
index 0000000..5174e73
--- /dev/null
+++ b/pages/groupbuy/groupList.wxml
@@ -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>
+
diff --git a/pages/groupbuy/groupList.wxss b/pages/groupbuy/groupList.wxss
new file mode 100644
index 0000000..3e73b3e
--- /dev/null
+++ b/pages/groupbuy/groupList.wxss
@@ -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;
+
+}
+
+
diff --git a/pages/groupbuy/groupOrder.js b/pages/groupbuy/groupOrder.js
new file mode 100644
index 0000000..47a6000
--- /dev/null
+++ b/pages/groupbuy/groupOrder.js
@@ -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();
+ },
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/groupbuy/groupOrder.json b/pages/groupbuy/groupOrder.json
new file mode 100644
index 0000000..73b7bb4
--- /dev/null
+++ b/pages/groupbuy/groupOrder.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "订单详情"
+}
\ No newline at end of file
diff --git a/pages/groupbuy/groupOrder.wxml b/pages/groupbuy/groupOrder.wxml
new file mode 100644
index 0000000..2e28d70
--- /dev/null
+++ b/pages/groupbuy/groupOrder.wxml
@@ -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}}"> 添加收货地址</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>
\ No newline at end of file
diff --git a/pages/groupbuy/groupOrder.wxss b/pages/groupbuy/groupOrder.wxss
new file mode 100644
index 0000000..94e2405
--- /dev/null
+++ b/pages/groupbuy/groupOrder.wxss
@@ -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);
+}
diff --git a/pages/groupbuy/invited.js b/pages/groupbuy/invited.js
new file mode 100644
index 0000000..a995de3
--- /dev/null
+++ b/pages/groupbuy/invited.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/groupbuy/invited.json b/pages/groupbuy/invited.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/groupbuy/invited.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/groupbuy/invited.wxml b/pages/groupbuy/invited.wxml
new file mode 100644
index 0000000..2fcbea2
--- /dev/null
+++ b/pages/groupbuy/invited.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/groupbuy/invited.wxss b/pages/groupbuy/invited.wxss
new file mode 100644
index 0000000..ffa27d1
--- /dev/null
+++ b/pages/groupbuy/invited.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/index-back/index.js b/pages/index-back/index.js
new file mode 100644
index 0000000..a5e2daa
--- /dev/null
+++ b/pages/index-back/index.js
@@ -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,
+ })
+ }
+
+
+ },
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/index-back/index.json b/pages/index-back/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/index-back/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/index-back/index.wxml b/pages/index-back/index.wxml
new file mode 100644
index 0000000..2dc24cb
--- /dev/null
+++ b/pages/index-back/index.wxml
@@ -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>
+
diff --git a/pages/index-back/index.wxss b/pages/index-back/index.wxss
new file mode 100644
index 0000000..c3c9953
--- /dev/null
+++ b/pages/index-back/index.wxss
@@ -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%;
+}
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
new file mode 100644
index 0000000..46a9db6
--- /dev/null
+++ b/pages/index/index.js
@@ -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) {
+
+ },
+
+
+
+})
\ No newline at end of file
diff --git a/pages/index/index.json b/pages/index/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/index/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
new file mode 100644
index 0000000..fbcc559
--- /dev/null
+++ b/pages/index/index.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
new file mode 100644
index 0000000..3ce9173
--- /dev/null
+++ b/pages/index/index.wxss
@@ -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;
+}
diff --git a/pages/logistics/logistics.js b/pages/logistics/logistics.js
new file mode 100644
index 0000000..e6e4e75
--- /dev/null
+++ b/pages/logistics/logistics.js
@@ -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'
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/logistics/logistics.json b/pages/logistics/logistics.json
new file mode 100644
index 0000000..696e9f5
--- /dev/null
+++ b/pages/logistics/logistics.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "物流信息"
+}
\ No newline at end of file
diff --git a/pages/logistics/logistics.wxml b/pages/logistics/logistics.wxml
new file mode 100644
index 0000000..3167452
--- /dev/null
+++ b/pages/logistics/logistics.wxml
@@ -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'>【收货地址】 {{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>
\ No newline at end of file
diff --git a/pages/logistics/logistics.wxss b/pages/logistics/logistics.wxss
new file mode 100644
index 0000000..77a4b2c
--- /dev/null
+++ b/pages/logistics/logistics.wxss
@@ -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; }
diff --git a/pages/miaosha/msDetails.js b/pages/miaosha/msDetails.js
new file mode 100644
index 0000000..63436ea
--- /dev/null
+++ b/pages/miaosha/msDetails.js
@@ -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) {
+
+ }
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/miaosha/msDetails.json b/pages/miaosha/msDetails.json
new file mode 100644
index 0000000..b5778ad
--- /dev/null
+++ b/pages/miaosha/msDetails.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "商品详情"
+}
\ No newline at end of file
diff --git a/pages/miaosha/msDetails.wxml b/pages/miaosha/msDetails.wxml
new file mode 100644
index 0000000..e38c1c8
--- /dev/null
+++ b/pages/miaosha/msDetails.wxml
@@ -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>
diff --git a/pages/miaosha/msDetails.wxss b/pages/miaosha/msDetails.wxss
new file mode 100644
index 0000000..2c0ff2e
--- /dev/null
+++ b/pages/miaosha/msDetails.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/miaosha/msList.js b/pages/miaosha/msList.js
new file mode 100644
index 0000000..39af06f
--- /dev/null
+++ b/pages/miaosha/msList.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/miaosha/msList.json b/pages/miaosha/msList.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/miaosha/msList.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/miaosha/msList.wxml b/pages/miaosha/msList.wxml
new file mode 100644
index 0000000..5dc1e5b
--- /dev/null
+++ b/pages/miaosha/msList.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/miaosha/msList.wxss b/pages/miaosha/msList.wxss
new file mode 100644
index 0000000..905ab78
--- /dev/null
+++ b/pages/miaosha/msList.wxss
@@ -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;
+}
+
+
+
+
+
+
+
+
+
diff --git a/pages/miaosha/msOrder.js b/pages/miaosha/msOrder.js
new file mode 100644
index 0000000..5333e25
--- /dev/null
+++ b/pages/miaosha/msOrder.js
@@ -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();
+ },
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/miaosha/msOrder.json b/pages/miaosha/msOrder.json
new file mode 100644
index 0000000..73b7bb4
--- /dev/null
+++ b/pages/miaosha/msOrder.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "订单详情"
+}
\ No newline at end of file
diff --git a/pages/miaosha/msOrder.wxml b/pages/miaosha/msOrder.wxml
new file mode 100644
index 0000000..9d976ac
--- /dev/null
+++ b/pages/miaosha/msOrder.wxml
@@ -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}}"> 添加收货地址</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>
\ No newline at end of file
diff --git a/pages/miaosha/msOrder.wxss b/pages/miaosha/msOrder.wxss
new file mode 100644
index 0000000..94e2405
--- /dev/null
+++ b/pages/miaosha/msOrder.wxss
@@ -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);
+}
diff --git a/pages/order/order.js b/pages/order/order.js
new file mode 100644
index 0000000..f1ecb57
--- /dev/null
+++ b/pages/order/order.js
@@ -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,
+ })
+ }
+
+
+
+})
diff --git a/pages/order/order.json b/pages/order/order.json
new file mode 100644
index 0000000..aa73fde
--- /dev/null
+++ b/pages/order/order.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "我的订单",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/order/order.wxml b/pages/order/order.wxml
new file mode 100644
index 0000000..a4952ea
--- /dev/null
+++ b/pages/order/order.wxml
@@ -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>
diff --git a/pages/order/order.wxss b/pages/order/order.wxss
new file mode 100644
index 0000000..bf84ff9
--- /dev/null
+++ b/pages/order/order.wxss
@@ -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}
\ No newline at end of file
diff --git a/pages/orderDetails/orderDetails.js b/pages/orderDetails/orderDetails.js
new file mode 100644
index 0000000..20458c9
--- /dev/null
+++ b/pages/orderDetails/orderDetails.js
@@ -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'
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/orderDetails/orderDetails.json b/pages/orderDetails/orderDetails.json
new file mode 100644
index 0000000..73b7bb4
--- /dev/null
+++ b/pages/orderDetails/orderDetails.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "订单详情"
+}
\ No newline at end of file
diff --git a/pages/orderDetails/orderDetails.wxml b/pages/orderDetails/orderDetails.wxml
new file mode 100644
index 0000000..e759cde
--- /dev/null
+++ b/pages/orderDetails/orderDetails.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/orderDetails/orderDetails.wxss b/pages/orderDetails/orderDetails.wxss
new file mode 100644
index 0000000..2dc9537
--- /dev/null
+++ b/pages/orderDetails/orderDetails.wxss
@@ -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;
+
+}
\ No newline at end of file
diff --git a/pages/payOrder/payError.js b/pages/payOrder/payError.js
new file mode 100644
index 0000000..2e2796c
--- /dev/null
+++ b/pages/payOrder/payError.js
@@ -0,0 +1,3 @@
+Page({
+
+})
\ No newline at end of file
diff --git a/pages/payOrder/payError.json b/pages/payOrder/payError.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/pages/payOrder/payError.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/pages/payOrder/payError.wxml b/pages/payOrder/payError.wxml
new file mode 100644
index 0000000..a8c57a0
--- /dev/null
+++ b/pages/payOrder/payError.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/payOrder/payError.wxss b/pages/payOrder/payError.wxss
new file mode 100644
index 0000000..9e7f6f4
--- /dev/null
+++ b/pages/payOrder/payError.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/payOrder/payOrder.js b/pages/payOrder/payOrder.js
new file mode 100644
index 0000000..0ec8879
--- /dev/null
+++ b/pages/payOrder/payOrder.js
@@ -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;
+ }
+ }
+
+})
\ No newline at end of file
diff --git a/pages/payOrder/payOrder.json b/pages/payOrder/payOrder.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/payOrder/payOrder.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/payOrder/payOrder.wxml b/pages/payOrder/payOrder.wxml
new file mode 100644
index 0000000..c57bb2c
--- /dev/null
+++ b/pages/payOrder/payOrder.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/payOrder/payOrder.wxss b/pages/payOrder/payOrder.wxss
new file mode 100644
index 0000000..600621f
--- /dev/null
+++ b/pages/payOrder/payOrder.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/payOrder/paySuccess.js b/pages/payOrder/paySuccess.js
new file mode 100644
index 0000000..43f540c
--- /dev/null
+++ b/pages/payOrder/paySuccess.js
@@ -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',
+ })
+ }
+
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/pages/payOrder/paySuccess.json b/pages/payOrder/paySuccess.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/pages/payOrder/paySuccess.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/pages/payOrder/paySuccess.wxml b/pages/payOrder/paySuccess.wxml
new file mode 100644
index 0000000..0a269e8
--- /dev/null
+++ b/pages/payOrder/paySuccess.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/payOrder/paySuccess.wxss b/pages/payOrder/paySuccess.wxss
new file mode 100644
index 0000000..f39a2f7
--- /dev/null
+++ b/pages/payOrder/paySuccess.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/phone/phone.js b/pages/phone/phone.js
new file mode 100644
index 0000000..10ef7a9
--- /dev/null
+++ b/pages/phone/phone.js
@@ -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;
+ }
+ }
+ });
+
+
+ }
+
+
+
+})
\ No newline at end of file
diff --git a/pages/phone/phone.json b/pages/phone/phone.json
new file mode 100644
index 0000000..c1a8de9
--- /dev/null
+++ b/pages/phone/phone.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "绑定手机号"
+}
\ No newline at end of file
diff --git a/pages/phone/phone.wxml b/pages/phone/phone.wxml
new file mode 100644
index 0000000..8546497
--- /dev/null
+++ b/pages/phone/phone.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/phone/phone.wxss b/pages/phone/phone.wxss
new file mode 100644
index 0000000..59b8443
--- /dev/null
+++ b/pages/phone/phone.wxss
@@ -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;
+}
diff --git a/pages/productEvaluate/productEvaluate.js b/pages/productEvaluate/productEvaluate.js
new file mode 100644
index 0000000..9b0ff83
--- /dev/null
+++ b/pages/productEvaluate/productEvaluate.js
@@ -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
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/productEvaluate/productEvaluate.json b/pages/productEvaluate/productEvaluate.json
new file mode 100644
index 0000000..00c136b
--- /dev/null
+++ b/pages/productEvaluate/productEvaluate.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "产品评价",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/productEvaluate/productEvaluate.wxml b/pages/productEvaluate/productEvaluate.wxml
new file mode 100644
index 0000000..532d4c5
--- /dev/null
+++ b/pages/productEvaluate/productEvaluate.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/productEvaluate/productEvaluate.wxss b/pages/productEvaluate/productEvaluate.wxss
new file mode 100644
index 0000000..b6e4f9b
--- /dev/null
+++ b/pages/productEvaluate/productEvaluate.wxss
@@ -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}
\ No newline at end of file
diff --git a/pages/refund/refund.js b/pages/refund/refund.js
new file mode 100644
index 0000000..7d4486f
--- /dev/null
+++ b/pages/refund/refund.js
@@ -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
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/refund/refund.json b/pages/refund/refund.json
new file mode 100644
index 0000000..8ce6357
--- /dev/null
+++ b/pages/refund/refund.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "选择服务类型",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/refund/refund.wxml b/pages/refund/refund.wxml
new file mode 100644
index 0000000..7187520
--- /dev/null
+++ b/pages/refund/refund.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/refund/refund.wxss b/pages/refund/refund.wxss
new file mode 100644
index 0000000..6c0c2ae
--- /dev/null
+++ b/pages/refund/refund.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/refundOrder/refundOrder.js b/pages/refundOrder/refundOrder.js
new file mode 100644
index 0000000..002b517
--- /dev/null
+++ b/pages/refundOrder/refundOrder.js
@@ -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
+ })
+ }});
+ }
+})
\ No newline at end of file
diff --git a/pages/refundOrder/refundOrder.json b/pages/refundOrder/refundOrder.json
new file mode 100644
index 0000000..58c6879
--- /dev/null
+++ b/pages/refundOrder/refundOrder.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "退款订单",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/refundOrder/refundOrder.wxml b/pages/refundOrder/refundOrder.wxml
new file mode 100644
index 0000000..961a526
--- /dev/null
+++ b/pages/refundOrder/refundOrder.wxml
@@ -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>
diff --git a/pages/refundOrder/refundOrder.wxss b/pages/refundOrder/refundOrder.wxss
new file mode 100644
index 0000000..2bca08e
--- /dev/null
+++ b/pages/refundOrder/refundOrder.wxss
@@ -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
+}
\ No newline at end of file
diff --git a/pages/service/details.js b/pages/service/details.js
new file mode 100644
index 0000000..786ab76
--- /dev/null
+++ b/pages/service/details.js
@@ -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()
+ },
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+})
diff --git a/pages/service/details.json b/pages/service/details.json
new file mode 100644
index 0000000..b5778ad
--- /dev/null
+++ b/pages/service/details.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "商品详情"
+}
\ No newline at end of file
diff --git a/pages/service/details.wxml b/pages/service/details.wxml
new file mode 100644
index 0000000..51c8944
--- /dev/null
+++ b/pages/service/details.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/service/details.wxss b/pages/service/details.wxss
new file mode 100644
index 0000000..732a71f
--- /dev/null
+++ b/pages/service/details.wxss
@@ -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;}
\ No newline at end of file
diff --git a/pages/service/service.js b/pages/service/service.js
new file mode 100644
index 0000000..a2344b1
--- /dev/null
+++ b/pages/service/service.js
@@ -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
+ });
+ }
+ },
+
+})
\ No newline at end of file
diff --git a/pages/service/service.json b/pages/service/service.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/service/service.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/service/service.wxml b/pages/service/service.wxml
new file mode 100644
index 0000000..2faa08b
--- /dev/null
+++ b/pages/service/service.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/service/service.wxss b/pages/service/service.wxss
new file mode 100644
index 0000000..fa4a476
--- /dev/null
+++ b/pages/service/service.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/service/service2.js b/pages/service/service2.js
new file mode 100644
index 0000000..850fcca
--- /dev/null
+++ b/pages/service/service2.js
@@ -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) {
+
+ },
+
+
+})
\ No newline at end of file
diff --git a/pages/service/service2.json b/pages/service/service2.json
new file mode 100644
index 0000000..c275463
--- /dev/null
+++ b/pages/service/service2.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTitleText": "产品服务"
+
+}
\ No newline at end of file
diff --git a/pages/service/service2.wxml b/pages/service/service2.wxml
new file mode 100644
index 0000000..86db7e2
--- /dev/null
+++ b/pages/service/service2.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/service/service2.wxss b/pages/service/service2.wxss
new file mode 100644
index 0000000..a8020e4
--- /dev/null
+++ b/pages/service/service2.wxss
@@ -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;
+}
+
diff --git a/pages/service/shopOrder.js b/pages/service/shopOrder.js
new file mode 100644
index 0000000..a31d973
--- /dev/null
+++ b/pages/service/shopOrder.js
@@ -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();
+ },
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/service/shopOrder.json b/pages/service/shopOrder.json
new file mode 100644
index 0000000..73b7bb4
--- /dev/null
+++ b/pages/service/shopOrder.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "订单详情"
+}
\ No newline at end of file
diff --git a/pages/service/shopOrder.wxml b/pages/service/shopOrder.wxml
new file mode 100644
index 0000000..e52a3e5
--- /dev/null
+++ b/pages/service/shopOrder.wxml
@@ -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}}"> 添加收货地址</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>
+
diff --git a/pages/service/shopOrder.wxss b/pages/service/shopOrder.wxss
new file mode 100644
index 0000000..94e2405
--- /dev/null
+++ b/pages/service/shopOrder.wxss
@@ -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);
+}
diff --git a/pages/shalong/shalongDetail.js b/pages/shalong/shalongDetail.js
new file mode 100644
index 0000000..8e3425f
--- /dev/null
+++ b/pages/shalong/shalongDetail.js
@@ -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,
+ })
+ },
+
+
+
+})
diff --git a/pages/shalong/shalongDetail.json b/pages/shalong/shalongDetail.json
new file mode 100644
index 0000000..0fa791c
--- /dev/null
+++ b/pages/shalong/shalongDetail.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTitleText": "沙龙活动",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/shalong/shalongDetail.wxml b/pages/shalong/shalongDetail.wxml
new file mode 100644
index 0000000..b993ba2
--- /dev/null
+++ b/pages/shalong/shalongDetail.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/shalong/shalongDetail.wxss b/pages/shalong/shalongDetail.wxss
new file mode 100644
index 0000000..4af2685
--- /dev/null
+++ b/pages/shalong/shalongDetail.wxss
@@ -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;
+}
+
+
+
+
+
diff --git a/pages/shalong/shalongList.js b/pages/shalong/shalongList.js
new file mode 100644
index 0000000..c39eb75
--- /dev/null
+++ b/pages/shalong/shalongList.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/shalong/shalongList.json b/pages/shalong/shalongList.json
new file mode 100644
index 0000000..0fa791c
--- /dev/null
+++ b/pages/shalong/shalongList.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTitleText": "沙龙活动",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/shalong/shalongList.wxml b/pages/shalong/shalongList.wxml
new file mode 100644
index 0000000..ecacae9
--- /dev/null
+++ b/pages/shalong/shalongList.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/shalong/shalongList.wxss b/pages/shalong/shalongList.wxss
new file mode 100644
index 0000000..49ca36d
--- /dev/null
+++ b/pages/shalong/shalongList.wxss
@@ -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;
+
+}
\ No newline at end of file
diff --git a/pages/shopCar/shopCar.js b/pages/shopCar/shopCar.js
new file mode 100644
index 0000000..542baff
--- /dev/null
+++ b/pages/shopCar/shopCar.js
@@ -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
+ });
+ }
+ },
+
+
+})
\ No newline at end of file
diff --git a/pages/shopCar/shopCar.json b/pages/shopCar/shopCar.json
new file mode 100644
index 0000000..15a72ea
--- /dev/null
+++ b/pages/shopCar/shopCar.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "购物车"
+}
\ No newline at end of file
diff --git a/pages/shopCar/shopCar.wxml b/pages/shopCar/shopCar.wxml
new file mode 100644
index 0000000..fa07048
--- /dev/null
+++ b/pages/shopCar/shopCar.wxml
@@ -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>
\ No newline at end of file
diff --git a/pages/shopCar/shopCar.wxss b/pages/shopCar/shopCar.wxss
new file mode 100644
index 0000000..6f8f3fe
--- /dev/null
+++ b/pages/shopCar/shopCar.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/showAddress/showAddress.js b/pages/showAddress/showAddress.js
new file mode 100644
index 0000000..5a3d637
--- /dev/null
+++ b/pages/showAddress/showAddress.js
@@ -0,0 +1,188 @@
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+const app = getApp();
+Page({
+ data: {
+ region: ['', '', ''],
+ address: {},
+ checked: 2,
+ isChecked: false,
+ addressInfo: '',
+ addrLongitude: 0, // 纬度
+ addrLatitude: 0, // 经度
+ schoolList: [],
+ school: "", //配送点
+ schoolIndex: 0,
+ dormitory: "", //宿舍
+ addrRegion:"",
+ addrDetailaddr:"",
+ //附近是否存在学校
+ hasSchool: false,
+ firstLoad: 1, //第一次加载数据,需要渲染宿舍
+ },
+ onLoad: function(options) {
+ var _this = this;
+
+ if (options.id) {
+
+ this.setData({
+ requestUrl: api.address.editaddress
+ });
+ //请求地址信息
+ util.request({ api:api.address.showaddress + "/" + options.id,
+ callback: function(data) {
+
+ var address = data.rows[0];
+
+
+ _this.setData({
+ address: address,
+ dormitory: address.dormitory,
+ school: address.school,
+ addrLongitude: address.addrLongitude,
+ addrLatitude: address.addrLatitude,
+ addrRegion: address.addrRegion,
+ addrDetailaddr: address.addrDetailaddr,
+ });
+
+ if (address.addrDefault == 1) {
+ _this.setData({
+ isChecked: true,
+ checked: 1,
+ });
+ }
+
+
+
+
+ }});
+ }else{
+ this.setData({
+ requestUrl: api.address.newaddress
+ });
+ }
+
+
+
+ },
+
+
+
+
+
+ formSubmit(e) {
+ var _this = this;
+ var rules = {};
+ var data = e.detail.value;
+
+ data["school"] = this.data.school;
+
+ var id = e.currentTarget.dataset.addrid;
+
+ rules["addrLiaisonman"] = {
+ "rule": /\S/,
+ "errmsg": "请输入姓名"
+ };
+ rules["addrTelephone"] = {
+ "rule": "$tel"
+ };
+ rules["addrLatitude"] = {
+ "rule": /\S/,
+ "errmsg": "请选择你的所在地址"
+ };
+ rules["dormitory"] = {
+ "rule": /\S/,
+ "errmsg": "请输入您的门牌号"
+ }
+ var checked = this.data.checked;
+ //验证表单
+ if (util.validForm(data, rules)) {
+ util.request({
+ api:this.data.requestUrl,
+ data:data,
+ callback: function(data) {
+ console.log(data)
+ wx.navigateBack({
+ delta: 1
+ });
+ }});
+ }
+ },
+ checkedTap: function(e) {
+ var checked = parseInt(this.data.checked);
+ // console.log(typeof (checked))
+ console.log(checked)
+ var value = this.data.isChecked;
+ if (value) {
+ this.setData({
+ checked: 2,
+ isChecked: false,
+ })
+ } else {
+ this.setData({
+ checked: 1,
+ isChecked: true,
+ })
+ }
+ },
+ regionChange: function(e) {
+ this.setData({
+ region: e.detail.value
+ })
+ },
+
+
+
+ // 地址选择
+ mapView: function(e) {
+ var that = this;
+
+ // 地址详情
+ var addressInfo = {}
+
+ wx.chooseLocation({
+ success: function(res) {
+
+
+ addressInfo = {
+ "addrRegion": res.address,
+ "addrLongitude": res.longitude,
+ "addrLatitude": res.latitude
+ }
+
+ // 请求获取地址详情,拆分省市区和详细地址
+ util.request({api: '/wxapi/shopAddressAction/findAddrByLogAndLat',data: addressInfo, callback: function(data) {
+ that.setData({
+ //地区
+ addrRegion: data.rows[0].addrRegion,
+ addrDetailaddr: data.rows[0].addrDetailaddr+res.name,
+ //经纬度
+ addrLongitude: res.longitude,
+ addrLatitude: res.latitude,
+
+ school: "", //学校
+ schoolIndex: 0,
+ dormitoryIndex: 0,
+ });
+
+
+ }});
+
+
+
+
+
+ },
+ fail: function(error) {
+ // 如果未授权
+ if (error.errMsg == 'chooseLocation:fail auth deny' || error.errMsg == 'chooseLocation:fail:auth denied') {
+
+ app.checkAuthorize('scope.address')
+ }
+ },
+ complete: function() {
+ // complete
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/showAddress/showAddress.json b/pages/showAddress/showAddress.json
new file mode 100644
index 0000000..a9e6f9d
--- /dev/null
+++ b/pages/showAddress/showAddress.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "收货地址"
+}
\ No newline at end of file
diff --git a/pages/showAddress/showAddress.wxml b/pages/showAddress/showAddress.wxml
new file mode 100644
index 0000000..ba56b1e
--- /dev/null
+++ b/pages/showAddress/showAddress.wxml
@@ -0,0 +1,90 @@
+<view class="main">
+ <form bindsubmit="formSubmit">
+
+ <input name="addrLongitude" type='text' style="display:none" value='{{addrLongitude}}' />
+ <input name="addrLatitude" type='text' style="display:none" value='{{addrLatitude}}' />
+
+
+
+ <input name="addrId" type='text' style="display:none" value='{{address.addrId}}' />
+
+ <view class="address-container">
+ <view class="form-group width">
+ <view class="address-title">收货人</view>
+ <view class='address-right'>
+ <input name="addrLiaisonman" type='text' value='{{address.addrLiaisonman}}' />
+ </view>
+ </view>
+ <view class="form-group width">
+ <view class="address-title">手机号码</view>
+ <view class='address-right'>
+ <input name="addrTelephone" maxlength="11" type='number' value='{{address.addrTelephone}}' />
+ </view>
+ </view>
+ <view class="form-group" bindtap="mapView">
+ <view class="address-title">所在地区</view>
+ <view class='address-right'>
+ <input name="addrRegion" value="{{addrRegion}}" type='text' disabled/>
+ </view>
+ </view>
+ <view class="form-group" bindtap="mapView">
+ <view class="address-title">详细地址</view>
+ <view class='address-right'>
+ <input name="addrDetailaddr" value="{{addrDetailaddr}}" type='text' disabled/>
+ </view>
+ </view>
+ <view class="form-group" >
+ <view class="address-title">门牌号</view>
+ <view class='address-right'>
+ <input name="dormitory" placeholder="例: 5栋301室" value="{{dormitory}}" type='text' />
+ </view>
+ </view>
+
+
+ <view class="form-group width" wx:if="{{hasSchool}}">
+ <view class="address-title">最近配送点</view>
+ <view class='address-right'>
+ <picker bindchange="bindPickerChange" range-key="{{'typeName'}}" value="{{schoolIndex}}" range="{{schoolList}}">
+ <view class="picker">
+ {{schoolList[schoolIndex].typeName}}
+ </view>
+ </picker>
+ </view>
+ </view>
+
+
+ <!--
+ <view class="form-group width" wx:if="{{hasSchool}}">
+ <view class="address-title">宿舍</view>
+ <view class='address-right'>
+ <picker bindchange="dormitoryChange" range-key="{{'typeName'}}" value="{{dormitoryIndex}}" range="{{dormitoryList}}">
+ <view class="picker">
+ {{dormitoryList[dormitoryIndex].typeName}}
+ </view>
+ </picker>
+ </view>
+ </view>
+ -->
+
+ </view>
+ <view class="default-address">
+ <!-- <view bindtap="checkedTap"> -->
+ <view bindtap="checkedTap">
+ <radio checked='{{checked}}' color='#00c085' name="addrDefault" value="{{checked}}" checked="{{isChecked}}"></radio>
+ </view>
+ <view class='radio'>
+ <input type="text" class='radio-input iconfont icon-quan' name="addrDefault" value="{{checked}}" style="display:none" />
+ </view>
+ <text>设为默认地址</text>
+ </view>
+
+
+ <view class="form-group">
+ <input type='text' name="addrId" value="{{address.addrId}}" style="display:none" />
+ </view>
+ <view class="btn-area">
+ <button formType="submit">保存</button>
+ </view>
+
+ </form>
+</view>
\ No newline at end of file
diff --git a/pages/showAddress/showAddress.wxss b/pages/showAddress/showAddress.wxss
new file mode 100644
index 0000000..5f96c36
--- /dev/null
+++ b/pages/showAddress/showAddress.wxss
@@ -0,0 +1,119 @@
+@import '../../common/css/common.wxss';
+@import '../../icon/iconfont.wxss';
+
+.btn-area {
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ background: #ff5806;
+ color: #fff;
+ height: 106rpx;
+ line-height: 106rpx;
+ font-size: 28rpx
+}
+
+.button-hover {
+ background: #ff5806;
+ color: #fff;
+ font-size: 28rpx;
+ border: none
+}
+button {
+ background: #ff5806;
+ color: #fff;
+ font-size: 28rpx;
+ border: none;
+ line-height: 106rpx
+}
+
+.address-container {
+ background: #fff;
+ display: block;
+ border-radius: 10px;
+ width: 95%;
+ margin:20rpx auto;
+ padding: 20rpx 0;
+}
+
+.address-title {
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #333;
+ width: 25%;
+ padding-left: 30rpx;
+}
+
+.form-group {
+ display: flex;
+ align-items: center;
+ line-height: 80rpx;
+}
+
+
+input ,picker {
+ color: #666;
+ font-size: 26rpx;
+}
+
+
+.icon-youbian {
+ color: #cacaca;
+ margin-top: 2rpx;
+}
+
+checkbox .wx-checkbox-input {
+ border-radius: 50%;
+ width: 26rpx;
+ height: 26rpx;
+}
+
+/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked {
+ border: 1rpx solid #00c085;
+ background: #00c085;
+}
+
+/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
+
+checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
+ border-radius: 50%; /* 圆角 */
+ width: 40rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
+ height: 40rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
+ line-height: 40rpx;
+ text-align: center;
+ font-size: 26rpx; /* 对勾大小 30rpx */
+ color: #fff; /* 对勾颜色 白色 */
+ background: transparent;
+ transform: translate(-50%, -50%) scale(1);
+ -webkit-transform: translate(-50%, -50%) scale(1);
+}
+
+.default-address {
+ font-size: 24rpx;
+ color: #999;
+ margin-left: 37rpx;
+ margin-top: 19rpx;
+ display: flex;
+ align-items: center;
+}
+
+.default-address text {
+ margin-top: 2rpx;
+}
+
+
+
+.icon-gouxuan {
+ color: #00c085;
+ border: none;
+}
+
+.cart-pro-select {
+ margin-top: -8rpx;
+}
+
+radio {
+ transform: scale(0.8);
+}
+.address-right{width: 75%;text-align: right;margin-right: 30rpx}
\ No newline at end of file
diff --git a/pages/webView/webView.js b/pages/webView/webView.js
new file mode 100644
index 0000000..ec2d908
--- /dev/null
+++ b/pages/webView/webView.js
@@ -0,0 +1,68 @@
+// pages/webView/webView.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ url: options.url
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/webView/webView.json b/pages/webView/webView.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/webView/webView.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/webView/webView.wxml b/pages/webView/webView.wxml
new file mode 100644
index 0000000..029c6e5
--- /dev/null
+++ b/pages/webView/webView.wxml
@@ -0,0 +1,5 @@
+<view class="page-body">
+ <view class="page-section page-section-gap">
+ <web-view src="{{url}}"></web-view>
+ </view>
+</view>
diff --git a/pages/webView/webView.wxss b/pages/webView/webView.wxss
new file mode 100644
index 0000000..5b177b7
--- /dev/null
+++ b/pages/webView/webView.wxss
@@ -0,0 +1,4 @@
+.page-section-gap{
+ box-sizing: border-box;
+ padding: 0 30rpx;
+}
\ No newline at end of file
diff --git a/pages/welcome/welcome.js b/pages/welcome/welcome.js
new file mode 100644
index 0000000..31c2b56
--- /dev/null
+++ b/pages/welcome/welcome.js
@@ -0,0 +1,99 @@
+// pages/welcome/welcome.js
+var api = require('../../utils/service-api.js');
+var util = require('../../utils/util.js')
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ artId: '',
+ loadding: true,
+ jumpUrl: '',
+ },
+
+
+ onLoad: function(option) {
+ var _this = this
+
+ if (option.url != undefined) {
+ _this.setData({
+ jumpUrl: decodeURIComponent(option.url)
+ })
+ }
+ },
+
+ /**
+ * 用户授权登录
+ */
+ userAuthorization: function(options) {
+
+ var _this = this;
+ _this.setData({
+ loadding: false
+ })
+ if (options.detail.errMsg == 'getUserInfo:fail auth deny') {
+ wx.showToast({
+ title: "为了您能正常使用小程序,请先同意授权",
+ icon: "none"
+ });
+ _this.setData({
+ loadding: true
+ })
+ return;
+ }
+
+ var userInfo = options.detail.userInfo
+ //更新用戶信息
+ util.request({
+ api: "/wxapi/user/saveUserInfo",
+ checkLogin: true,
+ data: userInfo,
+ callback: function(data) {
+
+ getApp().userInfo = data.rows[0];
+ //跳转页面
+ _this.setData({
+ loadding: true
+
+ })
+ if (_this.data.jumpUrl == '' || _this.data.jumpUrl == undefined) {
+ wx.reLaunch({
+ url: '/pages/index/index'
+ })
+ } else if (_this.data.jumpUrl == 'back') {
+ //后退一页
+ wx.navigateBack({
+ delta: 1
+ })
+ } else {
+
+ wx.reLaunch({
+ url: _this.data.jumpUrl
+ })
+ }
+
+ }
+ });
+
+
+
+
+ },
+
+
+ agreement(e) {
+ wx.navigateTo({
+ url: '../shopType/shopType',
+ })
+ },
+
+ // 进入内容页面
+ intoContent() {
+ wx.navigateTo({
+ url: '/pages/article/article?id=12',
+ })
+ },
+})
\ No newline at end of file
diff --git a/pages/welcome/welcome.json b/pages/welcome/welcome.json
new file mode 100644
index 0000000..3476a85
--- /dev/null
+++ b/pages/welcome/welcome.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "授权"
+}
\ No newline at end of file
diff --git a/pages/welcome/welcome.wxml b/pages/welcome/welcome.wxml
new file mode 100644
index 0000000..796f324
--- /dev/null
+++ b/pages/welcome/welcome.wxml
@@ -0,0 +1,9 @@
+<loading hidden="{{loadding}}"></loading>
+<view class='welcome'>
+ <image src='https://filehive2.jyymatrix.cc/uploadeFile/bj1.png' mode="aspectFill"></image>
+ <button bindgetuserinfo="userAuthorization" open-type="getUserInfo" >微信用户一键登录</button>
+ <view class='agreement' bind:tap="agreement">
+ <text class='user-grey'>登录代表您已同意</text>
+ <text class='user-agree' bindtap="intoContent">用户协议、隐私协议</text>
+ </view>
+</view>
\ No newline at end of file
diff --git a/pages/welcome/welcome.wxss b/pages/welcome/welcome.wxss
new file mode 100644
index 0000000..845aae6
--- /dev/null
+++ b/pages/welcome/welcome.wxss
@@ -0,0 +1,36 @@
+/* pages/welcome/welcome.wxss */
+page{
+ height: 100%;
+}
+.welcome{
+ position: relative;
+ height: 100%;
+ width: 100%;
+}
+.welcome image{
+ width: 100%;height: 100%
+}
+button{
+ width: 100%;
+ background: #00C085;
+ color: #fff;
+}
+.agreement{
+ font-size:22rpx;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ position: absolute;
+ bottom: 33rpx;
+ white-space: nowrap;
+}
+.user-grey{color: #999}
+.user-agree{color:#00C085}
+.button-hover{
+ color: #fff;
+ background-color: #00C085;
+}
+button{width: 690rpx;margin: auto; border-radius: 10rpx;font-size: 34rpx;
+position: absolute;bottom: 191rpx; left: 50%;
+ transform: translate(-50%, -50%);
+ }
+button:after {border: 0px;}
diff --git a/pages/yuyue/chose.js b/pages/yuyue/chose.js
new file mode 100644
index 0000000..3d9cf38
--- /dev/null
+++ b/pages/yuyue/chose.js
@@ -0,0 +1,66 @@
+// pages/yuyue/chose.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/chose.json b/pages/yuyue/chose.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/chose.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/chose.wxml b/pages/yuyue/chose.wxml
new file mode 100644
index 0000000..65e02bc
--- /dev/null
+++ b/pages/yuyue/chose.wxml
@@ -0,0 +1,2 @@
+<!--pages/yuyue/chose.wxml-->
+<text>pages/yuyue/chose.wxml</text>
diff --git a/pages/yuyue/chose.wxss b/pages/yuyue/chose.wxss
new file mode 100644
index 0000000..2b14ff2
--- /dev/null
+++ b/pages/yuyue/chose.wxss
@@ -0,0 +1 @@
+/* pages/yuyue/chose.wxss */
\ No newline at end of file
diff --git a/pages/yuyue/choseMasseuse.js b/pages/yuyue/choseMasseuse.js
new file mode 100644
index 0000000..ebab248
--- /dev/null
+++ b/pages/yuyue/choseMasseuse.js
@@ -0,0 +1,100 @@
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ //员工列表
+ masseuse:[],
+ offset: 0,
+ limit: 10,
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+
+ var _this = this;
+
+ util.request({
+ data: {
+ bbeginTime: options.beginTime,
+ eendTime: options.endTime,
+ shopId:options.shopId,
+ id: -1
+ },
+ api: api.yuyue.getPaiBanBeauticianList,
+ callback: function (data) {
+ _this.setData({
+ masseuse: data.rows
+ })
+ }
+ });
+
+ },
+
+ chooseMasseuse:function(e){
+ var index = e.currentTarget.dataset.index;
+ //-1表示不选美疗师
+ if(index==-1){
+ wx.setStorageSync("masseuse", -1);
+ }else{
+ var masseuse = this.data.masseuse[index];
+ wx.setStorageSync("masseuse", masseuse);
+ }
+ wx.navigateBack();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/choseMasseuse.json b/pages/yuyue/choseMasseuse.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/choseMasseuse.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/choseMasseuse.wxml b/pages/yuyue/choseMasseuse.wxml
new file mode 100644
index 0000000..10ef429
--- /dev/null
+++ b/pages/yuyue/choseMasseuse.wxml
@@ -0,0 +1,32 @@
+<view class="s-wrap " bindtap="chooseMasseuse" data-index="-1" >
+
+ <view class="content-wrap1">
+ <view class="m-info1">
+ <text class="iconfont iconyonghu"></text>
+ <view class="title1">到店安排</view>
+ </view>
+ <view class="s-info1">
+ <text class="">不选择技师</text>
+ </view>
+ </view>
+</view>
+
+<scroll-view scroll-y>
+
+
+
+
+ <view class="service-wrap" wx:for="{{masseuse}}" bindtap="chooseMasseuse" data-index="{{index}}" >
+ <view class="inner-wrap">
+ <view class="content-wrap">
+ <image mode="aspectFit" src="{{item.suPhoto}}"></image>
+ <view class="m-info">
+ <view class="title">{{item.suName}}</view>
+ </view>
+ </view>
+ </view>
+ </view>
+
+
+
+</scroll-view>
\ No newline at end of file
diff --git a/pages/yuyue/choseMasseuse.wxss b/pages/yuyue/choseMasseuse.wxss
new file mode 100644
index 0000000..3a148f3
--- /dev/null
+++ b/pages/yuyue/choseMasseuse.wxss
@@ -0,0 +1,74 @@
+ .s-wrap{
+ margin:10px auto;
+ height: 50px;
+ width: 95%;
+ border-radius: 5px;
+ background: #fff;
+ overflow:hidden;
+ }
+ .content-wrap1{
+ margin: 10px;
+ height: 50px;
+ width: 100%;
+ position: relative;
+}
+.m-info1{
+ float: left;
+ width: 60%;
+ margin-left: 10px;
+ margin-top: 5px;
+}
+.m-info1 .iconfont{
+ float:left;
+ margin-right: 10px;
+ margin-top: 2px;
+
+}
+.s-info1{
+ float: right;
+ margin-top: 5px;
+ color: #aeaeae;
+ margin-right: 20px;
+ font-size: 12px;
+}
+.service-wrap{
+ margin: 0 auto;
+ width: 95%;
+ border-radius: 5px;
+ background: #fff;
+ overflow:hidden;
+}
+
+
+
+.inner-wrap{
+ border-bottom: 1px solid #efefef;
+ width: 95%;
+ height: 80px;
+}
+.content-wrap{
+ margin: 10px;
+ margin-top: 20px;
+ height: 80px;
+ width: 100%;
+ position: relative;
+}
+
+.content-wrap image{
+ width: 60px;
+ height: 60px;
+ float: left;
+ border-radius: 30px;
+}
+.m-info{
+ float: left;
+ width: 60%;
+ margin-left: 10px;
+ margin-top: 25px;
+}
+
+ .s-info{
+ float: right;
+ margin-top: 15px;
+ color: #aeaeae;
+}
\ No newline at end of file
diff --git a/pages/yuyue/choseService.js b/pages/yuyue/choseService.js
new file mode 100644
index 0000000..f8827c5
--- /dev/null
+++ b/pages/yuyue/choseService.js
@@ -0,0 +1,137 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ cates: [{ attrName: "全部", attrCode:""}],
+ serviceList:[],
+ cateIndex:0,
+ offset: 0,
+ limit:10,
+ },
+
+ /**
+ * 选中分类
+ */
+ chooseCate:function(e){
+ var index = e.currentTarget.dataset.index;
+ this.setData({
+ cateIndex:index,
+ serviceList: [],
+ offset: 0,
+ });
+ this.loadService();
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var _this=this;
+ //加载分类
+ util.request({
+ api: api.productAttribute.getByCode + app.shopInfo.id+"/service",
+ callback:function(data){
+ var cates = _this.data.cates.concat(data.rows);
+ _this.setData({
+ cates: cates
+ });
+ _this.loadService();
+ }
+ });
+ },
+
+ loadService:function(){
+
+ var _this = this;
+ var categoryId = _this.data.cates[_this.data.cateIndex].attrId;
+
+ var serviceList = _this.data.serviceList;
+
+ util.request({
+ api: api.goods.searchGoods,
+ data: { categoryId: categoryId, isService: 1, offset: _this.data.offset,limit:_this.data.limit},
+ callback:function(data){
+ for (var i = 0; i < data.rows.length; i++) {
+ serviceList.push(data.rows[i])
+ }
+ _this.setData({
+ serviceList: serviceList,
+ });
+ }
+ });
+ },
+
+ // 上拉加载
+ onReachBottom: function () {
+ var _this = this;
+ var offset = _this.data.offset;
+ var limit = _this.data.limit;
+ _this.setData({
+ offset: offset + limit
+ });
+ this.loadService();
+ },
+
+
+ chooseService:function(e){
+ var index=e.currentTarget.dataset.index;
+ var service =this.data.serviceList[index];
+ wx.setStorageSync('chooseService', service);
+ wx.navigateBack({
+ delta: 1,
+ });
+
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/choseService.json b/pages/yuyue/choseService.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/choseService.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/choseService.wxml b/pages/yuyue/choseService.wxml
new file mode 100644
index 0000000..77c80c6
--- /dev/null
+++ b/pages/yuyue/choseService.wxml
@@ -0,0 +1,34 @@
+<scroll-view class="top" scroll-x>
+
+
+ <block wx:for="{{cates}}" wx:key >
+ <view class="cate-item active" wx:if="{{index==cateIndex}}" >{{item.attrName}}</view>
+ <view class="cate-item " wx:if="{{index!=cateIndex}}" bindtap="chooseCate" data-index="{{index}}" >{{item.attrName}}</view>
+ </block>
+
+</scroll-view>
+
+
+<scroll-view scroll-y >
+
+ <view class="service-wrap" wx:for="{{serviceList}}" wx:key bindtap="chooseService"
+ data-index="{{index}}" >
+ <view class="inner-wrap">
+ <view class="content-wrap" >
+ <image mode="aspectFit" src="{{item.imgMobile}}"></image>
+ <view class="m-info" >
+ <view class="title">{{item.title}}</view>
+ <!-- <view class="price">¥{{item.price}}</view> -->
+ </view>
+ <view class="s-info">
+ <text class="s-time">约{{item.serviceTime}}分钟</text>
+ <text class="iconfont iconright"></text>
+ </view>
+ </view>
+ </view>
+ </view>
+
+
+
+
+</scroll-view>
\ No newline at end of file
diff --git a/pages/yuyue/choseService.wxss b/pages/yuyue/choseService.wxss
new file mode 100644
index 0000000..059608a
--- /dev/null
+++ b/pages/yuyue/choseService.wxss
@@ -0,0 +1,76 @@
+.top{
+ height: 50px;
+ position: fixed;
+ top:0px;
+ left: 0px;
+ width: 100%;
+ white-space: nowrap;
+ z-index: 999999;
+background: #f7f7f7;
+
+}
+.cate-item{
+ height: 30px;
+ overflow: hidden;
+ padding: 5px 10px;
+ color: #999;
+ display: inline-block;
+line-height: 40px;
+font-size: 14px;
+
+}
+
+.service-wrap{
+ margin: 0 auto;
+ width: 95%;
+ border-radius: 5px;
+ background: #fff;
+ overflow:hidden;
+}
+.service-wrap:first-of-type{
+ margin-top:50px;
+}
+
+
+.inner-wrap{
+ border-bottom: 1px solid #efefef;
+ width: 95%;
+ height: 60px;
+}
+.content-wrap{
+ margin: 10px;
+ margin-top: 20px;
+ height: 60px;
+ width: 100%;
+ position: relative;
+}
+
+.content-wrap image{
+ width: 40px;
+ height: 40px;
+ float: left;
+}
+.m-info{
+ float: left;
+ width: 60%;
+ margin-left: 10px;
+ margin-top: 28rpx;
+
+}
+
+.s-info{
+ float: right;
+ margin-top: 15px;
+ color: #aeaeae;
+}
+
+.s-time{
+ font-size:13px;
+}
+.active{
+ color: #00C085;
+ border-bottom: 1px solid #00C085;
+}
+.price{
+ font-size: 12px;
+}
\ No newline at end of file
diff --git a/pages/yuyue/choseShop.js b/pages/yuyue/choseShop.js
new file mode 100644
index 0000000..c2ad0a1
--- /dev/null
+++ b/pages/yuyue/choseShop.js
@@ -0,0 +1,116 @@
+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: {
+ shopList:[]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ shopList: app.shopList,
+ });
+
+ },
+
+
+ openLocation:function(e){
+ var index = e.currentTarget.dataset.index;
+ var latitude = Number(this.data.shopList[index].latitude);
+ var longitude = Number(this.data.shopList[index].longitude);
+ var name = this.data.shopList[index].shopName;
+ var address = this.data.shopList[index].shopAddr;
+
+ console.log(latitude);
+ wx.openLocation({
+ name: name,
+ address: address,
+ latitude: latitude,
+ longitude: longitude,
+ scale: 18
+ });
+
+ },
+
+ call:function(e){
+ var tel = e.currentTarget.dataset.tel;
+ wx.makePhoneCall({
+ phoneNumber: tel
+ })
+
+ },
+
+
+ chooseThis:function(e){
+ var index = e.currentTarget.dataset.index;
+ wx.navigateBack();
+ let currentShop=this.data.shopList[index];
+ if(currentShop.id!= app.shopInfo.id){
+
+ app.shopInfo=currentShop;
+
+ comReq.refreshUserCartCount();
+ }
+
+
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/choseShop.json b/pages/yuyue/choseShop.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/choseShop.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/choseShop.wxml b/pages/yuyue/choseShop.wxml
new file mode 100644
index 0000000..12311e4
--- /dev/null
+++ b/pages/yuyue/choseShop.wxml
@@ -0,0 +1,23 @@
+<view class="shopItem" wx:for="{{shopList}}" wx:key="key">
+
+ <view class="head" bindtap="chooseThis" data-index="{{index}}" >
+ <image mode="aspectFit" class="shopPhoto" src="{{item.shopImag}}"></image>
+ <view class="info">
+ <view class="shopName">{{item.shopName}}({{item.shopShortName}})</view>
+ <view class="adds">{{item.shopAddr}}</view>
+ <view class="adds">距离{{item.distance}}km</view>
+ </view>
+ </view>
+ <view class="footInfo">
+ <view class="tel">
+ <text class="iconfont icondianhua "></text>
+ <text bindtap="call" data-tel="{{item.shopTel}}" >{{item.shopTel}}</text>
+ </view>
+ <view class="addnav">
+ <text class="iconfont iconlocation "></text>
+ <text bindtap="openLocation" data-index="{{index}}" >导航去这里</text>
+ </view>
+ </view>
+
+</view>
+
\ No newline at end of file
diff --git a/pages/yuyue/choseShop.wxss b/pages/yuyue/choseShop.wxss
new file mode 100644
index 0000000..ff35a31
--- /dev/null
+++ b/pages/yuyue/choseShop.wxss
@@ -0,0 +1,62 @@
+.shopItem{
+ height: 120px;
+ margin-top: 10px;
+ background: #fff;
+ padding-left: 20px;
+}
+
+.head{
+ height: 80px;
+ border-bottom: 1px solid #efefef;
+ overflow: hidden;
+
+}
+
+.shopPhoto{
+ width: 40px;
+ height: 40px;
+ border-radius: 20px;
+ float: left;
+ margin-top: 20px;
+
+}
+
+.info{
+ margin-top: 15px;
+ margin-left: 20px;
+ float: left;
+
+}
+.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;
+}
\ No newline at end of file
diff --git a/pages/yuyue/khyuyue.js b/pages/yuyue/khyuyue.js
new file mode 100644
index 0000000..3d569ac
--- /dev/null
+++ b/pages/yuyue/khyuyue.js
@@ -0,0 +1,401 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ opentc: false,
+ shopInfo: {},
+ //day 0表示占位符,1可以预约,2已过期,3已选择
+ months: [],
+ weeks: [],
+ hours: [],
+ currentHoursIndex: 0,
+ //选中的日期
+ sellectDay: "",
+ preDay: "",
+ preTimeIndex: null,
+ isLogin: false,
+ hasChooseService: false,
+ service: {},
+ masseuse: {},
+ hasChooseMasseuse: false,
+ //不选美疗师
+ unneededMasseuse: true,
+ userInfo: {},
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ //
+ var _this = this;
+
+ this.setData({
+ shopInfo: app.shopInfo,
+ });
+
+ util.request({
+ api: api.yuyue.getTimeList,
+ callback: function(data) {
+ _this.setData({
+ months: data.rows,
+ userInfo: getApp().userInfo,
+ });
+ },
+
+ });
+
+ let timeStr = new Date().Format("yyyy-MM-dd");
+ this.setData({
+ sellectDay: timeStr
+ });
+ this.loadWeeks(timeStr);
+ },
+ onShow: function() {
+ console.log("onShow");
+ this.setData({
+ isLogin: getApp().isLogin
+ });
+ var _this = this;
+
+ var service = util.getOutStorage('chooseService')
+ if (util.isNotBlank(service)) {
+ _this.setData({
+ service: service,
+ hasChooseService: true,
+ });
+ }
+
+ this.setData({
+ shopInfo: app.shopInfo,
+ });
+
+ var masseuse = util.getOutStorage('masseuse');
+ if (util.isNotBlank(masseuse)) {
+ if (masseuse == -1) {
+ _this.setData({
+ unneededMasseuse: true,
+ hasChooseMasseuse: true,
+ masseuse: {},
+ });
+ } else {
+ _this.setData({
+ masseuse: masseuse,
+ hasChooseMasseuse: true,
+ unneededMasseuse: false,
+ });
+ }
+ }
+
+ },
+
+ loadWeeks: function(timeStr) {
+ var _this = this;
+ util.request({
+ api: api.yuyue.getYYDayAndWeek + "?time=" + timeStr,
+ callback: function(data) {
+ _this.setData({
+ weeks: data.rows,
+ hours: data.rows[0].hours,
+ });
+ },
+
+ });
+ },
+
+
+
+
+
+
+ //UI控制函数
+ chooseService: function() {
+ console.log(getApp().userInfo.phoneNumber);
+
+
+ if (util.isBlank(getApp().userInfo.nickName)) {
+ wx.navigateTo({
+ url: '/pages/welcome/welcome?url=/pages/yuyue/khyuyue',
+ })
+ } else if (getApp().userInfo.phoneNumber == null ||
+ getApp().userInfo.phoneNumber == "") {
+ wx.navigateTo({
+ url: '/pages/phone/phone?url=/pages/yuyue/khyuyue',
+ })
+ } else {
+ wx.navigateTo({
+ url: '/pages/yuyue/choseService',
+ })
+ }
+
+
+
+ },
+
+ closeTc: function() {
+ console.log("closeTc");
+ this.setData({
+ opentc: false,
+ });
+ },
+ openTc: function() {
+ console.log("openTc");
+ this.setData({
+ opentc: true,
+ });
+ },
+ //点击周选择
+ changeWeeks: function(e) {
+
+
+ //清空上次选中的时间
+ var hours = this.data.hours;
+ if (this.data.preTimeIndex != null) {
+ hours[this.data.preTimeIndex].status = 1;
+ hours[this.data.preTimeIndex].atlable = "";
+ hours[this.data.preTimeIndex + 1].status = 1;
+ }
+ this.setData({
+ hours: hours,
+ preTimeIndex: null,
+ });
+
+
+ //切换时间
+ var _this = this;
+ var index = e.currentTarget.dataset.index;
+ var weeks = this.data.weeks[index];
+
+ _this.setData({
+ currentHoursIndex: index,
+ hours: weeks.hours,
+ sellectDay: weeks.fullDay,
+ });
+
+
+ this.cleanSelectMasseuse();
+
+ },
+
+
+ //清空已经选中的美疗师
+ cleanSelectMasseuse: function() {
+ this.setData({
+ unneededMasseuse: false,
+ hasChooseMasseuse: false,
+ masseuse: {},
+
+ });
+ },
+
+
+ //点选技师
+ chooseMasseuse: function(e) {
+ var preTimeIndex = this.data.preTimeIndex;
+
+ if (util.isNotBlank(preTimeIndex)) {
+ var sellectDay = this.data.sellectDay;
+ var hours = this.data.hours;
+ var beginTime = sellectDay + " " + hours[preTimeIndex].hour;
+ var endTime = sellectDay + " " + hours[preTimeIndex + 1].hour;
+ var shopId = this.data.shopInfo.id;
+ wx.navigateTo({
+ url: '/pages/yuyue/choseMasseuse?shopId=' +
+ shopId + '&beginTime=' + beginTime + '&endTime=' + endTime
+ });
+ } else {
+ wx.showToast({
+ title: '请先选择预约时间',
+ icon: 'none',
+ })
+ return;
+ }
+ },
+ //点选时间
+ chooseTime: function(e) {
+
+
+ var index = e.currentTarget.dataset.index;
+
+
+
+ var hours = this.data.hours;
+
+ if (index == hours.length - 1) {
+ wx.showToast({
+ title: '该时间段不可选',
+ icon: 'none',
+ })
+ return;
+ }
+
+ if (this.data.preTimeIndex != null) {
+ hours[this.data.preTimeIndex].status = 1;
+ hours[this.data.preTimeIndex].atlable = "";
+ hours[this.data.preTimeIndex + 1].status = 1;
+ }
+
+ hours[index].status = 3;
+ hours[index].atlable = '到店';
+ hours[index + 1].status = 3;
+
+ this.setData({
+ hours: hours,
+ preTimeIndex: index
+ });
+
+ this.cleanSelectMasseuse();
+
+
+ },
+
+ //点击选中天数
+ chooseDay: function(e) {
+ var _this = this;
+ var day = e.currentTarget.dataset.day;
+ var monIndex = e.currentTarget.dataset.monindex;
+ var dayIndex = e.currentTarget.dataset.dayindex;
+ var dayNode = 'months[' + monIndex + '].dates[' + dayIndex + '].status'
+ var preDay = this.data.preDay;
+ console.log(dayNode);
+ if (preDay.length > 0) {
+ this.setData({
+ [dayNode]: 3,
+ preDay: dayNode,
+ [preDay]: 1,
+ currentHoursIndex: 0,
+ sellectDay: day,
+ })
+ } else {
+
+ //清空初始赋值
+ var month = this.data.months[0];
+ for (var i = 0; i < month.dates.length; i++) {
+ if (month.dates[i].status == 3) {
+ month.dates[i].status == 3
+ var initdayNode = 'months[0].dates[' + i + '].status'
+ this.setData({
+ [initdayNode]: 1,
+ })
+ }
+ }
+ //选中点击
+ this.setData({
+ [dayNode]: 3,
+ preDay: dayNode,
+ currentHoursIndex: 0,
+ sellectDay: day,
+ preTimeIndex: null,
+ })
+ }
+ this.loadWeeks(day);
+ this.closeTc();
+ this.cleanSelectMasseuse();
+ },
+
+ /**
+ * 选择技师
+ */
+
+
+ /**
+ * 下一步
+ */
+ continueYuyue: function() {
+ console.log("下一步");
+
+
+
+ if (!this.data.hasChooseService) {
+ wx.showToast({
+ title: '请选择服务',
+ icon: 'none',
+ })
+ return;
+ }
+
+ var preTimeIndex = this.data.preTimeIndex;
+ if (!util.isNotBlank(preTimeIndex)) {
+ wx.showToast({
+ title: '请先选择预约时间',
+ icon: 'none',
+ })
+ return;
+ }
+
+
+ var sellectDay = this.data.sellectDay;
+ var hours = this.data.hours;
+ var beginTime = sellectDay + " " + hours[preTimeIndex].hour;
+
+ var serviceOrder = {
+ shopInfo: this.data.shopInfo,
+ time: beginTime,
+ shopProduct: this.data.service,
+ };
+
+ if (!this.data.unneededMasseuse) {
+ serviceOrder['staffInfo'] = this.data.masseuse;
+ }
+ debugger
+ wx.setStorageSync("serviceOrder", serviceOrder);
+
+ wx.navigateTo({
+ url: '/pages/yuyue/yyInfo?model=0',
+ });
+ this.cleanSelectMasseuse();
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/khyuyue.json b/pages/yuyue/khyuyue.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/khyuyue.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/khyuyue.wxml b/pages/yuyue/khyuyue.wxml
new file mode 100644
index 0000000..d4affcd
--- /dev/null
+++ b/pages/yuyue/khyuyue.wxml
@@ -0,0 +1,105 @@
+<view class="itemBox ">
+ <navigator url="/pages/yuyue/choseShop">
+ <view class="iconfont icondianpu ic fl"></view>
+ <text class="shop fl">{{shopInfo.shopShortName}}</text>
+ <view class="iconfont iconright fr"></view>
+ <text class="info fr">{{shopInfo.shopTel}}</text>
+
+ </navigator>
+</view>
+
+<view class="weekDayBox flex-box ">
+ <view class="weekDay flex-item" wx:for="{{weeks}}" wx:key bindtap="changeWeeks" data-index="{{index}}" >
+ <text>{{item.week}}</text>
+ <text>{{item.day}}</text>
+ <view wx:if="{{currentHoursIndex==index}}" class="triangle-down"></view>
+ </view>
+
+ <view class="weekDay flex-item" bindtap="openTc">
+ <text class="iconfont iconrili"></text>
+ <text>更多</text>
+ </view>
+
+
+</view>
+
+<scroll-view class="timeBox" scroll-y="true">
+
+ <view class="hour" wx:for="{{hours}}" wx:key >
+ <view class="top active" wx:if="{{item.status==3}}" data-index="{{index}}" bindtap="chooseTime" >{{item.hour}}</view>
+ <view class="top over" wx:if="{{item.status==2}}" >{{item.hour}}</view>
+ <view class="top " wx:if="{{item.status==1}}" data-index="{{index}}" bindtap="chooseTime" >{{item.hour}}</view>
+ <view class="atlable" wx:if="{{item.atlable.length>0}}"> {{item.atlable}} </view>
+ </view>
+
+</scroll-view>
+
+
+<view class="itemBox" wx:if="{{isLogin && hasChooseService}}" bindtap="chooseService" >
+ <view class="iconfont iconxiangmu ic fl"></view>
+ <text class="shop fl">{{service.title}} </text>
+ <view class="iconfont iconright fr"></view>
+ <!--<text class="info fr">¥{{service.price}}</text>-->
+</view>
+
+<view class="itemBox" wx:if="{{isLogin && !hasChooseService}}" bindtap="chooseService" >
+ <view class="iconfont iconxiangmu ic fl"></view>
+ <text class="shop fl">选择服务</text>
+ <view class="iconfont iconright fr"></view>
+ <text class="info fr"></text>
+</view>
+
+
+<view class="itemBox " wx:if="{{isLogin}}" bindtap="chooseMasseuse" >
+
+ <view class="iconfont iconyonghu ic fl"></view>
+ <text class="shop fl" >选择技师</text>
+ <view class="iconfont iconright fr"></view>
+ <text class="info fr" wx:if="{{hasChooseMasseuse}}" >{{masseuse.suName}}</text>
+ <text class="info fr" wx:if="{{unneededMasseuse}}" >到店安排</text>
+</view>
+
+
+<view class=" bgbtn " bindtap="continueYuyue" wx:if="{{isLogin}}" >
+ 下一步
+</view>
+<navigator url="/pages/welcome/welcome?url=/pages/yuyue/khyuyue" class=" bgbtn " wx:if="{{!isLogin}}" >
+ 先登录后预约
+</navigator>
+
+
+<scroll-view scroll-y="true" style="" class="tc " wx:if="{{opentc}}">
+
+ <view class="tc-title">
+
+
+ <view class="tc-yytitle">请选择预约日期</view>
+ <view bindtap="closeTc" class="iconfont iconguanbi"></view>
+
+
+ <view class="tc-week">
+ <text>日</text>
+ <text>一</text>
+ <text>二</text>
+ <text>三</text>
+ <text>四</text>
+ <text>五</text>
+ <text>六</text>
+ </view>
+ </view>
+ <view class="tc-monthbox">
+ <block wx:for="{{months}}">
+ <view class="tc-month">{{item.year}}年{{item.month}}月</view>
+ <view class="tc-days">
+ <block wx:for="{{item.dates}}" wx:for-item="day" wx:for-index="dayIndex" >
+ <text class="tc-day tc-block" wx:if="{{day.status==0}}">{{day.day}}</text>
+ <text bindtap="chooseDay" data-node="{{day}}" data-day="{{item.year+'-'+item.month+'-'+day.day}}" data-monindex="{{index}}" data-dayindex="{{dayIndex}}" class="tc-day tc-use" wx:if="{{day.status==1}}">{{day.day}}</text>
+ <text class="tc-day tc-gq" wx:if="{{day.status==2}}">{{day.day}}</text>
+ <text class="tc-day tc-chose" wx:if="{{day.status==3}}">{{day.day}}</text>
+ </block>
+ </view>
+ </block>
+ </view>
+
+
+</scroll-view>
\ No newline at end of file
diff --git a/pages/yuyue/khyuyue.wxss b/pages/yuyue/khyuyue.wxss
new file mode 100644
index 0000000..3c4f24d
--- /dev/null
+++ b/pages/yuyue/khyuyue.wxss
@@ -0,0 +1,222 @@
+.itemBox {
+ width: 90%;
+ background-color: #fff;
+ border-radius: 10px;
+ height: 60px;
+ margin: 10px auto;
+ border: 1px solid #fff;
+}
+
+.itemBox .ic {
+ color: #aeaeae;
+ height: 30px;
+ width: 30px;
+ margin-top: 20px;
+ margin-left: 20px;
+}
+
+.iconright {
+ color: #aeaeae;
+ height: 30px;
+ width: 30px;
+ margin-top: 20px;
+ margin-right: 20px;
+ font-size: 20px;
+}
+
+.info {
+ color: #aeaeae;
+ height: 30px;
+ margin-right: 3px;
+ margin-top: 25px;
+ font-size: 13px;
+}
+
+.shop {
+ margin-top: 19px;
+ margin-left: 2px;
+ width: 40%;
+ overflow: hidden;
+ height: 40px;
+}
+
+.icon-youbian {
+ color: #909090;
+ margin-top: 20px;
+ margin-right: 10px;
+}
+
+.weekDay {
+ text-align: center;
+ color: #909090;
+ font-size: 12px;
+}
+
+.weekDay text {
+ display: block;
+}
+
+.weekDayBox {
+ width: 90%;
+ height: 45px;
+ margin: 10px auto;
+ margin-top: 20px;
+ display: flex;
+}
+
+.over {
+ background: #efefef;
+ color: #aeaeae;
+}
+
+.timeBox {
+ width: 80%;
+ background-color: #fff;
+ border-radius: 10px;
+ height: 280px;
+ margin: 10px auto;
+ border: 1px solid #fff;
+ padding: 20px 20px;
+ position: relative;
+ overflow: scroll;
+}
+
+.hour {
+ width: 20%;
+ height: 40px;
+ text-align: center;
+ line-height: 40px;
+ float: left;
+ position: relative;
+ font-size: 14px;
+}
+
+.atlable {
+ position: absolute;
+ top: 33px;
+ font-size: 10px;
+ text-align: center;
+ display: block;
+ width: 25px;
+ margin: 0 auto;
+ left: 30%;
+ background: #aeaeae;
+ height: 11px;
+ overflow: hidden;
+ color: #fff;
+ line-height: 12px;
+ padding: 1px 2px;
+ border-radius: 5px;
+}
+
+.active {
+ border-bottom: 1px solid #aeaeae;
+ color: #aeaeae;
+}
+
+.triangle-down {
+ height: 0;
+width: 0;
+overflow: hidden;
+font-size: 0;
+line-height: 0;
+border-color: transparent transparent #fff transparent;
+border-style: solid;
+border-width: 10px;
+top: 0px;
+position: relative;
+left: 23px;
+
+}
+
+/*弹出层*/
+
+.tc {
+ background: #fff;
+ width: 100%;
+ height: 100%;
+ top: 0px;
+ left: 0px;
+ position: fixed;
+}
+
+.tc-week {
+ width: 100%;
+ height: 40px;
+ background: #efefef;
+}
+
+.tc-week text {
+ width: 14.285%;
+ height: 40px;
+ text-align: center;
+ display: block;
+ float: left;
+ line-height: 40px;
+}
+
+.tc-month {
+ font-size: 12px;
+ float: right;
+ clear: both;
+ height: 40px;
+ line-height: 40px;
+ padding-right: 15px;
+}
+
+.tc-days {
+ clear: both;
+ overflow: hidden;
+}
+
+.tc-day {
+ width: 12%;
+ height: 40px;
+ text-align: center;
+ display: block;
+ float: left;
+ line-height: 40px;
+ border: 1px solid #efefef;
+ margin: 0.8%;
+}
+
+.tc-block {
+ visibility: hidden;
+}
+
+.tc-gq {
+ background: #efefef;
+ color: #aeaeae;
+}
+.tc-chose{
+ background: #9bc6f7;
+}
+
+.iconguanbi {
+ font-size: 20px;
+ text-align: right;
+ margin-bottom: 10px;
+ padding-right: 10px;
+}
+
+.tc-title {
+ position: fixed;
+ width: 100%;
+ height: 90px;
+ text-align: center;
+ line-height: 30px;
+ top: 0px;
+ left: 0px;
+ overflow: hidden;
+ background: #fff;
+}
+
+.tc-yytitle {
+ width: 90%;
+ height: 30px;
+ float: left;
+}
+
+.tc-monthbox {
+ margin-top: 50px;
+}
diff --git a/pages/yuyue/order.js b/pages/yuyue/order.js
new file mode 100644
index 0000000..e4c57ac
--- /dev/null
+++ b/pages/yuyue/order.js
@@ -0,0 +1,201 @@
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+
+Page({
+ data: {
+ currentIndex: 0,
+ orderList: [],
+ limit: 8,
+ offset: 0,
+ refresh: false,
+ orderShow: false,
+ // hiddenData:true
+ },
+ onUnload: function() {
+
+ },
+ 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: 0
+ })
+ this.getOrderInfo(index);
+ },
+
+ // 根据状态获取订单信息
+ getOrderInfo: function(index) {
+
+ var _this = this;
+ var limit = _this.data.limit;
+ var offset = _this.data.offset;
+ var status=index=="0"?"":index;
+ util.request({
+ api: api.yuyue.getServiceOrderList,
+ data: {
+ "limit": limit,
+ "status": status,
+ "offset": offset
+ },
+ callback: function(data) {
+ console.log("订单信息")
+ _this.setData({
+ orderList: data.rows,
+ currentIndex: status
+ });
+ var orderList = _this.data.orderList;
+ if (orderList.length == 0) {
+ _this.setData({
+ orderShow: true,
+ })
+ } else {
+ _this.setData({
+ orderShow: false
+ })
+ }
+ }
+
+ });
+
+ },
+
+
+
+
+ // 取消订单
+ 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({
+ api: api.yuyue.cancelOrderById,
+ data: { id: id},
+ callback: function (data) {
+ wx.showToast({
+ title: '取消成功',
+ success: function () {
+ debugger
+ _this.getOrderInfo(0);
+ }
+ })
+ }
+ });
+ }
+ }
+ });
+ },
+
+
+ // 删除订单
+ 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({
+ api: api.yuyue.removeOrderById+id,
+ callback:function(){
+ _this.getOrderInfo(0);
+ }
+ });
+ } else if (sm.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+
+
+ },
+
+
+ // 进入详情
+ 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 orderList = _this.data.orderList;
+ var index = _this.data.currentIndex;
+ var status = index == "0" ? "" : index;
+ _this.setData({
+ offset: offset
+ });
+ util.request({
+ api: api.yuyue.getServiceOrderList,
+ data: {
+ "limit": limit,
+ "status": status,
+ "offset": offset
+ },
+ callback: function(data) {
+ for (var i = 0; i < data.rows.length; i++) {
+ orderList.push(data.rows[i]);
+ }
+ _this.setData({
+ orderList: orderList
+ });
+
+ }
+ });
+
+
+ },
+
+
+
+
+
+})
\ No newline at end of file
diff --git a/pages/yuyue/order.json b/pages/yuyue/order.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/order.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/order.wxml b/pages/yuyue/order.wxml
new file mode 100644
index 0000000..52cab3b
--- /dev/null
+++ b/pages/yuyue/order.wxml
@@ -0,0 +1,61 @@
+<view class="order_container">
+
+ <view class='tabs_box'>
+
+ <view class="tabs_item {{currentIndex==0?'selected':''}}" bindtap='onTabsItemEvent' data-index="">
+ 全部
+ </view>
+ <view class="tabs_item {{currentIndex==1?'selected':''}}" bindtap='onTabsItemEvent' data-index="1">
+ 待服务
+ </view>
+ <view class="tabs_item {{currentIndex==2?'selected':''}}" bindtap='onTabsItemEvent' data-index="2">
+ 已完成
+ </view>
+ <view class="tabs_item {{currentIndex==3?'selected':''}}" bindtap='onTabsItemEvent' data-index="3">
+ 已取消
+ </view>
+
+ </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 class='explain'>{{item.dicMap.status}}</text>
+ </view>
+ <view class='order-middle'>
+ <image src='{{item.shopProduct.imgMobile}}' class='order-image' mode="aspectFit"></image>
+ <view class='order-info'>
+ <view class='name'>{{item.shopProduct.title}}</view>
+ <view class='grey norms'>{{item.shopInfo.shopName}} </view>
+ <view class="goods-group">
+ <!-- <view class='price'>¥{{item.shopProduct.price}}</view>-->
+ </view>
+ </view>
+ <text class='grey'></text>
+
+ <view class='order-bottom'>
+
+ <text class='cancel-order' wx:if="{{item.status == 1}}" data-index="{{index}}" data-id="{{item.id}}" capture-catch:touchstart='cancelOrder'>取消订单</text>
+ </view>
+ </view>
+
+
+ </view>
+ </view>
+
+
+</view>
+
+<view class="toTap" bind:tap="goTap" hidden='{{!floorstatus}}'>
+ <view class="iconfont icontop"></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>
\ No newline at end of file
diff --git a/pages/yuyue/order.wxss b/pages/yuyue/order.wxss
new file mode 100644
index 0000000..4991722
--- /dev/null
+++ b/pages/yuyue/order.wxss
@@ -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: 25%;
+}
+.selected {
+ color: #00c085;
+ font-size: 30rpx;
+ border-bottom: 2rpx 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: 10rpx 0 30rpx 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}
\ No newline at end of file
diff --git a/pages/yuyue/shopOrder.js b/pages/yuyue/shopOrder.js
new file mode 100644
index 0000000..82606ed
--- /dev/null
+++ b/pages/yuyue/shopOrder.js
@@ -0,0 +1,66 @@
+// pages/yuyue/shopOrder.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/shopOrder.json b/pages/yuyue/shopOrder.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/shopOrder.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/shopOrder.wxml b/pages/yuyue/shopOrder.wxml
new file mode 100644
index 0000000..5920900
--- /dev/null
+++ b/pages/yuyue/shopOrder.wxml
@@ -0,0 +1,2 @@
+<!--pages/yuyue/shopOrder.wxml-->
+<text>pages/yuyue/shopOrder.wxml</text>
diff --git a/pages/yuyue/shopOrder.wxss b/pages/yuyue/shopOrder.wxss
new file mode 100644
index 0000000..ab39fc8
--- /dev/null
+++ b/pages/yuyue/shopOrder.wxss
@@ -0,0 +1 @@
+/* pages/yuyue/shopOrder.wxss */
\ No newline at end of file
diff --git a/pages/yuyue/yuyue.wxml b/pages/yuyue/yuyue.wxml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pages/yuyue/yuyue.wxml
diff --git a/pages/yuyue/yyInfo.js b/pages/yuyue/yyInfo.js
new file mode 100644
index 0000000..cdd7de6
--- /dev/null
+++ b/pages/yuyue/yyInfo.js
@@ -0,0 +1,208 @@
+const app = getApp()
+var util = require('../../utils/util.js');
+var api = require('../../utils/service-api.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ model: 0,
+ userName: "",
+ tel: "",
+ accept:""
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ console.log(options);
+ var _this = this;
+ var serviceOrder = util.getOutStorage("serviceOrder");
+ if (options.model == 0) {
+ //新建订单场景
+ serviceOrder.vipName = app.userInfo.nickName;
+ serviceOrder.tel = app.userInfo.phoneNumber;
+ debugger
+ if (!serviceOrder.staffInfo) {
+ serviceOrder.staffInfo = {
+ staffName: "到店安排"
+ }
+ }
+ this.setData({
+ model: options.model,
+ serviceOrder: serviceOrder
+ })
+
+ } else if (options.model == 1 || options.model == 2 ) {
+ //查看已有订单
+ util.request({
+ api: api.yuyue.getServiceOrderById + options.id,
+ callback: function(data) {
+ serviceOrder = data.mapInfo.serviceOrder;
+ if (!util.isNotBlank(serviceOrder.staffInfo) ||
+ !util.isNotBlank(serviceOrder.staffInfo.staffName)) {
+ serviceOrder.staffInfo = {
+ staffName: "到店安排"
+ }
+ }
+ _this.setData({
+ model: options.model,
+ serviceOrder: serviceOrder
+ })
+ }
+ });
+ }
+
+
+ },
+
+ cancel: function() {
+ console.log("cancel");
+ var _this = this;
+ wx.showModal({
+ title: '提示',
+ content: '确定要取消吗?',
+ success: function(sm) {
+ if (sm.confirm) {
+ var id = _this.data.serviceOrder.id;
+ util.request({
+ api: api.yuyue.cancelOrderById,
+ data: { id: id },
+ callback: function(data) {
+ wx.showToast({
+ title: '取消成功',
+ success: function() {
+ wx.navigateBack({});
+ }
+ })
+ }
+ });
+ }
+ }
+ })
+
+ },
+
+
+ backKhyuyue: function() {
+ if (this.data.model == 0 || this.data.model == 1 ){
+ wx.switchTab({
+ url: '/pages/yuyue/khyuyue'
+ })
+ } else if (this.data.model == 2){
+ wx.navigateBack({
+
+ })
+ }
+
+ },
+
+ shouquan(){
+ var _this=this;
+ //TODO 去后台查询这个通知的id不要写死
+ wx.requestSubscribeMessage({
+ tmplIds: ['aNQKkJkNHZzUOwo2skrlfiw4qBZxkPgtNuPQ0dC5-DU'],
+ success(res) {
+ console.log("同意授权");
+ _this.setData({
+ "accept": 'aNQKkJkNHZzUOwo2skrlfiw4qBZxkPgtNuPQ0dC5-DU'
+ });
+ },
+ fail: function (res) {
+ console.log(res);
+ }
+ })
+
+ },
+
+
+
+ submitYuyue: function(e) {
+
+
+ var vipName = e.detail.value.vipName;
+ var tel = e.detail.value.tel;
+ var remark = e.detail.value.remark;
+ var orderService = this.data.serviceOrder;
+ var orderInfo = {
+ shopId: orderService.shopInfo.id,
+ staffId: orderService.staffInfo.suId,
+ productId: orderService.shopProduct.id,
+ vipName: vipName,
+ tel: tel,
+ remark: remark,
+ timeStr: orderService.time,
+ formId: this.data.accept
+ }
+ debugger
+
+ util.request({
+ api: api.yuyue.createServiceOrder,
+ data: orderInfo,
+ callback: function (data) {
+ var id = data.rows[0].id;
+ wx.redirectTo({
+ url: '/pages/yuyue/yySuccess?id=' + id,
+ })
+ }
+ });
+
+
+
+
+
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/yyInfo.json b/pages/yuyue/yyInfo.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/yyInfo.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/yyInfo.wxml b/pages/yuyue/yyInfo.wxml
new file mode 100644
index 0000000..f399473
--- /dev/null
+++ b/pages/yuyue/yyInfo.wxml
@@ -0,0 +1,74 @@
+<scroll-view scroll-y>
+
+ <view class="itemWrap" wx:if="{{model!=0}}">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >订单状态</text>
+ </view>
+ <view class="info">{{serviceOrder.dicMap.status}}</view>
+ <view class="info-s">订单编号:{{serviceOrder.orderNo}}</view>
+ </view>
+
+
+ <view class="itemWrap">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >门店地址</text>
+ </view>
+ <view class="info">{{serviceOrder.shopInfo.shopName}}</view>
+ <view class="info-s">{{serviceOrder.shopInfo.shopAddr}}</view>
+ </view>
+
+ <view class="itemWrap">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >预约到店时间</text>
+ </view>
+ <view class="info">{{serviceOrder.time}}</view>
+ <view class="info-s">服务时长约{{serviceOrder.shopProduct.serviceTime}}分钟</view>
+ </view>
+
+ <view class="itemWrap">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >服务和技师</text>
+ </view>
+ <view class="info">{{serviceOrder.shopProduct.title}}
+ <!-- <text class="price fr">¥{{serviceOrder.shopProduct.price}}</text> -->
+ </view>
+ <view class="info-s">{{serviceOrder.staffInfo.staffName}}</view>
+ </view>
+ <form bindsubmit="submitYuyue" >
+
+ <view class="itemWrap" wx:if="{{model==0}}">
+ <view class="lable">
+ <text class="iconfont icondianpu"></text>
+ <text >到店人</text>
+ </view>
+ <view class="forms" >
+
+ <input placeholder="请输入到店人名称" value="{{serviceOrder.vipName}}"name="vipName" ></input>
+ <input placeholder="请输入联系电话" value="{{serviceOrder.tel}}" name="tel" ></input>
+ <input placeholder="备注" value="{{serviceOrder.remark}}" name="remark" ></input>
+ <radio class="radio" bindtap="shouquan" wx:if="{{model==0}}" ><text>接收预约提醒</text></radio>
+ </view>
+ </view>
+
+
+
+
+
+<button class="bgbtn" formType="submit" wx:if="{{model==0}}" >
+ 确认预约
+</button>
+
+<view bindtap="backKhyuyue" class=" bgbtn " wx:if="{{model!=0 }}" >
+ 返回
+</view>
+
+</form>
+
+
+
+
+</scroll-view>
\ No newline at end of file
diff --git a/pages/yuyue/yyInfo.wxss b/pages/yuyue/yyInfo.wxss
new file mode 100644
index 0000000..dc35481
--- /dev/null
+++ b/pages/yuyue/yyInfo.wxss
@@ -0,0 +1,46 @@
+.itemWrap{
+ width: 90%;
+ margin: 20px auto;
+ overflow: hidden;
+}
+.iconfont{
+ margin-right:5px;
+}
+
+.lable{
+ color: #aeaeae;
+ font-size: 14px;
+
+
+}
+.info{
+ font-size: 16px;
+ margin: 15px 0px 5px 10px;
+
+}
+
+.info-s{
+ font-size: 12px;
+ margin-left: 10px;
+}
+
+.forms{
+ background: #fff;
+ border-radius: 5px;
+ height: 400rpx;
+ width: 100%;
+ margin-top: 20px;
+ padding: 15px
+}
+.forms input{
+ display: block;
+ width: 90%;
+ float: left;
+ height: 50px;
+ font-size:14px;
+ border-bottom: 1px solid #efefef;
+}
+
+.forms input:nth-child(3){
+ border-bottom:none;
+}
\ No newline at end of file
diff --git a/pages/yuyue/yySuccess.js b/pages/yuyue/yySuccess.js
new file mode 100644
index 0000000..77ab496
--- /dev/null
+++ b/pages/yuyue/yySuccess.js
@@ -0,0 +1,74 @@
+// pages/yuyue/yySuccess.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ this.setData({
+ id:options.id
+ });
+ },
+
+ withdraw:function(){
+ var id=this.data.id;
+ wx.redirectTo({ url: '/pages/yuyue/yyInfo?model=1&id=' + id,})
+
+
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/yuyue/yySuccess.json b/pages/yuyue/yySuccess.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/yuyue/yySuccess.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/yuyue/yySuccess.wxml b/pages/yuyue/yySuccess.wxml
new file mode 100644
index 0000000..fbfab81
--- /dev/null
+++ b/pages/yuyue/yySuccess.wxml
@@ -0,0 +1,9 @@
+<view class="main">
+ <view class='payStatus'>
+ <icon type="success" size="90" color='#00C085'/>
+ <view class="pay-success">预约成功</view>
+ </view>
+ <view>
+ <button class="bgbtn" bindtap='withdraw'>查看详情</button>
+ </view>
+</view>
\ No newline at end of file
diff --git a/pages/yuyue/yySuccess.wxss b/pages/yuyue/yySuccess.wxss
new file mode 100644
index 0000000..f39a2f7
--- /dev/null
+++ b/pages/yuyue/yySuccess.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
new file mode 100644
index 0000000..9d5fabf
--- /dev/null
+++ b/project.config.json
@@ -0,0 +1,224 @@
+{
+ "description": "项目配置文件。",
+ "packOptions": {
+ "ignore": []
+ },
+ "setting": {
+ "urlCheck": false,
+ "es6": true,
+ "enhance": true,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": true,
+ "coverView": true,
+ "nodeModules": false,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "useMultiFrameRuntime": false,
+ "useApiHook": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "enableEngineNative": false,
+ "useIsolateContext": true,
+ "useCompilerModule": true,
+ "userConfirmedUseCompilerModuleSwitch": false,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true,
+ "bundle": false
+ },
+ "compileType": "miniprogram",
+ "libVersion": "1.9.98",
+ "appid": "wx3836ab3c1490ff29",
+ "projectname": "%E8%82%BD%E7%A0%94",
+ "isGameTourist": false,
+ "simulatorType": "wechat",
+ "simulatorPluginLibVersion": {},
+ "condition": {
+ "search": {
+ "list": []
+ },
+ "conversation": {
+ "list": []
+ },
+ "plugin": {
+ "list": []
+ },
+ "game": {
+ "currentL": -1,
+ "list": []
+ },
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "id": -1,
+ "name": "pages/yuyue/yyInfo",
+ "pathName": "pages/yuyue/yyInfo",
+ "query": "model=1&id=10",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/customerCenter/customerCenter",
+ "pathName": "pages/customerCenter/customerCenter",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/yuyue/order",
+ "pathName": "pages/yuyue/order",
+ "query": "status=0",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/service/service",
+ "pathName": "pages/service/service",
+ "query": "status=0",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/logistics/logistics",
+ "pathName": "pages/logistics/logistics",
+ "query": "id=911",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/yuyue/choseShop",
+ "pathName": "pages/yuyue/choseShop",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/service/service2",
+ "pathName": "pages/service/service2",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/shopCar/shopCar",
+ "pathName": "pages/shopCar/shopCar",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 8,
+ "name": "pages/groupbuy/groupList",
+ "pathName": "pages/groupbuy/groupList",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 9,
+ "name": "groupDetails",
+ "pathName": "pages/groupbuy/groupDetails",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/miaosha/msList",
+ "pathName": "pages/miaosha/msList",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 11,
+ "name": "pages/groupbuy/groupDetails",
+ "pathName": "pages/groupbuy/groupDetails",
+ "query": "id=1&shopId=16&gjId=12",
+ "scene": null
+ },
+ {
+ "id": 12,
+ "name": "pages/groupbuy/groupDetails",
+ "pathName": "pages/groupbuy/groupDetails",
+ "query": "id=1&shopId=16&gjId=1",
+ "scene": null
+ },
+ {
+ "id": 13,
+ "name": "pages/groupbuy/groupDetails",
+ "pathName": "pages/groupbuy/groupDetails",
+ "query": "id=1&shopId=16&gjId=1",
+ "scene": null
+ },
+ {
+ "id": 14,
+ "name": "pages/groupbuy/groupDetails",
+ "pathName": "pages/groupbuy/groupDetails",
+ "query": "id=2&shopId=33&gjId=9",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/payOrder/paySuccess",
+ "pathName": "pages/payOrder/paySuccess",
+ "query": "showModel=1",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/miaosha/msList",
+ "pathName": "pages/miaosha/msList",
+ "query": "id=2&shopId=33&gjId=9",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/customerCenter/customerCenter",
+ "pathName": "pages/shalong/shalongList",
+ "query": "id=2&shopId=33&gjId=9",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/index/index",
+ "pathName": "pages/shalong/shalongList",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/groupbuy/groupDetails",
+ "pathName": "pages/groupbuy/groupDetails",
+ "query": "id=1&shopId=16&gjId=15",
+ "scene": null
+ },
+ {
+ "id": 20,
+ "name": "pages/ads/showAdPage",
+ "pathName": "pages/ads/showAdPage",
+ "query": "pageCode=index",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/shalong/shalongDetail",
+ "pathName": "pages/shalong/shalongDetail",
+ "query": "id=6",
+ "scene": null
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/sitemap.json b/sitemap.json
new file mode 100644
index 0000000..37c8c39
--- /dev/null
+++ b/sitemap.json
@@ -0,0 +1,9 @@
+{
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+ "rules": [
+ {
+ "action": "allow",
+ "page": "*"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/utils/Enum.js b/utils/Enum.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/utils/Enum.js
diff --git a/utils/bmap-wx.min.js b/utils/bmap-wx.min.js
new file mode 100644
index 0000000..2f4d563
--- /dev/null
+++ b/utils/bmap-wx.min.js
@@ -0,0 +1 @@
+"use strict";function _classCallCheck(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function t(t,a){for(var e=0;e<a.length;e++){var i=a[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(a,e,i){return e&&t(a.prototype,e),i&&t(a,i),a}}(),BMapWX=function(){function t(a){_classCallCheck(this,t),this.ak=a.ak}return _createClass(t,[{key:"getWXLocation",value:function(t,a,e,i){t=t||"gcj02",a=a||function(){},e=e||function(){},i=i||function(){},wx.getLocation({type:t,success:a,fail:e,complete:i})}},{key:"search",value:function(t){var a=this;t=t||{};var e={query:t.query||"生活服务$美食&酒店",scope:t.scope||1,filter:t.filter||"",coord_type:t.coord_type||2,page_size:t.page_size||10,page_num:t.page_num||0,output:t.output||"json",ak:a.ak,sn:t.sn||"",timestamp:t.timestamp||"",radius:t.radius||2e3,ret_coordtype:"gcj02ll"},i={iconPath:t.iconPath,iconTapPath:t.iconTapPath,width:t.width,height:t.height,alpha:t.alpha||1,success:t.success||function(){},fail:t.fail||function(){}},n="gcj02",o=function(t){e.location=t.latitude+","+t.longitude,wx.request({url:"https://api.map.baidu.com/place/v2/search",data:e,header:{"content-type":"application/json"},method:"GET",success:function(t){var a=t.data;if(0===a.status){var e=a.results,n={};n.originalData=a,n.wxMarkerData=[];for(var o=0;o<e.length;o++)n.wxMarkerData[o]={id:o,latitude:e[o].location.lat,longitude:e[o].location.lng,title:e[o].name,iconPath:i.iconPath,iconTapPath:i.iconTapPath,address:e[o].address,telephone:e[o].telephone,alpha:i.alpha,width:i.width,height:i.height};i.success(n)}else i.fail({errMsg:a.message,statusCode:a.status})},fail:function(t){i.fail(t)}})},s=function(t){i.fail(t)},c=function(){};if(t.location){var u=t.location.split(",")[1],r=t.location.split(",")[0],l="input location",p={errMsg:l,latitude:r,longitude:u};o(p)}else a.getWXLocation(n,o,s,c)}},{key:"suggestion",value:function(t){var a=this;t=t||{};var e={query:t.query||"",region:t.region||"全国",city_limit:t.city_limit||!1,output:t.output||"json",ak:a.ak,sn:t.sn||"",timestamp:t.timestamp||"",ret_coordtype:"gcj02ll"},i={success:t.success||function(){},fail:t.fail||function(){}};wx.request({url:"https://api.map.baidu.com/place/v2/suggestion",data:e,header:{"content-type":"application/json"},method:"GET",success:function(t){var a=t.data;0===a.status?i.success(a):i.fail({errMsg:a.message,statusCode:a.status})},fail:function(t){i.fail(t)}})}},{key:"regeocoding",value:function(t){var a=this;t=t||{};var e={coordtype:t.coordtype||"gcj02ll",pois:t.pois||0,output:t.output||"json",ak:a.ak,sn:t.sn||"",timestamp:t.timestamp||"",ret_coordtype:"gcj02ll"},i={iconPath:t.iconPath,iconTapPath:t.iconTapPath,width:t.width,height:t.height,alpha:t.alpha||1,success:t.success||function(){},fail:t.fail||function(){}},n="gcj02",o=function(t){e.location=t.latitude+","+t.longitude,wx.request({url:"https://api.map.baidu.com/geocoder/v2/",data:e,header:{"content-type":"application/json"},method:"GET",success:function(a){var e=a.data;if(0===e.status){var n=e.result,o={};o.originalData=e,o.wxMarkerData=[],o.wxMarkerData[0]={id:0,latitude:t.latitude,longitude:t.longitude,address:n.formatted_address,iconPath:i.iconPath,iconTapPath:i.iconTapPath,desc:n.sematic_description,business:n.business,alpha:i.alpha,width:i.width,height:i.height},i.success(o)}else i.fail({errMsg:e.message,statusCode:e.status})},fail:function(t){i.fail(t)}})},s=function(t){i.fail(t)},c=function(){};if(t.location){var u=t.location.split(",")[1],r=t.location.split(",")[0],l="input location",p={errMsg:l,latitude:r,longitude:u};o(p)}else a.getWXLocation(n,o,s,c)}},{key:"weather",value:function(t){var a=this;t=t||{};var e={coord_type:t.coord_type||"gcj02",output:t.output||"json",ak:a.ak,sn:t.sn||"",timestamp:t.timestamp||""},i={success:t.success||function(){},fail:t.fail||function(){}},n="gcj02",o=function(t){e.location=t.longitude+","+t.latitude,wx.request({url:"https://api.map.baidu.com/telematics/v3/weather",data:e,header:{"content-type":"application/json"},method:"GET",success:function(t){var a=t.data;if(0===a.error&&"success"===a.status){var e=a.results,n={};n.originalData=a,n.currentWeather=[],n.currentWeather[0]={currentCity:e[0].currentCity,pm25:e[0].pm25,date:e[0].weather_data[0].date,temperature:e[0].weather_data[0].temperature,weatherDesc:e[0].weather_data[0].weather,wind:e[0].weather_data[0].wind},i.success(n)}else i.fail({errMsg:a.message,statusCode:a.status})},fail:function(t){i.fail(t)}})},s=function(t){i.fail(t)},c=function(){};if(t.location){var u=t.location.split(",")[0],r=t.location.split(",")[1],l="input location",p={errMsg:l,latitude:r,longitude:u};o(p)}else a.getWXLocation(n,o,s,c)}}]),t}();module.exports.BMapWX=BMapWX;
\ No newline at end of file
diff --git a/utils/common-request.js b/utils/common-request.js
new file mode 100644
index 0000000..a237363
--- /dev/null
+++ b/utils/common-request.js
@@ -0,0 +1,87 @@
+/**
+ * 通用的与后台交互的请求操作
+ *
+ */
+const app=getApp();
+var api = require('service-api.js');
+var util = require('util.js');
+
+
+
+
+/**
+ * 领取优惠券
+ */
+function receiveCoupon(e) {
+ var couponId = e.currentTarget.dataset.couponId;
+ //获取用户信息
+ util.request({
+ method: "GET",
+ api: api.coupon.receiveCoupon + couponId,
+ callback: function (data) {
+ wx.showToast({
+ title: data.info,
+ icon: 'success',
+ duration: 2000
+ })
+ }
+ });
+}
+
+
+/**在购物车中加入产品 */
+function addShoppingCar(id, num, callBack) {
+
+ //查询产品,判断sku数量,加入购物车,动画,跳转产品页并打开sku选择页
+ let param = {
+ "cartSkuId": id,
+ "cartNumber": num,
+ "shopId":app.shopInfo.id,
+ };
+ //直接加入购物车
+ util.request({
+ method: "POST",
+ api: api.goods.saveShoppingCart, data: param,
+ callback: function (data) {
+ console.log("添加购物成功")
+ wx.setTabBarBadge({
+ index: 3,
+ text: data.mapInfo.userCartCount + "",
+ })
+ if (callBack) {
+ callBack(data.mapInfo.userCartCount);
+ }
+ }
+ });
+
+}
+
+//刷新购物车数量
+function refreshUserCartCount() {
+
+ util.request({
+ method: "POST",
+ data:{shopId:app.shopInfo.id},
+ api: api.goods.getUserCartCount+app.shopInfo.id,
+ callback: function (data) {
+ if (data.mapInfo.userCartCount != 0) {
+ wx.setTabBarBadge({
+ index: 3,
+ text: data.mapInfo.userCartCount + "",
+ })
+ } else {
+ wx.removeTabBarBadge({index: 3});
+ }
+
+ }
+ });
+}
+
+
+module.exports = {
+
+ receiveCoupon: receiveCoupon,
+ addShoppingCar: addShoppingCar,
+ refreshUserCartCount: refreshUserCartCount,
+
+}
\ No newline at end of file
diff --git a/utils/constance.js b/utils/constance.js
new file mode 100644
index 0000000..7fee298
--- /dev/null
+++ b/utils/constance.js
@@ -0,0 +1,15 @@
+
+//支付成功页面常量
+const PAGE_PAY_SUCCESS = {
+ //普通订单
+ SHOW_MODEL_NORMAL: 1,
+ //拼团订单
+ SHOW_MODEL_GROUP: 2,
+ //拼团订单结束
+ SHOW_MODEL_GROUP_END: 3,
+
+}
+
+module.exports = {
+ PAGE_PAY_SUCCESS: PAGE_PAY_SUCCESS,
+}
\ No newline at end of file
diff --git a/utils/dataFilter.wxs b/utils/dataFilter.wxs
new file mode 100644
index 0000000..6a9e3d3
--- /dev/null
+++ b/utils/dataFilter.wxs
@@ -0,0 +1,21 @@
+/**
+ * 数据过滤器
+ */
+
+//审核状态
+function authStatus(d) {
+ if (d == 1) {
+ return '待审核';
+ } else if (d == 2) {
+ return '通过';
+ } else if (d == 3) {
+ return '审核失败';
+ }
+
+}
+
+
+module.exports = {
+
+ authStatus: authStatus
+};
\ No newline at end of file
diff --git a/utils/service-api.js b/utils/service-api.js
new file mode 100644
index 0000000..7db0c92
--- /dev/null
+++ b/utils/service-api.js
@@ -0,0 +1,189 @@
+/**
+* 服务端接口
+*
+*/
+var util = require('util.js');
+
+
+
+
+//认证接口
+var auth = {
+ //查询认证信息
+ getAuthInfo: '/wxapi/auth/findAuth',
+ add: '/wxapi/auth/add',
+ modify: '/wxapi/auth/modify',
+ storeQuery: '/wxapi/shopStoreAction/getshopStore',
+ //绑定手机号
+ bindingPhoneNumber:"/wxapi/shopBindingPhoneNumber/bindingPhoneNumber",
+}
+
+//广告
+var ad = {
+ //首页轮播图
+ getByType: '/wxapi/ad/getByType/',
+ //根据页面code获取页面的广告元素
+ getAdPage: '/wxapi/ad/getAdPage/',
+ //根据code找广告
+ getAdByCode:'/wxapi/ad/getAdByCode',
+}
+
+var article = {
+ //根据类型查询文章分类
+ findArticleByType: '/wxapi/article/findArticleByType',
+ findArticleType: '/wxapi/Article/findArticleType',
+ findArticById: '/wxapi/Article/findArticById/',
+ findArtice: '/wxapi/Article/findArticle'
+}
+
+var address = {
+ newaddress: '/wxapi/shopAddressAction/saveReceiveAddress',
+ editaddress: '/wxapi/shopAddressAction/updateReceiveAddress',
+ queryaddress: '/wxapi/shopAddressAction/findReceiveAddress',
+ deleteladdress: '/wxapi/shopAddressAction/deleteByAddrId',
+ showaddress: '/wxapi/shopAddressAction/findAddrByAddrId'
+}
+
+
+//优惠券模块
+var coupon = {
+ //领取优惠券
+ receiveCoupon: "/wxapi/shopCoupon/receiveCoupon/",
+ //根据tag查询优惠券
+ getCouponListByTag: "/wxapi/shopCoupon/getCouponListByTag/",
+}
+
+//产品相关模块
+var goods = {
+ //搜索产品
+ searchGoods: "/wxapi/ShopProduct/getShopProductShowList",
+ //查询产品详情
+ productInfo: "/wxapi/ShopProduct/getProductById/",
+ //加入产品到购物车
+ saveShoppingCart: "/wxapi/ShoppingCart/saveShoppingCart",
+ //获取购物车数量
+ getUserCartCount:"/wxapi/ShoppingCart/getUserCartCount/",
+
+}
+
+//数据字典
+var dataDictionary = {
+ //根据父节点字段获取子节点列表
+ getListByParentCode:"/wxapi/dataDictionary/getListByParentCode/",
+ //根据code获取字典getByCode
+ getByCode: "/wxapi/dataDictionary/getByCode/",
+
+}
+//购物车
+var shoppingCart={
+ //查询购物车列表
+ findShoppingCart:"/wxapi/ShoppingCart/findShoppingCart",
+ updateCarNumberByCartId:"/wxapi/ShoppingCart/updateCarNumberByCartId/",
+ updateCartAllSelected:'/wxapi/ShoppingCart/updateCartAllSelected/',
+ updateCartSelected:'/wxapi/ShoppingCart/updateCartSelected/',
+ deleteByCartId:'/wxapi/ShoppingCart/deleteByCartId/',
+}
+
+//订单接口
+var order={
+ //计算下单界面数据
+ calculationCartOrder: "/wxapi/shopOrder/calculationCartOrder",
+ getOrderStatusCount: "/wxapi/shopOrder/getOrderStatusCount",
+}
+
+//预约接口
+var yuyue = {
+ //获取门店列表
+ getShopList: "/wxapi/yuyue/getShopList",
+ //根据id获取门店信息
+ findShopInfoById: "/wxapi/yuyue/findShopInfoById",
+ //获取预约时间表
+ getTimeList: "/wxapi/yuyue/getTimeList",
+ //获取预约日期
+ getYYDayAndWeek: "/wxapi/yuyue/getYYDayAndWeek",
+ //获取排版美疗师列表
+ getPaiBanBeauticianList:"/wxapi/yuyue/getPaiBanBeauticianList",
+ //创建预约单
+ createServiceOrder:"/wxapi/yuyue/createServiceOrder",
+ //根据id查询预约订单的详情
+ getServiceOrderById:"/wxapi/yuyue/getServiceOrderById/",
+ //取消订单
+ cancelOrderById:"/wxapi/yuyue/cancelOrderById/",
+ //搜索订单列表
+ getServiceOrderList: "/wxapi/yuyue/getServiceOrderList",
+ //删除订单
+ removeOrderById:"/wxapi/yuyue/removeOrderById/"
+
+}
+
+var productAttribute={
+ getByCode:"/wxapi/ProductAttribute/getByCode/"
+}
+
+//团购接口
+var groupBuy = {
+ //查询进行中的团购列表
+ showGroupByList: "/wxapi/groupBuy/showGroupByList/",
+ //查询拼团详情{actId}
+ findGroupBuyInfo:"/wxapi/groupBuy/findGroupBuyInfo/",
+ //查询用户拼团信息{actId}
+ findOwnerGroupBuyInfo:"/wxapi/groupBuy/findOwnerGroupBuyInfo/",
+ //查询成团的信息,团成员
+ findGroupJoinInfo:"/wxapi/groupBuy/findGroupJoinInfo/",
+ //拼团开团接口
+ createGroupBuy:"/wxapi/groupBuy/createGroupBuy",
+ //加入拼团接口
+ joinGroupBuy:"/wxapi/groupBuy/joinGroupBuy",
+ //计算价格
+ calPrice:"/wxapi/groupBuy/calPrice",
+}
+
+//秒杀活动
+var seckill={
+ //查询当前门店正在进行的秒杀活动
+ findSecKillActList:"/wxapi/seckill/findSecKillActList/",
+ //查询一场活动的产品列表
+ findSecKillGoodsListById:"/wxapi/seckill/findSecKillGoodsListById/",
+ //查询秒杀详情
+ findSecKillGoodsInfo:"/wxapi/seckill/findSecKillGoodsInfo/",
+ //计算秒杀价格
+ calSecKillPrice:"/wxapi/seckill/calSecKillPrice",
+ //创建秒杀订单
+ createSecKill:"/wxapi/seckill/createSecKill",
+}
+
+var shalong={
+ //查询沙龙活动
+ findSalong:"/wxapi/salon/findSalonActivitiesInPage",
+ //根据id查询沙龙详情
+ findSalongById:"/wxapi/salon/findSalonInfoById/",
+ //报名沙龙
+ joinSalong:"/wxapi/salon/joinSalonActivity"
+
+}
+
+//皮肤检测接口
+var checkInfo={
+ //检测记录列表查询
+ recordList:"/wxapi/skinCheck/showSkinList",
+ findById:"/wxapi/skinCheck/findById"
+}
+
+module.exports = {
+ auth: auth,
+ dataDictionary: dataDictionary,
+ ad: ad,
+ article: article,
+ address: address,
+ coupon: coupon,
+ goods: goods,
+ shoppingCart: shoppingCart,
+ order: order,
+ yuyue: yuyue,
+ productAttribute: productAttribute,
+ groupBuy: groupBuy,
+ checkInfo: checkInfo,
+ seckill:seckill,
+ shalong:shalong,
+
+}
diff --git a/utils/shopcart.js b/utils/shopcart.js
new file mode 100644
index 0000000..75ab885
--- /dev/null
+++ b/utils/shopcart.js
@@ -0,0 +1,181 @@
+/**
+ * 贝塞尔曲线
+ */
+function bezier(points, times) {
+ // 0、以3个控制点为例,点A,B,C,AB上设置点D,BC上设置点E,DE连线上设置点F,则最终的贝塞尔曲线是点F的坐标轨迹。
+ // 1、计算相邻控制点间距。
+ // 2、根据完成时间,计算每次执行时D在AB方向上移动的距离,E在BC方向上移动的距离。
+ // 3、时间每递增100ms,则D,E在指定方向上发生位移, F在DE上的位移则可通过AD/AB = DF/DE得出。
+ // 4、根据DE的正余弦值和DE的值计算出F的坐标。
+ // 邻控制AB点间距
+ var bezier_points = [];
+ var points_D = [];
+ var points_E = [];
+ const DIST_AB = Math.sqrt(Math.pow(points[1]['x'] - points[0]['x'], 2) + Math.pow(points[1]['y'] - points[0]['y'], 2));
+ // 邻控制BC点间距
+ const DIST_BC = Math.sqrt(Math.pow(points[2]['x'] - points[1]['x'], 2) + Math.pow(points[2]['y'] - points[1]['y'], 2));
+ // D每次在AB方向上移动的距离
+ const EACH_MOVE_AD = DIST_AB / times;
+ // E每次在BC方向上移动的距离
+ const EACH_MOVE_BE = DIST_BC / times;
+ // 点AB的正切
+ const TAN_AB = (points[1]['y'] - points[0]['y']) / (points[1]['x'] - points[0]['x']);
+ // 点BC的正切
+ const TAN_BC = (points[2]['y'] - points[1]['y']) / (points[2]['x'] - points[1]['x']);
+ // 点AB的弧度值
+ const RADIUS_AB = Math.atan(TAN_AB);
+ // 点BC的弧度值
+ const RADIUS_BC = Math.atan(TAN_BC);
+ // 每次执行
+ for (var i = 1; i <= times; i++) {
+ // AD的距离
+ var dist_AD = EACH_MOVE_AD * i;
+ // BE的距离
+ var dist_BE = EACH_MOVE_BE * i;
+ // D点的坐标
+ var point_D = {};
+ point_D['x'] = dist_AD * Math.cos(RADIUS_AB) + points[0]['x'];
+ point_D['y'] = dist_AD * Math.sin(RADIUS_AB) + points[0]['y'];
+ points_D.push(point_D);
+ // E点的坐标
+ var point_E = {};
+ point_E['x'] = dist_BE * Math.cos(RADIUS_BC) + points[1]['x'];
+ point_E['y'] = dist_BE * Math.sin(RADIUS_BC) + points[1]['y'];
+ points_E.push(point_E);
+ // 此时线段DE的正切值
+ var tan_DE = (point_E['y'] - point_D['y']) / (point_E['x'] - point_D['x']);
+ // tan_DE的弧度值
+ var radius_DE = Math.atan(tan_DE);
+ // 地市DE的间距
+ var dist_DE = Math.sqrt(Math.pow((point_E['x'] - point_D['x']), 2) + Math.pow((point_E['y'] - point_D['y']), 2));
+ // 此时DF的距离
+ var dist_DF = (dist_AD / DIST_AB) * dist_DE;
+ // 此时DF点的坐标
+ var point_F = {};
+ point_F['x'] = dist_DF * Math.cos(radius_DE) + point_D['x'];
+ point_F['y'] = dist_DF * Math.sin(radius_DE) + point_D['y'];
+ bezier_points.push(point_F);
+ }
+ return {
+ 'bezier_points': bezier_points
+ };
+}
+
+
+/**
+ * 播放加入购物车动画
+ */
+function playAnimation(param, callBack) {
+ console.log("playAnimation");
+
+ //页面对象
+ var page = param.page;
+ //点击事件
+ var event = param.event;
+
+
+ if (!page.data.hide_good_box) return;
+ page.finger = {};
+ var topPoint = {};
+ page.finger['y'] = event.touches["0"].clientY;
+ page.finger['x'] = event.touches["0"].clientX;
+
+ if (page.finger['x'] > page.busPos['x']) {
+ page.isFingerXQtBusX = true;
+ } else {
+ page.isFingerXQtBusX = false;
+ }
+ if (page.finger['y'] < page.busPos['y']) {
+ topPoint['y'] = page.finger['y'] - 150;
+ } else {
+ topPoint['y'] = page.busPos['y'] - 150;
+ }
+ topPoint['x'] = Math.abs(page.finger['x'] - page.busPos['x']) / 2;
+ if (page.finger['x'] > page.busPos['x']) {
+ topPoint['x'] = (page.finger['x'] - page.busPos['x']) / 2 + page.busPos['x'];
+ } else {
+ topPoint['x'] = (page.busPos['x'] - page.finger['x']) / 2 + page.finger['x'];
+ }
+
+
+ if (page.isFingerXQtBusX) {
+ page.linePos = bezier([page.busPos, topPoint, page.finger], 30);
+ //启动动画
+ startAnimation(page,callBack);
+
+ } else {
+ page.linePos = bezier([page.finger, topPoint, page.busPos], 30);
+ //启动动画
+ startAnimationTow(page,callBack);
+ }
+
+
+
+}
+
+function startAnimation(page, callBack) {
+ var index = 29,
+ bezier_points = page.linePos['bezier_points'];
+ page.setData({
+ hide_good_box: false,
+ bus_x: page.finger['x'],
+ bus_y: page.finger['y']
+ })
+ page.timer = setInterval(function () {
+
+ page.setData({
+ bus_x: bezier_points[index]['x'],
+ bus_y: bezier_points[index]['y']
+ })
+ index--;
+ if (index < 0) {
+ clearInterval(page.timer);
+ page.setData({
+ hide_good_box: true,
+ hideCount: false,
+ count: page.data.count += 1
+ })
+ callBack();
+ }
+ }, 20);
+}
+
+
+
+function startAnimationTow(page, callBack) {
+ var index = 0,
+ bezier_points = page.linePos['bezier_points'];
+
+ page.setData({
+ hide_good_box: false,
+ bus_x: page.finger['x'],
+ bus_y: page.finger['y']
+ })
+ page.timer = setInterval(function () {
+
+ page.setData({
+ bus_x: bezier_points[index]['x'],
+ bus_y: bezier_points[index]['y']
+ })
+ index++;
+ if (index > 28) {
+ clearInterval(page.timer);
+ page.setData({
+ hide_good_box: true,
+ hideCount: false,
+ count: page.data.count += 1
+ })
+
+ callBack();
+ }
+ }, 20);
+
+}
+
+
+module.exports = {
+
+ bezier: bezier,
+ playAnimation: playAnimation,
+
+}
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
new file mode 100644
index 0000000..6fc81a6
--- /dev/null
+++ b/utils/util.js
@@ -0,0 +1,582 @@
+/**
+ * 通用js
+ */
+
+var debugHost='www.baidu.com';
+
+// api地址,请求参数,回调函数,是否遮罩
+function request(params) {
+
+ var option = {
+ method: "POST",
+ mask: false,
+ //检查登录
+ checkLogin: false,
+ }
+
+ //合并参数
+ option = Object.assign(option, params);
+
+
+
+ //遮罩
+ if (option.mask) {
+ wx.showLoading({
+ title: "加载中...",
+ mask: true
+ });
+ }
+
+ if (params.checkLogin) {
+ console.log("用户登录调用");
+ wx.login({
+ success: function(res) {
+ wx.request({
+ url: getApp().baseUrl + '/wxapi/user/login/' + res.code,
+ method: "POST",
+ header: {
+ 'content-type': 'application/json',
+ 'debugHost':debugHost
+ // 'host':'www.jyymatrix.cc'
+ },
+ data: {},
+ success: function(res) {
+ if (res.data.status == "200") {
+ console.log("登录成功");
+ getApp().loginToken = res.data.mapInfo.token;
+ getApp().userInfo = res.data.mapInfo.userInfo;
+ getApp().isLogin = true;
+ wx.hideLoading();
+ //登录后触发请求
+ doRequest(option);
+ } else {
+ wx.showToast({
+ title: res.data.info,
+ icon: "none"
+ });
+ wx.hideLoading()
+ }
+ wx.hideLoading()
+ },
+ //失败处理
+ fail: function(res) {
+ wx.showToast({
+ title: "网络请求异常",
+ icon: "none"
+ });
+ }
+ })
+ }
+ });
+
+
+
+ } else {
+ console.log("用户未登录调用");
+ doRequest(option);
+
+ }
+}
+
+
+
+function doRequest(option) {
+
+ var data = option.data ? option.data : {};
+
+
+ wx.request({
+ url: getApp().baseUrl + option.api,
+ method: option.method,
+ header: {
+ 'content-type': 'application/json',
+ 'debugHost':debugHost,
+ 'token': getApp().loginToken
+ },
+ data: data,
+ success: function(res) {
+
+ if (res.data.status == "200") {
+ //请求成功
+ if (option.callback) {
+ option.callback(res.data);
+ }
+ } else {
+ console.log("请求失败回调")
+ wx.showToast({
+ title: res.data.info,
+ icon: "none",
+ duration: 2000
+ });
+ if (option.failCallback) {
+ option.failCallback(res.data);
+ }
+ }
+ //关闭遮罩
+ if (option.mask) {
+ wx.hideLoading()
+ }
+ },
+ //网络异常失败处理
+ fail: function(res) {
+ console.error(res);
+ wx.showToast({
+ title: "网络请求异常",
+ icon: "none"
+ });
+ //关闭遮罩
+ if (option.option.mask) {
+ wx.hideLoading()
+ }
+ }
+ })
+
+}
+
+
+
+
+//上传文件
+function uploadImage(param, callBack) {
+
+ // 覆盖初始化参数
+ var sizeType = param.sizeType ? param.sizeType : ['compressed'];
+ var sourceType = param.sourceType ? param.sourceType : ['album', 'camera'];
+ var count = param.count ? param.count : 1;
+ //文件上传地址
+ var uploadUrl = param.uploadUrl ? param.uploadUrl : '/wxapi/uploadFile/doUpload';
+ uploadUrl = getApp().baseUrl + uploadUrl;
+ //默认传参
+ var formData = param.uploadUrl ? param.uploadUrl : {};
+
+ //选择照片
+ wx.chooseImage({
+ count: count,
+ sizeType: sizeType,
+ sourceType: sourceType,
+ success: function(res) {
+ //开始上传
+ var tempFilePaths = res.tempFilePaths
+ wx.showToast({
+ icon: "loading",
+ title: "正在上传"
+ }),
+ wx.getStorage({
+ key: 'token',
+ success: function(res) {
+ for (var i = 0; i < tempFilePaths.length; i++) {
+ wx.uploadFile({
+ url: uploadUrl,
+ filePath: tempFilePaths[i],
+ name: 'file',
+ header: {
+ "Content-Type": "multipart/form-data",
+ 'token': res.data,
+ 'debugHost':debugHost
+ },
+ formData: formData,
+ success: function(e) {
+ console.log("上传完成", e);
+
+ if (e.statusCode != 200) {
+ wx.showModal({
+ title: '提示',
+ content: '上传失败',
+ showCancel: false
+ })
+ return;
+ }
+
+ var data = JSON.parse(e.data) //上传返回值
+
+ if (data.status == '200') {
+ var url = data.mapInfo.url
+ console.log("上传成功的图片路径:" + url);
+ callBack(data);
+ }
+ },
+ fail: function(e) {
+ console.log(e);
+ wx.showModal({
+ title: '提示',
+ content: '上传失败',
+ showCancel: false
+ })
+ },
+ complete: function() {
+ wx.hideToast(); //隐藏Toast
+ }
+ })
+ }
+
+ }
+ })
+ }
+ })
+
+
+}
+
+
+/**
+ * 表单验证
+ * 满足验证要求返回true,否者返回false
+ */
+function validForm(formData, rules) {
+ //验证结果记录
+ var result = true;
+ //定义一些默认的规则
+ var def_rules = {
+ //手机号码
+ "$tel": {
+ // "rule": /(^([0-9]{3,4}-)?[0-9]{7,8}$)|((\d{3}-\d{8}|\d{4}-\d{7})|(^1[358]\d{9}|173|176|177\d{8}$))/,
+ "rule": /^1[3456789]\d{9}$/,
+ "errmsg": "请输入正确的手机号码"
+ }
+ }
+ //循环校验表单
+ for (var key in formData) {
+
+ var value = formData[key];
+
+ var ruleObj = rules[key];
+
+ //跳过没有设置验证规则的属性
+ if (!ruleObj) {
+ continue;
+ }
+
+
+ var rule = ruleObj.rule;
+ var errmsg = ruleObj["errmsg"];
+
+ //判断是否为默认规则
+ if (def_rules[rule]) {
+ rule = def_rules[ruleObj.rule].rule;
+ }
+
+ if (!errmsg) {
+ errmsg = def_rules[ruleObj.rule].errmsg;
+ }
+ console.log("验证", value, rule);
+ if (!rule.test(value)) {
+ wx.showModal({
+ title: '提示',
+ content: errmsg,
+ showCancel: false,
+ confirmText: "确定"
+ })
+ result = false;
+ break;
+ }
+ }
+ //返回校验结果
+ return result;
+}
+
+/// 调用演示 validForm({ "tel": "1839044333" }, { "tel": { "rule":"$tel" , errmsg:"请输入正确的号码" } })
+
+/**
+ * 对象浅合并
+ */
+function extend(o, n) {
+ for (var p in n) {
+ o[p] = n[p];
+ }
+ return o;
+}
+
+
+
+/**
+ * 用户登录
+ * url : 要跳转的绝对路径
+ */
+function userLogin(callBack) {
+ //调用微信登录刷新token
+ console.log(callBack);
+
+ wx.login({
+ success: function(res) {
+ wx.request({
+ url: getApp().baseUrl + '/wxapi/user/login/' + res.code,
+ method: "POST",
+ header: {
+ 'content-type': 'application/json',
+ 'debugHost':debugHost
+ },
+ data: {},
+ success: function(res) {
+ if (res.data.status == "200") {
+ console.log("登录成功");
+ getApp().loginToken = res.data.mapInfo.token;
+ getApp().userInfo = res.data.mapInfo.userInfo;
+ getApp().isLogin = true;
+
+ wx.hideLoading();
+ console.log("执行回调请求1");
+
+ console.log(callBack);
+
+ if (callBack) {
+ console.log("执行回调请求2");
+ callBack();
+ }
+ } else {
+ wx.showToast({
+ title: res.data.info,
+ icon: "none"
+ });
+ wx.hideLoading()
+ }
+ wx.hideLoading()
+ },
+ //失败处理
+ fail: function(res) {
+ wx.showToast({
+ title: "网络请求异常",
+ icon: "none"
+ });
+ }
+ })
+ }
+ });
+}
+
+
+
+function formatNumber(n) {
+ n = n.toString();
+ return n[1] ? n : '0' + n;
+}
+
+/**
+ * 时间戳转化为年 月 日 时 分 秒
+ * number: 传入时间戳
+ * format:返回格式,支持自定义,但参数必须与formateArr里保持一致
+ */
+function formatTimeTwo(number, format) {
+
+ var formateArr = ['Y', 'M', 'D', 'h', 'm', 's'];
+ var returnArr = [];
+ // console.log(number,typeof number);
+ var date = new Date(number * 1000);
+ // console.log(date, typeof date);
+ returnArr.push(date.getFullYear());
+ returnArr.push(formatNumber(date.getMonth() + 1));
+ returnArr.push(formatNumber(date.getDate()));
+
+ returnArr.push(formatNumber(date.getHours()));
+ returnArr.push(formatNumber(date.getMinutes()));
+ returnArr.push(formatNumber(date.getSeconds()));
+ console.log(returnArr);
+ for (var i in returnArr) {
+ format = format.replace(formateArr[i], returnArr[i]);
+ }
+ return format;
+}
+// 防止多次点击
+function buttonClicked(self) {
+ self.setData({
+ buttonClicked: true
+ })
+ setTimeout(function() {
+ self.setData({
+ buttonClicked: false
+ })
+ }, 500)
+}
+/** 获取时间 */
+
+
+
+function dateFtt(date) {
+ // console.log("data---------");
+ // console.log(date);
+ // console.log(typeof date);
+ return date.getFullYear() + "-" + setFomartZero((date.getMonth() + 1)) +
+ "-" + setFomartZero(date.getDate()) + " " + setFomartZero(date.getHours()) +
+ ":" + setFomartZero(date.getMinutes());
+}
+
+
+
+function setFomartZero(date) {
+ if (date < 10) {
+ return "0" + date;
+ }
+ return date;
+}
+
+function goTap() {
+ if (wx.pageScrollTo) {
+ wx.pageScrollTo({
+ scrollTop: 0,
+ })
+ } else {
+
+ }
+}
+
+// 判断是否有emoji表情
+function isEmojiCharacter(substring) {
+ for (var i = 0; i < substring.length; i++) {
+ var hs = substring.charCodeAt(i);
+ if (0xd800 <= hs && hs <= 0xdbff) {
+ if (substring.length > 1) {
+ var ls = substring.charCodeAt(i + 1);
+ var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
+ if (0x1d000 <= uc && uc <= 0x1f77f) {
+ return true;
+ }
+ }
+ } else if (substring.length > 1) {
+ var ls = substring.charCodeAt(i + 1);
+ if (ls == 0x20e3) {
+ return true;
+ }
+ } else {
+ if (0x2100 <= hs && hs <= 0x27ff) {
+ return true;
+ } else if (0x2B05 <= hs && hs <= 0x2b07) {
+ return true;
+ } else if (0x2934 <= hs && hs <= 0x2935) {
+ return true;
+ } else if (0x3297 <= hs && hs <= 0x3299) {
+ return true;
+ } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 ||
+ hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b ||
+ hs == 0x2b50) {
+ return true;
+ }
+ }
+ }
+}
+
+//保存卡片
+function savePicToAlbum(tempFilePath) {
+ let that = this;
+ wx.getSetting({
+ success(res) {
+ if (!res.authSetting['scope.writePhotosAlbum']) {
+ wx.authorize({
+ scope: 'scope.writePhotosAlbum',
+ success() {
+ wx.saveImageToPhotosAlbum({
+ filePath: tempFilePath,
+ success(res) {
+ wx.showToast({
+ title: '保存成功'
+ });
+ },
+ fail(res) {
+ console.log(res);
+ }
+ })
+ },
+ fail() {
+ // 用户拒绝授权,打开设置页面
+ wx.openSetting({
+ success: function(data) {
+ console.log("openSetting: success");
+ },
+ fail: function(data) {
+ console.log("openSetting: fail");
+ }
+ });
+ }
+ })
+ } else {
+ wx.saveImageToPhotosAlbum({
+ filePath: tempFilePath,
+ success(res) {
+ wx.showToast({
+ title: '保存成功',
+ });
+ },
+ fail(res) {
+ console.log(res);
+ }
+ })
+ }
+ },
+ fail(res) {
+ console.log(res);
+ }
+ })
+}
+
+
+Date.prototype.Format = function(fmt) { //author: meizz
+ var o = {
+ "M+": this.getMonth() + 1, //月份
+ "d+": this.getDate(), //日
+ "h+": this.getHours(), //小时
+ "m+": this.getMinutes(), //分
+ "s+": this.getSeconds(), //秒
+ "q+": Math.floor((this.getMonth() + 3) / 3),
+ "S": this.getMilliseconds() //毫秒
+ };
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o)
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ return fmt;
+}
+
+/**
+ * 给定秒数,格式化时间长度,输入单位秒数
+ */
+function getTimeSpance(timeLength) {
+ let time = {
+ day : Math.floor(timeLength / ( 60 * 60 * 24)), //计算天数
+ hour: Math.floor(timeLength / (60 * 60) % 24), //计算小时数
+ minute: Math.floor(timeLength / ( 60) % 60), //计算分钟数
+ second: Math.floor(timeLength % 60) //计算秒数
+ };
+ return time;
+}
+
+
+
+
+function getOutStorage(key) {
+ var obj = wx.getStorageSync(key);
+ wx.removeStorageSync(key);
+ return obj;
+}
+
+function isNotBlank(str) {
+ if (str === undefined || str === null || str === "") {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+function isBlank(str) {
+ if (str === undefined || str === null || str === "") {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
+
+module.exports = {
+ uploadImage: uploadImage,
+ validForm: validForm,
+ extend: extend,
+ userLogin: userLogin,
+ request: request,
+ formatTimeTwo: formatTimeTwo,
+ buttonClicked: buttonClicked,
+ dateFtt: dateFtt,
+ goTap: goTap,
+ isEmojiCharacter: isEmojiCharacter,
+ savePicToAlbum: savePicToAlbum,
+ getOutStorage: getOutStorage,
+ isNotBlank: isNotBlank,
+ isBlank: isBlank,
+ getTimeSpance: getTimeSpance
+}
\ No newline at end of file
--
Gitblit v1.9.1