commit a7995d90bcc701809b5a08926162ee57247f4b12
Author: 张慢慢 <994797151@qq.com>
Date: Mon May 24 13:56:00 2021 +0800
[更新]
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..14ea590
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..3b66410
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "git.ignoreLimitWarning": true
+}
\ No newline at end of file
diff --git a/api/err.js b/api/err.js
new file mode 100644
index 0000000..cee8984
--- /dev/null
+++ b/api/err.js
@@ -0,0 +1,54 @@
+
+/**
+ * 处理错误信息
+ * @property {Object} errInfo
+ */
+
+const errInfo = (obj) =>{
+ if(obj.status_code == 401){
+ wx.showModal({
+ title : "登录提示",
+ content : "长时间未操作,登录已过期,请重新登录",
+ showCancel : false,
+ confirmColor: "#0b0041",
+ confirmText : "确定",
+ success : ()=>{
+ // 清理客户端登录缓存
+ wx.removeStorageSync("token")
+ // 返回首页
+ wx.redirectTo({
+ url: "/pages/index/index",
+ })
+ }
+ })
+ }else if(obj.status_code == 422){
+ wx.showToast({
+ title: obj.message,
+ icon : "none"
+ })
+ }else if(obj.status_code == 400 || obj.status_code == 0){
+ wx.showToast({
+ title: obj.message,
+ icon : "none"
+ })
+ }else if(obj.status_code == 404){
+ wx.showToast({
+ title: "接口地址不存在,请联系系统管理员",
+ icon : "none"
+ })
+ }else if(obj.status_code == 500){
+ wx.showToast({
+ title: "服务端:" + obj.message,
+ icon : "none"
+ })
+ }else {
+ wx.showToast({
+ title: "code:" + obj.status_code + ", msg:" + obj.message,
+ icon : "none"
+ })
+ }
+}
+
+module.exports = {
+ errInfo
+}
diff --git a/api/index.js b/api/index.js
new file mode 100644
index 0000000..094cfe5
--- /dev/null
+++ b/api/index.js
@@ -0,0 +1,29 @@
+
+/*
+ * 亿时代 v1.0.0 (2020-07-02 09:25:32)
+ *https://card.ysd-bs.com/api/
+ */
+
+// 首页
+import index from "./interfaces/index"
+
+// 授权登录
+import enroll from "./interfaces/enroll"
+
+// 个人中心
+import user from "./interfaces/user"
+
+// 地址管理
+import address from "./interfaces/address"
+
+// 兑换订单
+import exchange from "./interfaces/exchange"
+
+
+export default{
+ index,
+ enroll,
+ user,
+ address,
+ exchange
+}
diff --git a/api/interfaces/address.js b/api/interfaces/address.js
new file mode 100644
index 0000000..93a8e76
--- /dev/null
+++ b/api/interfaces/address.js
@@ -0,0 +1,39 @@
+
+import {req} from "../request"
+
+//我的地址列表
+const index = () => req({url: "addresses"})
+
+//获取省
+const create = () => req({url: "addresses/create"})
+
+// 获取市级列表
+const children = (psn) => req({url: "areas/children", data: {psn: psn}})
+
+// 获取已有地址信息
+const edit = (addressId) => req({url: "addresses/" + addressId + '/edit'})
+
+
+// 创建地址保存
+const add = (name, mobile, province_id, city_id, district_id, address, def) => req({url: "addresses/store", method: "POST", data: {name: name, mobile: mobile, province_id: province_id, city_id: city_id, district_id: district_id, address: address, def: def}})
+
+// 编辑地址保存
+const keep = (addressId,name, mobile, province_id, city_id, district_id, address) => req({url: "addresses/" + addressId + '/update', method: "POST", data: {name: name, mobile: mobile, province_id: province_id, city_id: city_id, district_id: district_id, address: address}})
+
+// 设为默认地址
+const setdef = (addressId) => req({url: "addresses/" + addressId + '/setdef', method: "POST"})
+
+// 删除地址
+const remove = (addressId) => req({url: "addresses/" + addressId + '/destroy', method: "DELETE"})
+
+
+export default({
+ index,
+ create,
+ children,
+ edit,
+ add,
+ keep,
+ setdef,
+ remove
+})
diff --git a/api/interfaces/enroll.js b/api/interfaces/enroll.js
new file mode 100644
index 0000000..0805d56
--- /dev/null
+++ b/api/interfaces/enroll.js
@@ -0,0 +1,18 @@
+
+import {req} from "../request"
+
+//微信授权登录
+const record = (code, iv, encryptedData) => req({url: "auth/openwx", method: "POST", data: {code: code, iv: iv, encryptedData: encryptedData}})
+
+//微信手机授权
+const bindmobile = (code, iv, mobile) => req({url: "auth/bindmobile", method: "POST", data: {code: code, iv: iv, mobile: mobile}})
+
+//切换手机授权
+const tel = (wechatUser_id, username) => req({url: "auth/loginbymobile", method: "POST", data: {wechatUser_id: wechatUser_id,username: username}})
+
+
+export default({
+ record,
+ bindmobile,
+ tel
+})
diff --git a/api/interfaces/exchange.js b/api/interfaces/exchange.js
new file mode 100644
index 0000000..e390db9
--- /dev/null
+++ b/api/interfaces/exchange.js
@@ -0,0 +1,21 @@
+
+import {req} from "../request"
+
+//兑换订单列表
+const index = (type) => req({url: "orders/index", data: {type: type}})
+
+//兑换订单详情
+const show = (orderid) => req({url: "orders/show?", data: {orderid: orderid}})
+
+//取消兑换订单
+const cancel = (orderid) => req({url: "orders/cancel?orderid=" + orderid , method: "POST"})
+
+//兑换订单支付
+const payments = (orderid) => req({url: "payments/order?orderid=" + orderid})
+
+export default({
+ index,
+ show,
+ cancel,
+ payments
+})
diff --git a/api/interfaces/index.js b/api/interfaces/index.js
new file mode 100644
index 0000000..30037ff
--- /dev/null
+++ b/api/interfaces/index.js
@@ -0,0 +1,97 @@
+
+import {req} from "../request"
+
+//首页权益
+const index = (area_name, user_lng, user_lat) => req({url: "home", data: {area_name: area_name, user_lng: user_lng, user_lat:user_lat}})
+
+//白金+钻石权益
+const choice = (type, area_name, user_lng, user_lat) => req({url: "home/group", data: {type: type,area_name: area_name, user_lng: user_lng, user_lat:user_lat}})
+
+//权益分类
+const classify = (category_id) => req({url: "categories/" + category_id})
+
+//周五福利详情
+const welfares = (welfare_id) => req({url: "welfare/" + welfare_id})
+
+//市区选择
+const idxCity = (province_id) => req({url: "areas/citys?province_id=" + province_id || ''})
+
+//活动商品列表
+const redwine = () => req({url: "redwine/index"})
+
+//活动商品详情
+const redwinePay = (goodId) => req({url: "redwine/" + goodId + "/pay", method: "POST"})
+
+//活动商品订单提交
+const payment = (good_id, param_id, address_id, islogistics) => req({url: "redwine/payment", method: "POST", data: {good_id: good_id, param_id: param_id, address_id: address_id, islogistics: islogistics}})
+
+//活动商品订单
+const activityOrder = (type, page) => req({url: "activity/orders", data: {type: type, page: page}})
+
+//活动商品取消订单
+const cance = (orderId) => req({url: "activity/orders/" + orderId + '/cancel', method: "POST"})
+
+//活动商品支付订单
+const repay = (orderId) => req({url: "redwine/" + orderId + '/repay', method: "POST"})
+
+//活动商品订单详情
+const ordersInfo = (orderId) => req({url: "activity/orders/" + orderId + '/info', method: "POST"})
+
+// 权益详情
+const rightShow = (right_id, address_id, num, is_deliver) => req({url: "orders/create/", data: {right_id: right_id, address_id: address_id || '', num: num || '', is_deliver: is_deliver}})
+
+// 权益购买提交
+const rightStore = (right_id, address_id, is_deliver, qty) => req({url: "orders/store/", method: "POST", data: {right_id: right_id, address_id: address_id || '', is_deliver: is_deliver, qty: qty || ''}})
+
+// 微信权益购买信息
+const wechat = (trade_no) => req({url: "payments/wechat?",method: "POST", data: {trade_no: trade_no}})
+
+// 沃支付权益购买信息
+const wopay = (trade_no) => req({url: "unicom/buy?", data: {trade_no: trade_no}})
+
+//获取openid地址-web
+const unionpay = (callback_url, callback_type, right_id) => req({url: "unionpay/openid", data: {callback_url: callback_url, callback_type: callback_type, right_id: right_id}})
+
+//领取权益优惠券
+const receiveCode = (openid, event_no, right_id) => req({url: "unionpay/code", data: {openid: openid, event_no: event_no, right_id: right_id}})
+
+//领取权益优惠券
+const unionCode = (openid) => req({url: "unionpay/union_openid", data: {openid: openid}, method: "POST"})
+
+//所有城市-最新无字母
+const newCity = () => req({url: "ajax/all_right_citys"})
+
+//市区选择-最新无字母
+const newidxCity = (code) => req({url: "ajax/all_right_children", data: {code: code}})
+
+//周五福利-获取支付信息
+const fridayInfo = (orderId) => req({url: "welfare/order/" + orderId})
+
+//周五福利-支付
+const fridayPay = (trade_no) => req({url: "payments/welfare/wechat",method: "POST", data: {trade_no: trade_no}})
+
+export default({
+ index,
+ choice,
+ classify,
+ welfares,
+ idxCity,
+ redwine,
+ redwinePay,
+ payment,
+ activityOrder,
+ cance,
+ repay,
+ ordersInfo,
+ rightShow,
+ rightStore,
+ wechat,
+ wopay,
+ unionpay,
+ receiveCode,
+ unionCode,
+ newCity,
+ newidxCity,
+ fridayInfo,
+ fridayPay
+})
diff --git a/api/interfaces/user.js b/api/interfaces/user.js
new file mode 100644
index 0000000..60925c3
--- /dev/null
+++ b/api/interfaces/user.js
@@ -0,0 +1,73 @@
+
+import {req} from "../request"
+
+//用户信息
+const index = () => req({url: "user"})
+
+//切换用户登录
+const mobiles = () => req({url: "user/mobiles"})
+
+//卡券
+const coupon = (status) => req({url: "coupons?status=" + status})
+
+//卡券分组
+const couponArr = (activityId, status, page) => req({url: "coupons/list", data:{activityId : activityId, status : status, page : page}})
+
+//卡券详情
+const couponinfo = (coupon_id, user_lng, user_lat) => req({url: "coupons/show", data:{coupon_id : coupon_id, user_lng : user_lng, user_lat : user_lat}})
+
+//卡券二维码
+const qrcode = (coupon_id) => req({url: "coupons/qrcode", data:{coupon_id : coupon_id}})
+
+//卡券二维码
+const barcode = (coupon_id) => req({url: "coupons/" + coupon_id + '/barcode'})
+
+//门店列表
+const stores = (coupon_id, province_id, city_id, district_id, title, user_lng, user_lat, page) => req({url: "coupons/new_stores", method: "POST", data:{coupon_id : coupon_id, province_id : province_id || '', city_id : city_id || '', district_id : district_id || '', title : title || '', user_lng : user_lng, user_lat : user_lat, page : page}})
+
+//门店详情
+const storesShow = (store_id, user_lng, user_lat) => req({url: "coupons/store/show", data:{store_id : store_id, user_lng : user_lng, user_lat : user_lat}})
+
+//省市区
+const areas = (psn) => req({url: "areas/children?psn=" + psn})
+
+// 加入微信卡包
+const jssdk = (coupon_id) => req({url: "coupons/jssdk?coupon_id=" + coupon_id})
+
+// 积分卡激活
+const cards = (code, pass) => req({url: "user/cards/activate", method: "POST", data:{code : code, pass : pass}})
+
+// 积分账变记录
+const logs = (type, page) => req({url: "account/logs", data:{type : type, page : page}})
+
+// 冻结列表
+const ungrants = (type,) => req({url: "account/ungrants", data:{type : type}})
+
+// 发送短信
+const send = (mobile, channel, type) => req({url: "sms/send", method: "POST", data:{mobile : mobile, channel : channel, type : type}})
+
+// 领取红包
+const unicom = (mobile, channel, code) => req({url: "unicom/get", method: "POST", data:{mobile : mobile, channel : channel, code : code}})
+
+// 获取商家券信息
+const merchant_card = (coupon_id) => req({url: "coupons/merchant_card", method: "GET", data:{coupon_id : coupon_id}})
+
+export default({
+ index,
+ mobiles,
+ coupon,
+ couponArr,
+ couponinfo,
+ qrcode,
+ barcode,
+ stores,
+ storesShow,
+ areas,
+ jssdk,
+ cards,
+ logs,
+ ungrants,
+ send,
+ unicom,
+ merchant_card
+})
diff --git a/api/request.js b/api/request.js
new file mode 100644
index 0000000..7365d7c
--- /dev/null
+++ b/api/request.js
@@ -0,0 +1,66 @@
+import {errInfo} from './err'
+import {updToken} from './updateToken'
+
+// 请求方式配置
+// https://card.ysd-bs.com
+const api = "https://lifetest.ysd-bs.com/api/" //正式地址
+const header = {
+ "Accept" : "application/json"
+}
+
+/**
+ * 请求
+ * @property {Object} req
+ */
+
+const req = (obj) => {
+ // header
+ if(obj.token){
+ header.Authorization = obj.token || ''
+ } else {
+ header.Authorization = wx.getStorageSync("token") || ""
+ }
+
+ // 处理请求信息
+ return new Promise((resolve, reject) => {
+ // 组合header
+ obj.header = {
+ "Accept" : "application/json",
+ "Authorization" : wx.getStorageSync("token") || ""
+ }
+
+ wx.request({
+ url : api + obj.url,
+ header : obj.header || {},
+ method : obj.method || 'GET',
+ data : obj.data || {},
+ success : res => {
+ // 更新token
+ if (res.header.Authorization) updToken(res.header.Authorization)
+ // 处理信息
+ if (res.data.status_code == 200) {
+ resolve(res.data)
+ } else {
+ if (res.data.status_code == 401 || res.data.status_code == 400) {
+ reject({
+ login : false,
+ codeBeen: false
+ })
+ }
+ errInfo(res.data)
+ }
+ },
+ fail: err => {
+ wx.showToast({
+ title : err.errMsg,
+ icon : "none"
+ })
+ reject(err)
+ }
+ })
+ })
+}
+
+module.exports = {
+ req
+}
diff --git a/api/updateToken.js b/api/updateToken.js
new file mode 100644
index 0000000..8207d76
--- /dev/null
+++ b/api/updateToken.js
@@ -0,0 +1,17 @@
+
+/**
+ * 更新token
+ * @property {String} updToken
+ */
+
+const updToken = (token) =>{
+ // 更新全局存储器
+ getApp().globalData.token = token
+ // 更新客户端登录缓存
+ wx.setStorageSync('token', token)
+}
+
+module.exports = {
+ updToken
+}
+
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..b567e1d
--- /dev/null
+++ b/app.js
@@ -0,0 +1,70 @@
+
+/*
+ * 亿时代
+ */
+
+import api from "api/index"
+
+var QQMapWX = require('utils/qqmap-wx-jssdk.min.js');
+var qqmapsdk;
+
+App({
+ onLaunch() {
+ // 获取系统信息
+ this.globalData.statusBarHeight = wx.getSystemInfoSync().statusBarHeight
+
+ // 检查用户登录状态
+ const token = wx.getStorageSync("token")
+ if (token) {
+ this.globalData.isUser = true
+ }
+
+ this.qqmapsdk = new QQMapWX({
+ key: '4KYBZ-LCAKF-QWOJN-NIDNZ-FZHLZ-2XFW7'
+ })
+
+ // 版本更新提示
+ const updateManager = wx.getUpdateManager()
+
+ updateManager.onUpdateReady(function () {
+ wx.showModal({
+ title : "更新提示",
+ content : "新版本已经准备好,是否重启应用?",
+ confirmText : "重启",
+ cancelColor : "#555",
+ confirmColor: "#26589f",
+ success: res => {
+ if (res.confirm) {
+ updateManager.applyUpdate()
+ }
+ }
+ })
+ })
+
+
+ // 获取系统信息
+ wx.getSystemInfo({
+ success: res=>{
+ this.globalData.systInfo = {
+ statusBarHeight: res.statusBarHeight,
+ safeArea : res.safeArea
+ }
+ }
+ })
+ // 挂载api
+ wx.$api = api
+ },
+ globalData: {
+ isUser : false,
+ userInfo : null,
+ token : "",
+ statusBarHeight : 0,
+ userCurrent : 0,
+ wechatUser : '',
+ city : "",
+ atcity : "",
+ adcode : '',
+ longitude : '',
+ latitude : ''
+ }
+})
\ No newline at end of file
diff --git a/app.json b/app.json
new file mode 100644
index 0000000..b0928fd
--- /dev/null
+++ b/app.json
@@ -0,0 +1,68 @@
+{
+ "pages": [
+ "pages/index/index",
+ "pages/user/user",
+ "pages/coupon/coupon",
+ "pages/couponDetails/couponDetails",
+ "pages/store/store",
+ "pages/storeDetails/storeDetails",
+ "pages/chooseTel/chooseTel",
+ "pages/login/login",
+ "pages/couponArr/couponArr",
+ "pages/rights/rights",
+ "pages/activity/activity",
+ "pages/activityInfo/activityInfo",
+ "pages/address/address",
+ "pages/address_form/address_form",
+ "pages/activityOrder/activityOrder",
+ "pages/activityData/activityData",
+ "pages/order/order",
+ "pages/orderData/orderData",
+ "pages/activate/activate",
+ "pages/account/account",
+ "pages/switchcity/switchcity",
+ "pages/webView/webView",
+ "pages/packet/packet",
+ "pages/frozen/frozen",
+ "pages/welfare/welfare",
+ "pages/classify/classify"
+ ],
+ "window": {
+ "backgroundTextStyle": "light",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTitleText": "亿时代",
+ "navigationBarTextStyle": "black"
+ },
+ "tabBar": {
+ "list": [
+ {
+ "pagePath": "pages/index/index",
+ "text": "首页",
+ "iconPath": "/static/tabBarIcon/00.png",
+ "selectedIconPath": "/static/tabBarIcon/00_active.png"
+ },
+ {
+ "pagePath": "pages/user/user",
+ "text": "我的",
+ "iconPath": "/static/tabBarIcon/01.png",
+ "selectedIconPath": "/static/tabBarIcon/01_active.png"
+ }
+ ],
+ "color": "#b6b9bb",
+ "selectedColor": "#000",
+ "borderStyle": "white"
+ },
+ "style": "v2",
+ "sitemapLocation": "sitemap.json",
+ "permission": {
+ "scope.userLocation": {
+ "desc": "你的位置信息将用于小程序位置接口的效果展示"
+ }
+ },
+ "plugins": {
+ "sendCoupon": {
+ "version" : "1.2.0",
+ "provider": "wxf3f436ba9bd4be7b"
+ }
+ }
+}
\ No newline at end of file
diff --git a/app.wxss b/app.wxss
new file mode 100644
index 0000000..00d27c0
--- /dev/null
+++ b/app.wxss
@@ -0,0 +1,96 @@
+/**app.wxss**/
+page {
+ background: #f7f7f7;
+}
+
+/* 下边框 */
+.uni-border-top,
+.uni-border-bottom {
+ position: relative;
+}
+
+.uni-border-top::after,
+.uni-border-bottom::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #f3f3f3;
+}
+
+.uni-border-top::after {
+ top: 0;
+}
+
+.uni-border-bottom::after {
+ bottom: 0;
+}
+
+/*
+ * 文字截取
+ */
+
+.nowrap {
+ max-width: 100%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.nowrap-multi {
+ display: -webkit-box;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+
+/*
+ * 水平居中
+ */
+
+.pack-center {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-box-pack: center;
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ z-index: -1;
+}
+
+/*
+* 页面信息提醒
+*/
+
+.pages-hint {
+ text-align: center;
+ color: #747788;
+ font-size: 28rpx;
+ background: white;
+}
+
+.pages-hint image {
+ width: 188rpx;
+ height: 188rpx;
+}
+
+
+
+/* 上拉加载 */
+.pagesLoding{
+ text-align: center;
+ line-height: 90rpx;
+ color: gray;
+}
+
+.pagesLoding-icon{
+ width: 28rpx;
+ height: 28rpx;
+ vertical-align: middle;
+ margin-right: 10rpx;
+ margin-bottom: 3rpx;
+}
\ No newline at end of file
diff --git a/pages/account/account.js b/pages/account/account.js
new file mode 100644
index 0000000..0f66061
--- /dev/null
+++ b/pages/account/account.js
@@ -0,0 +1,83 @@
+// pages/account/account.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type : '', //卡类型
+ number : '', //账户余额
+ accounts : '', //账户列表
+ blockeds : '', //待发放余额
+ page : {}, //分页信息
+ lodingStats : false, //加载状态
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ type : options.type
+ })
+ },
+
+ onShow() {
+ // 获取账变记录
+ this.accountInfo();
+ },
+
+ /**
+ * 账变记录
+ */
+ accountInfo(page) {
+ wx.$api.user.logs(this.data.type, page).then(res=>{
+ //判断金卡、银卡、钻石卡
+ let number
+ if(this.data.type == "silver") {
+ number = res.data.account.silver
+ } else if(this.data.type == "gold") {
+ number = res.data.account.gold
+ } else if(this.data.type == "drill") {
+ number = res.data.account.drill
+ } else {
+ return
+ }
+
+ let listArr = this.data.accounts,
+ newData = []
+ if(page == 1 || page == undefined) listArr = []
+ newData = listArr.concat(res.data.data)
+
+ this.setData({
+ number : number,
+ blockeds : res.data.blockeds,
+ accounts : newData,
+ page : res.data.page
+ })
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+ // 获取账变记录
+ this.accountInfo();
+ },
+
+ /**
+ * 上拉加载
+ */
+ onReachBottom(){
+ this.setData({
+ lodingStats: true
+ })
+ let pageNumber = this.data.page.current
+ if(this.data.page.has_more){
+ pageNumber++
+ // 获取账变记录
+ this.accountInfo(pageNumber);
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/account/account.json b/pages/account/account.json
new file mode 100644
index 0000000..54ed85e
--- /dev/null
+++ b/pages/account/account.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "账变记录",
+ "navigationBarBackgroundColor": "#dfb48b",
+ "navigationBarTextStyle": "white"
+}
\ No newline at end of file
diff --git a/pages/account/account.wxml b/pages/account/account.wxml
new file mode 100644
index 0000000..676387b
--- /dev/null
+++ b/pages/account/account.wxml
@@ -0,0 +1,57 @@
+
+
+
+ 白金账户余额
+
+ 钻石账户余额
+
+
+
+ 可用余额
+ {{number}}
+ 可用余额,入账记录
+
+
+ 待发放
+ {{blockeds}}
+ 立即查询
+
+
+
+
+
+ 入账记录
+
+
+
+ {{item.title}}
+
+
+ {{item.variable}}
+
+
+
+
+ 有效期:
+ {{item.created_at}} 至 {{item.expired_at}}
+
+
+
+
+
+
+ 加载中...
+
+
+ 没有更多了~
+
+
+
+
+
+
+
+ 抱歉,目前暂无内容~
+
\ No newline at end of file
diff --git a/pages/account/account.wxss b/pages/account/account.wxss
new file mode 100644
index 0000000..d643194
--- /dev/null
+++ b/pages/account/account.wxss
@@ -0,0 +1,155 @@
+/* 积分 */
+.integra-cont-name {
+ padding: 40rpx 20rpx 10rpx;
+ font-weight: 600;
+}
+
+.integra-list {
+ background: #fff;
+ border-radius: 10rpx;
+ width: calc(100% - 40rpx);
+ margin: 20rpx;
+ box-sizing: border-box;
+}
+
+.integra-top {
+ padding: 30rpx 20rpx 0;
+ background-color: #dfb48b;
+ border-radius: 0 0 100rpx 100rpx;
+}
+
+.integra-name {
+ color: #fff;
+ font-size: 32rpx;
+ margin-bottom: 30rpx;
+}
+
+.integra-title {
+ margin-bottom: 20rpx;
+}
+
+.integra-number {
+ font-size: 40rpx;
+}
+
+.integra-btn {
+ font-size: 28rpx;
+ margin-top: 20rpx;
+ color: #adadad;
+ display: flex;
+}
+
+.integra-btn text {
+ color: #dfb48b;
+}
+
+.integra-btn image {
+ width: 36rpx;
+ height: 36rpx;
+ margin-top: 2rpx;
+}
+
+.integra-blue {
+ color: #317afa;
+}
+
+.integra-info {
+ background-color: #fff;
+ text-align: center;
+ border-radius: 20rpx;
+ display: flex;
+ box-shadow: 0 10rpx 10rpx rgba(0, 0, 0, .1);
+ padding: 30rpx 20rpx;
+ box-sizing: border-box;
+ text-align: left;
+}
+
+.integra-right {
+ flex: 2;
+ position: relative;
+}
+
+.integra-right::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ top: 0;
+ background-color: #eeeeee;
+ width: 2rpx;
+ height: 100%;
+}
+
+.integra-right:first-child {
+ padding-right: 20rpx;
+ box-sizing: border-box;
+}
+
+.integra-right:last-child {
+ padding-left: 30rpx;
+ box-sizing: border-box;
+}
+
+.integra-right:first-child::after {
+ display: none;
+}
+
+.integra-list {
+ padding: 30rpx 20rpx;
+ position: relative;
+ box-sizing: border-box;
+}
+
+.integra-list::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #eaeaea;
+}
+
+.integra-list:last-child::after {
+ display: none;
+}
+
+.integra-text {
+ display: flex;
+ margin-bottom: 20rpx;
+}
+
+.integra-title {
+ flex: 1;
+ font-size: 30rpx;
+ display: flex;
+}
+
+.integra-title text {
+ flex: 1;
+}
+
+.integra-title image {
+ width: 36rpx;
+ height: 36rpx;
+}
+
+.integra-oints {
+ color: #f0a479;
+}
+
+.integra-date {
+ display: flex;
+}
+
+.integra-time:last-child{
+ box-sizing: border-box;
+}
+
+.integra-time {
+ color: #999;
+ font-size: 28rpx;
+}
+
+.integra-time text {
+ color: #000;
+}
\ No newline at end of file
diff --git a/pages/activate/activate.js b/pages/activate/activate.js
new file mode 100644
index 0000000..c080a14
--- /dev/null
+++ b/pages/activate/activate.js
@@ -0,0 +1,70 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ carmi: '' //卡密
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ },
+
+ /**
+ * 卡激活
+ */
+ cardform(e) {
+ let code = e.detail.value.code,
+ pass = this.data.carmi
+
+ wx.$api.user.cards(code, pass).then(res=>{
+ if(res.data.type == "silver") {
+ app.globalData.userCurrent = 0
+ }else if(res.data.type == "gold") {
+ app.globalData.userCurrent = 1
+ }else if(res.data.type == "drill") {
+ app.globalData.userCurrent = 2
+ }else {
+ return
+ }
+
+ // 写入缓存
+ wx.setStorage({
+ key : 'current',
+ data : app.globalData.userCurrent
+ })
+
+ wx.showToast({
+ title: res.data.message,
+ icon : 'none'
+ })
+ setTimeout(()=>{
+ wx.switchTab({
+ url: '/pages/user/user'
+ })
+ },2000)
+ })
+ },
+
+ /**
+ * 获取卡密
+ */
+ carmiTab(e){
+ var number = e.detail.value
+ var change = number.replace(/(\d{4})(?=\d)/g, "$1-");//replace(/\s/g,'');
+ this.setData({
+ carmi: change
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/activate/activate.json b/pages/activate/activate.json
new file mode 100644
index 0000000..286a508
--- /dev/null
+++ b/pages/activate/activate.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "卡激活"
+}
\ No newline at end of file
diff --git a/pages/activate/activate.wxml b/pages/activate/activate.wxml
new file mode 100644
index 0000000..57ddcfd
--- /dev/null
+++ b/pages/activate/activate.wxml
@@ -0,0 +1,29 @@
+
+
+
+
+ 消费红包【储值卡】
+
+
+ 温馨提示:
+
+ 尊敬的会员:储值后,将开启您,愉快的消费之旅!
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/activate/activate.wxss b/pages/activate/activate.wxss
new file mode 100644
index 0000000..157abdd
--- /dev/null
+++ b/pages/activate/activate.wxss
@@ -0,0 +1,129 @@
+/* 卡激活 */
+.activate-back {
+ width: 100%;
+ height: 100vh;
+ left: 0;
+ top: 0;
+ position: relative;
+}
+
+.activate-img {
+ position: relative;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 2;
+}
+
+.activate-cont {
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding: 60rpx;
+ width: 100%;
+ box-sizing: border-box;
+ z-index: 9;
+}
+
+.activate-title {
+ font-size: 60rpx;
+ font-weight: 600;
+ text-align: center;
+ margin: 20rpx 0 100rpx;
+}
+
+.activate-label, .activate-pass {
+ margin-bottom: 60rpx;
+}
+
+.activate-label label, .activate-pass label {
+ margin-bottom: 40rpx;
+ display: block;
+ font-weight: 600;
+ font-size: 34rpx;
+}
+
+.activate-label input, .activate-pass input {
+ background: rgba(255, 255, 255, .3);
+ border-radius: 60rpx;
+ height: 90rpx;
+ line-height: 90rpx;
+ padding: 0 1rem;
+ box-sizing: border-box;
+ box-shadow: inset -2px 2px 4px 1.5px rgba(0, 0, 0, 0.7);
+}
+
+.activate-label input {
+ width: 100%;
+}
+
+.activate-label text {
+ display: block;
+ font-size: 32rpx;
+ margin-top: 10rpx;
+ font-weight: normal;
+}
+
+.activate-entry {
+ display: flex;
+ line-height: 80rpx;
+ color: #fff;
+ font-weight: 600;
+}
+
+.activate-entry input {
+ background: #fff;
+ border-radius: 60rpx;
+ width: calc(25% - 1rem);
+ margin: 0 .5rem;
+ height: 80rpx;
+ line-height: 80rpx;
+}
+
+.activate-btn {
+ width: 100%;
+ height: 90rpx;
+ border: none;
+ margin: 2rem 0 2.2rem;
+}
+
+.activate-btn button {
+ width: 100% !important;
+ height: 100%;
+ line-height: 90rpx;
+ border-radius: 50rpx;
+ background: #000;
+ border: none;
+ font-size: 40rpx;
+ color: #fff;
+ margin: 0;
+ padding: 0;
+}
+
+.activate-tips {
+ color: #000;
+ font-weight: 600;
+ font-size: 32rpx;
+}
+
+.activate-tips-text {
+ line-height: 46rpx;
+ margin-top: 20rpx;
+}
+
+.activate-tips-img {
+ width: 240rpx;
+ height: 240rpx;
+ border-radius: 50%;
+ margin: 2rem auto 0;
+}
+
+.activate-tips-img image {
+ width: 100%;
+ height: 100%;
+}
+
+.activate-tips-text {
+ text-indent: 2rem;
+}
\ No newline at end of file
diff --git a/pages/activity/activity.js b/pages/activity/activity.js
new file mode 100644
index 0000000..997570f
--- /dev/null
+++ b/pages/activity/activity.js
@@ -0,0 +1,53 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isUser : false, //用户登录状态
+ indexArr : '', //商品列表
+ page : '', //下一页
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ if(app.globalData.isUser){
+ this.setData({
+ isUser: app.globalData.isUser
+ })
+ }
+
+ wx.$api.index.redwine().then(res=>{
+ this.setData({
+ indexArr : res.data.data,
+ page : res.data.page
+ })
+ })
+ },
+
+ /**
+ * 处理未登录时的转跳
+ */
+ userNav(e){
+ let pageUrl = e.currentTarget.dataset.url
+ if(this.data.isUser){
+ wx.navigateTo({
+ url: pageUrl
+ })
+ }else{
+ // 去登录
+ wx.navigateTo({
+ url: "/pages/login/login?way=activity"
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/activity/activity.json b/pages/activity/activity.json
new file mode 100644
index 0000000..951f122
--- /dev/null
+++ b/pages/activity/activity.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "产品活动"
+}
\ No newline at end of file
diff --git a/pages/activity/activity.wxml b/pages/activity/activity.wxml
new file mode 100644
index 0000000..24137bd
--- /dev/null
+++ b/pages/activity/activity.wxml
@@ -0,0 +1,7 @@
+
+
+ 商品列表
+
+
+
+
\ No newline at end of file
diff --git a/pages/activity/activity.wxss b/pages/activity/activity.wxss
new file mode 100644
index 0000000..f9ea2f9
--- /dev/null
+++ b/pages/activity/activity.wxss
@@ -0,0 +1,36 @@
+/* 活动列表 */
+.activityTitle {
+ background: #000;
+ color: #fff;
+ border-radius: 40rpx 14rpx 14rpx 40rpx;
+ margin: 20rpx 24rpx 0;
+ padding: 10rpx;
+ width: 190rpx;
+ box-sizing: border-box;
+ display: flex;
+ font-size: 28rpx;
+}
+
+.activityTitle image {
+ width: 40rpx;
+ height: 40rpx;
+ margin-right: 5rpx;
+}
+
+.activityList {
+ width: calc(100% - 40rpx);
+ margin: 30rpx 20rpx;
+ box-sizing: border-box;
+ position: relative;
+ padding-top: 40%;
+}
+
+/* 5:2 */
+.activityList image {
+ border-radius: 10rpx;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/pages/activityData/activityData.js b/pages/activityData/activityData.js
new file mode 100644
index 0000000..517cd4c
--- /dev/null
+++ b/pages/activityData/activityData.js
@@ -0,0 +1,138 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ statusHeight : app.globalData.statusBarHeight,
+ order : '' //订单详情
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+
+ // 获取商品活动订单详情
+ this.orderInfo(options.id);
+ },
+
+ /**
+ * 商品活动订单详情
+ */
+ orderInfo(id) {
+ wx.$api.index.ordersInfo(id).then(res=>{
+ this.setData({
+ order : res.data
+ })
+ })
+ },
+
+ /**
+ * 取消订单
+ */
+ orderDelete(e) {
+ let orderId = e.currentTarget.dataset.id
+ wx.showModal({
+ title : '订单取消',
+ content : '确认取消吗?',
+ success : res=> {
+ if (res.confirm) {
+ wx.$api.index.cance(orderId).then(res=>{
+ wx.showToast({
+ title: res.data,
+ icon : 'none'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ },2000)
+ })
+ } else if (res.cancel) {
+ wx.showToast({
+ title : '取消',
+ icon : 'loading',
+ duration: 1000
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 订单支付
+ */
+ orderPay(e) {
+ let orderId = e.currentTarget.dataset.id
+
+ wx.login({
+ success: res=> {
+ wx.$api.index.repay(orderId).then(res=>{
+ let payInfo = JSON.parse(res.data.json)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ },2000)
+ }
+ },
+ fail : res=>{
+ wx.reLaunch({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ }
+ })
+ })
+ }
+ })
+ },
+
+ /**
+ * 返回上一页
+ */
+ orderRun() {
+ wx.navigateBack({
+ delta: 1
+ })
+ },
+
+ /**
+ * 复制快递单号
+ */
+ copyText (e) {
+ let text = e.currentTarget.dataset.text
+ wx.setClipboardData({
+ data : text,
+ success : res=> {
+ wx.getClipboardData({
+ success: res => {
+ wx.showToast({
+ title: '复制成功'
+ })
+ }
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/activityData/activityData.json b/pages/activityData/activityData.json
new file mode 100644
index 0000000..87ee6d0
--- /dev/null
+++ b/pages/activityData/activityData.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "订单详情",
+ "navigationBarBackgroundColor": "#f57e32",
+ "navigationBarTextStyle": "white"
+}
\ No newline at end of file
diff --git a/pages/activityData/activityData.wxml b/pages/activityData/activityData.wxml
new file mode 100644
index 0000000..350576b
--- /dev/null
+++ b/pages/activityData/activityData.wxml
@@ -0,0 +1,115 @@
+
+
+ {{order.status_text}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 收货人:{{order.address.name}}
+ {{order.address.mobile}}
+
+ {{order.address.province}}{{order.address.city}}{{order.address.district}}{{order.address.info}}
+
+
+
+
+
+
+
+ {{order.title}}
+ ¥{{order.param.price}}
+ ×{{order.param.number}}
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥{{item.amount}}
+
+
+ 超市券满减券
+
+ 赠
+
+
+ {{item.title}}
+
+ 卡数(张)
+ x {{item.number}}
+
+
+
+
+
+
+
+
+
+
+ 赠
+
+
+ {{item.title}}
+ {{item.subtitle}}
+ 原价:{{item.amount}}元
+
+ 活动:0.00元
+ x {{item.number}}
+
+
+
+
+
+
+
+ 订单号
+ {{order.order_id}}
+
+
+
+
+
+ 物流公司
+ {{order.ex_type_text}}
+
+
+
+
+ 快递单号
+ {{order.ex_no}}
+
+
+
+
+
+ 实际支付
+ ¥{{order.amount}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/activityData/activityData.wxss b/pages/activityData/activityData.wxss
new file mode 100644
index 0000000..e50e247
--- /dev/null
+++ b/pages/activityData/activityData.wxss
@@ -0,0 +1,427 @@
+
+/*
+ * 亿时代
+ */
+ .order-statl{
+ background-color: #f57e32;
+ padding: 0 30rpx 10rpx;
+ color: white;
+ line-height: 90rpx;
+ height: 90rpx;
+ position: relative;
+}
+
+.order-statl-icon{
+ width: 80rpx;
+ height: 80rpx;
+ vertical-align: middle;
+ position: absolute;
+ right: 30rpx;
+ top: 5rpx;
+}
+
+ /* 收货人信息 */
+.order-address{
+ padding: 30rpx 30rpx 30rpx 100rpx;
+ position: relative;
+ background: white;
+}
+
+.order-address-back{
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ vertical-align:bottom;
+}
+
+.order-address-name{
+ padding-right: 300rpx;
+ position: relative;
+ font-size: 33rpx;
+ padding-bottom: 10rpx;
+}
+
+.order-address-name text{
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 280rpx;
+ text-align: right;
+}
+
+.order-address-text{
+ color: #464854;
+ font-size: 26rpx;
+}
+
+.address-icon,
+.arrows-right{
+ position: absolute;
+}
+
+.address-icon{
+ height: 42rpx;
+ width: 42rpx;
+ left: 30rpx;
+ top: calc(50% - 26rpx);
+ top: -webkit-calc(50% - 26rpx);
+}
+
+.arrows-right{
+ height: 28rpx;
+ width: 28rpx;
+ right: 30rpx;
+ top: calc(50% - 19rpx);
+ top: -webkit-calc(50% - 19rpx);
+}
+
+.order-add-address{
+ text-align: center;
+ padding: 30rpx 0;
+}
+
+.order-add-address navigator{
+ display: inline-block;
+ background: #e92344;
+ color: white;
+ line-height: 60rpx;
+ padding: 0 30rpx;
+ margin-right: 20rpx;
+}
+
+/* 订单商品 */
+
+.order-content{
+ border-bottom: solid 100rpx transparent;
+}
+
+.order-goods{
+ margin-bottom: 20rpx;
+}
+
+.goods-goods-mall{
+ padding: 20rpx 30rpx 0 30rpx;
+ line-height: 50rpx;
+}
+
+.goods-goods-mall image{
+ width: 48rpx;
+ height: 48rpx;
+ vertical-align: middle;
+ margin-right: 15rpx;
+ margin-bottom: 2rpx;
+}
+
+.goods-goods-li{
+ padding: 20rpx 30rpx;
+ position: relative;
+ border-bottom: solid 1rpx #f2f2f2;
+ min-height: 130rpx;
+ background: white;
+}
+
+.goods-goods-li:last-child{
+ border-bottom: none;
+}
+
+.goods-img{
+ position: absolute;
+ top: 20rpx;
+ left: 30rpx;
+ height: 130rpx;
+ width: 130rpx;
+ background: #f5f6fa;
+}
+
+.goods-body{
+ padding-left: 150rpx;
+}
+
+.goods-name{
+ font-weight: bold;
+ padding: 10rpx 0 20rpx;
+}
+
+.goods-price{
+ color: #e92344;
+}
+
+.goods-qty{
+ color: gray;
+ font-weight: normal;
+ padding-left: 10rpx;
+ font-size: 28rpx;
+}
+
+.goods-params{
+ color: gray;
+ padding-bottom: 20rpx;
+ font-size: 28rpx;
+}
+
+/* 统计信息 */
+
+.order-total{
+ background: white;
+ margin: 20rpx 0;
+}
+
+.order-total-li{
+ padding: 0 30rpx;
+ line-height: 90rpx;
+ position: relative;
+ font-size: 28rpx;
+}
+
+.order-total-li::before{
+ position: absolute;
+ content: " ";
+ left: 30rpx;
+ bottom: 0;
+ right: 0;
+ height: 1rpx;
+ background: #f2f2f2;
+}
+
+.order-total-li:last-child::before{
+ display: none;
+}
+
+.order-total-li text{
+ float: right;
+ color: #999;
+}
+
+.order-total-li .redCor {
+ color: #e92344;
+ font-size: 32rpx;
+}
+
+
+
+/* 购物券 */
+.goodsCoupon {
+ background: #fff;
+ padding: 20rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.goodsCoupon-right {
+ width: calc(100% - 270rpx);
+ position: absolute;
+ left: 250rpx;
+ top: 20rpx;
+ right: 20rpx;
+}
+
+.goodsCoupon-text {
+ color: #999;
+ font-size: 26rpx;
+ margin-bottom: 24rpx;
+}
+
+.goodsCoupon-name {
+ margin-bottom: 40rpx;
+ font-size: 32rpx;
+}
+
+.goodsCoupon-name-box {
+ margin-bottom: 10rpx;
+}
+
+.goodsCoupon-sheet {
+ display: flex;
+ font-size: 28rpx;
+ color: #999;
+}
+
+.goodsCoupon-cost {
+ color: #000;
+ font-size: 28rpx;
+ margin: 14rpx 0;
+}
+
+.goodsCoupon-price {
+ font-size: 28rpx;
+ color: #f57e32;
+}
+
+.goodsCoupon-sheet view {
+ display: inline-block;
+ flex: 1;
+}
+
+.goodsCoupon-sheet text {
+ font-size: 24rpx;
+ line-height: 40rpx;
+ padding-right: 6rpx;
+}
+
+
+.goodsCoupon-left {
+ position: relative;
+ width: 200rpx;
+ height: 130rpx;
+}
+
+.goodsCoupon-box {
+ width: 200rpx;
+ height: 200rpx;
+}
+
+.goodsBox-img {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.goodsCoupon-img {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.goodsCoupon-number {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 2;
+ width: 100%;
+ text-align: center;
+ font-size: 40rpx;
+ color: #f57e32;
+ height: 94rpx;
+ line-height: 94rpx;
+ font-weight: 600;
+}
+
+.goodsCoupon-number text {
+ font-size: 28rpx;
+}
+
+.goodsCoupon-btn {
+ position: absolute;
+ right: 10rpx;
+ left: 10rpx;
+ bottom: 4rpx;
+ z-index: 2;
+ background: #f57e32;
+ color: #fff;
+ font-size: 24rpx;
+ width: calc(100% - 20rpx);
+ text-align: center;
+ height: 40rpx;
+ line-height: 40rpx;
+ border-radius: 30rpx;
+ transform: scale(0.83, 0.83);
+}
+
+.goodsCoupon-tips {
+ position: absolute;
+ top: -4rpx;
+ left: 10rpx;
+ z-index: 2;
+ color: #fff;
+ transform: rotate(-45deg);
+}
+
+.goodsCoupon-tips text {
+ transform: scale(0.83, 0.83);
+ font-size: 24rpx;
+ display: inline-block;
+}
+
+.goodsBox-tips {
+ display: inline-block;
+ width: 49rpx;
+ padding: 8rpx 0 6rpx 0;
+ background: #EDBA19;
+ top: -10rpx;
+ left: 10rpx;
+ position: absolute;
+ text-align: center;
+ border-top-left-radius: 4rpx;
+ font-size: 24rpx;
+ color: #ffff;
+ transform: scale(.9, .9);
+}
+
+.goodsBox-tips:before, .goodsBox-tips:after {
+ content: "";
+ position: absolute;
+}
+
+.goodsBox-tips:before {
+ height: 0;
+ width: 0;
+ border-bottom: 10rpx solid #745800;
+ border-right: 10rpx solid transparent;
+ right: -10rpx;
+ top: 0;
+}
+
+.goodsBox-tips:after {
+ height: 0;
+ width: 0;
+ border-left: 25rpx solid #EDBA19;
+ border-right: 25rpx solid #EDBA19;
+ border-bottom: 25rpx solid transparent;
+ bottom: -22rpx;
+ left: 0;
+}
+
+.goodsLabel {
+ background: #fff;
+ text-align: right;
+ padding: 20rpx;
+ font-size: 32rpx;
+}
+
+.goodsLabel text {
+ font-weight: 600;
+}
+
+
+/* 底部工具栏 */
+.order-data-footer{
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ border-top: solid 1rpx #f2f2f2;
+ padding-top: 17rpx;
+ padding-right: 30rpx;
+ padding-left: 30rpx;
+ height: 83rpx;
+ background: white;
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction:row-reverse;
+}
+
+.order-data-footer.iphoneX {
+ padding-bottom: 30rpx;
+}
+
+.order-btn{
+ margin-left: 20rpx;
+ height: 54rpx;
+ line-height: 50rpx;
+ box-sizing: border-box;
+ border:solid 1rpx #747788;
+ padding: 0 20rpx;
+ font-size: 26rpx;
+ border-radius: 40rpx;
+ margin-top: 10rpx;
+}
+
+.order-btn-back {
+ border-color: #f57e32;
+ color: #f57e32;
+}
\ No newline at end of file
diff --git a/pages/activityInfo/activityInfo.js b/pages/activityInfo/activityInfo.js
new file mode 100644
index 0000000..45cfc96
--- /dev/null
+++ b/pages/activityInfo/activityInfo.js
@@ -0,0 +1,183 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isUser : false, //用户登录状态
+ indexId : '', //tab状态
+ indexArr : '', //商品列表
+ page : '', //下一页
+ address : '', //收货地址
+ goodId : '', //商品id
+ goodCont : '', //商品信息
+ params : '', //商品数量组
+ paramsIndex : 0,
+ platIndex : 0, //选择提交方式下标
+ platformCp :[ //选择提交数组
+ {
+ id : 0,
+ name : '快递'
+ },
+ {
+ id : 1,
+ name : '自提'
+ }
+ ],
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+
+ // this.setData({
+ // goodId: options.id
+ // })
+
+ if(app.globalData.isUser){
+ this.setData({
+ isUser: app.globalData.isUser
+ })
+ }
+
+ // 活动商品列表
+ wx.$api.index.redwine().then(res=>{
+ this.setData({
+ indexArr : res.data.data,
+ indexId : res.data.data[1].id,
+ page : res.data.page
+ })
+
+ // 获取商品信息
+ this.redwineInfo(res.data.data[1].id)
+ })
+ },
+
+ /**
+ * 商品信息
+ */
+ redwineInfo(id) {
+ wx.$api.index.redwinePay(id).then(res=>{
+ this.setData({
+ address : res.data.address,
+ goodCont : res.data.good,
+ params : res.data.params,
+ paramsIndex : res.data.params.findIndex(val => val.def == 1)
+ })
+ })
+ },
+
+ /**
+ * 商品数量选择
+ */
+ goodsNumber(e) {
+ let onType = e.currentTarget.dataset.type,
+ atIndex = this.data.paramsIndex
+ // atIndex = this.data.params.findIndex(val => val.number == this.data.qty)
+ if(onType == 'plus' && atIndex < this.data.params.length - 1){
+ atIndex++
+ }else if(onType == 'remove' && atIndex >= 1){
+ atIndex--
+ }else{
+ return
+ }
+ this.setData({
+ paramsIndex: atIndex
+ })
+ },
+
+ /**
+ * 选择提交方式
+ */
+ platBind(e) {
+ this.setData({
+ platIndex : e.detail.value
+ })
+ },
+
+ /**
+ * 订单提交
+ */
+ submitOrder() {
+ let good_id = this.data.indexId,
+ param_id = this.data.params[this.data.paramsIndex].id,
+ address_id = this.data.address.id,
+ islogistics = this.data.platIndex
+
+ wx.login({
+ success: res=> {
+ wx.$api.index.payment(good_id, param_id, address_id, islogistics).then(res=>{
+ let payInfo = JSON.parse(res.data.json)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ },2000)
+ }
+ },
+ fail : res=>{
+ wx.reLaunch({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ }
+ })
+ })
+ }
+ })
+ },
+
+ /**
+ * 选择tab
+ */
+ orderTab(e) {
+ let indexId = e.currentTarget.dataset.id
+ if (indexId != this.data.indexId) {
+ this.setData({
+ indexId : indexId
+ })
+ }
+ // 获取商品信息
+ this.redwineInfo(indexId)
+ },
+
+ /**
+ * 点击图片放大
+ */
+ clickImg(e) {
+ let imgUrl = e.currentTarget.dataset.img
+ wx.previewImage({
+ urls : [imgUrl], //需要预览的图片http链接列表,注意是数组
+ current : '' // 当前显示图片的http链接,默认是第一个
+ })
+ },
+
+ /**
+ * 处理未登录时的转跳
+ */
+ loginGo(e){
+ wx.navigateTo({
+ url: "/pages/login/login?way=activity"
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/activityInfo/activityInfo.json b/pages/activityInfo/activityInfo.json
new file mode 100644
index 0000000..f7eceee
--- /dev/null
+++ b/pages/activityInfo/activityInfo.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "商品购买"
+}
\ No newline at end of file
diff --git a/pages/activityInfo/activityInfo.wxml b/pages/activityInfo/activityInfo.wxml
new file mode 100644
index 0000000..625063a
--- /dev/null
+++ b/pages/activityInfo/activityInfo.wxml
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+ 收货人:{{address.name}}{{address.mobile}}
+
+ 收货地址:{{address.all_address}}
+
+
+
+
+
+ 添加地址
+
+
+
+
+
+
+
+
+
+
+ {{item.classtitle}}
+
+
+
+
+
+
+ 平安好车主超级福利专享
+
+
+
+
+
+
+
+ {{goodCont.title}}
+ {{goodCont.subtitle}}
+
+ ¥{{params[paramsIndex].price}}
+
+ -
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥{{item.amount}}
+
+
+ 比优特电子券
+
+ 赠
+
+
+ {{item.title}}
+
+ 卡数(张)
+ x {{item.number}}
+
+
+
+
+
+
+
+
+
+
+ 赠
+
+
+ {{item.title}}
+ {{item.subtitle}}
+ 原价:{{item.amount}}元
+
+ 活动:0.00元
+ x {{item.number}}
+
+
+
+
+
+
+
+ 小计¥{{params[paramsIndex].amount}}
+
+
+
+ 请选择提交方式
+
+
+
+ {{platformCp[platIndex].name}}
+
+
+
+
+
+
+
+ 快递
+
+ 免运费 包邮
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/activityInfo/activityInfo.wxss b/pages/activityInfo/activityInfo.wxss
new file mode 100644
index 0000000..bca5656
--- /dev/null
+++ b/pages/activityInfo/activityInfo.wxss
@@ -0,0 +1,575 @@
+/* 收货地址 */
+.borderBottom {
+
+ border-bottom: 110rpx solid transparent;
+}
+
+.order-address {
+ padding: 20rpx 80rpx 30rpx 100rpx;
+ position: relative;
+ background: white;
+}
+
+.order-address-back {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ vertical-align: bottom;
+}
+
+.order-address-name {
+ padding-right: 300rpx;
+ position: relative;
+ font-size: 33rpx;
+ padding-bottom: 10rpx;
+}
+
+.order-address-name text {
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 280rpx;
+ text-align: right;
+}
+
+.order-address-text {
+ color: #464854;
+ font-size: 26rpx;
+}
+
+.address-icon,
+.arrows-right {
+ position: absolute;
+}
+
+.address-icon {
+ height: 42rpx;
+ width: 42rpx;
+ left: 30rpx;
+ top: calc(50% - 26rpx);
+ top: -webkit-calc(50% - 26rpx);
+}
+
+.arrows-right {
+ height: 28rpx;
+ width: 28rpx;
+ right: 30rpx;
+ top: calc(50% - 19rpx);
+ top: -webkit-calc(50% - 19rpx);
+}
+
+.order-add-address {
+ text-align: center;
+ padding: 30rpx 0;
+}
+
+.order-add-address navigator {
+ display: inline-block;
+ background: #f57e32;
+ color: white;
+ line-height: 60rpx;
+ padding: 0 30rpx;
+ margin-right: 20rpx;
+ font-size: 28rpx;
+ border-radius: 4rpx;
+}
+
+
+.order-add-address-img {
+ width: 25rpx;
+ height: 25rpx;
+ margin-right: 10rpx;
+ vertical-align: -2rpx;
+}
+
+/* 订单商品 */
+
+.order-goods {
+ margin: 0 0 20rpx;
+}
+
+.order-content {
+ border-bottom: solid 100rpx transparent;
+}
+
+.goods-goods-mall {
+ padding: 20rpx 30rpx 0 30rpx;
+ line-height: 50rpx;
+}
+
+.goods-goods-mall image {
+ width: 48rpx;
+ height: 48rpx;
+ vertical-align: middle;
+ margin-right: 15rpx;
+ margin-bottom: 2rpx;
+}
+
+.goods-goods-li {
+ padding: 20rpx 30rpx;
+ position: relative;
+ background: white;
+ display: flex;
+ height: 200rpx;
+}
+
+.goods-img {
+ position: absolute;
+ top: 20rpx;
+ left: 20rpx;
+ height: 200rpx;
+ width: 200rpx;
+ background: #f5f6fa;
+ border-radius: 4rpx;
+}
+
+.goods-body {
+ padding-left: 220rpx;
+ width: calc(100% - 220rpx);
+}
+
+.goods-name {
+ font-weight: bold;
+ padding-bottom: 20rpx;
+ font-size: 32rpx;
+}
+
+.goods-cont {
+ display: flex;
+}
+
+.goods-text {
+ color: #999;
+ font-size: 28rpx;
+ margin-bottom: 40rpx;
+}
+
+.goods-price {
+ flex: 1;
+ line-height: 50rpx;
+ font-size: 36rpx;
+ font-weight: 600;
+ color: #f57e32;
+}
+
+.goods-price text {
+ font-size: 26rpx;
+}
+
+.good-number {
+ display: flex;
+ width: 180rpx;
+ text-align: center;
+ height: 50rpx;
+}
+
+.good-number-btn {
+ width: 50rpx;
+ color: #000;
+ font-weight: 600;
+}
+
+.good-number-input {
+ flex: 1;
+ margin: 0 6rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ color: #000;
+ font-size: 26rpx;
+}
+
+.good-number-input {
+ background: #f7f7f7;
+ font-size: 24rpx;
+}
+
+.good-number-btn {
+ background: #f0f0f0;
+}
+
+/* 购物券 */
+.goodsCoupon {
+ background: #fff;
+ padding: 20rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.goodsCoupon-right {
+ width: calc(100% - 270rpx);
+ position: absolute;
+ left: 250rpx;
+ top: 30rpx;
+ right: 20rpx;
+}
+
+.goodsCoupon-name {
+ margin-bottom: 30rpx;
+ font-size: 32rpx;
+}
+
+.goodsCoupon-text {
+ color: #999;
+ font-size: 26rpx;
+ margin-bottom: 24rpx;
+}
+
+.goodsCoupon-name-box {
+ margin-bottom: 10rpx;
+}
+
+.goodsCoupon-sheet {
+ display: flex;
+ font-size: 30rpx;
+ color: #999;
+}
+
+.goodsCoupon-cost {
+ color: #000;
+ font-size: 28rpx;
+ margin: 14rpx 0;
+}
+
+.goodsCoupon-price {
+ font-size: 28rpx;
+ color: #f57e32;
+}
+
+.goodsCoupon-box-right {
+ top: 16rpx;
+}
+
+.goodsCoupon-sheet view {
+ display: inline-block;
+ flex: 1;
+}
+
+.goodsCoupon-sheet text {
+ font-size: 24rpx;
+ line-height: 44rpx;
+ padding-right: 6rpx;
+}
+
+.goodsCoupon-left {
+ position: relative;
+ width: 200rpx;
+ height: 140rpx;
+}
+
+.goodsCoupon-box {
+ width: 200rpx;
+ height: 200rpx;
+}
+
+.goodsBox-img {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.goodsCoupon-img {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.goodsCoupon-number {
+ position: absolute;
+ top: 20rpx;
+ left: 0;
+ z-index: 2;
+ width: 100%;
+ text-align: center;
+ font-size: 40rpx;
+ color: #fff;
+ font-weight: 600;
+ text-shadow: 2rpx 2rpx 2rpx #d69e50;
+}
+
+.goodsCoupon-number text {
+ font-size: 28rpx;
+}
+
+.goodsCoupon-btn {
+ position: absolute;
+ right: 10rpx;
+ left: 10rpx;
+ bottom: 20rpx;
+ z-index: 2;
+ background-image: linear-gradient(#eacf90, #f7e09f, #ce9e4d);
+ color: #000;
+ font-size: 24rpx;
+ width: calc(100% - 20rpx);
+ text-align: center;
+ height: 40rpx;
+ line-height: 40rpx;
+ border-radius: 30rpx;
+ transform: scale(0.83, 0.83);
+}
+
+.goodsCoupon-tips {
+ position: absolute;
+ top: 6rpx;
+ left: 14rpx;
+ z-index: 2;
+ color: #fff;
+ transform: rotate(-48deg);
+}
+
+.goodsCoupon-tips text {
+ transform: scale(0.83, 0.83);
+ font-size: 24rpx;
+ display: inline-block;
+}
+
+.goodsBox-tips {
+ display: inline-block;
+ width: 49rpx;
+ padding: 8rpx 0 6rpx 0;
+ background: #EDBA19;
+ top: -10rpx;
+ left: 10rpx;
+ position: absolute;
+ text-align: center;
+ border-top-left-radius: 4rpx;
+ font-size: 24rpx;
+ color: #ffff;
+ transform: scale(.9, .9);
+}
+
+.goodsBox-tips:before,
+.goodsBox-tips:after {
+ content: "";
+ position: absolute;
+}
+
+.goodsBox-tips:before {
+ height: 0;
+ width: 0;
+ border-bottom: 10rpx solid #745800;
+ border-right: 10rpx solid transparent;
+ right: -10rpx;
+ top: 0;
+}
+
+.goodsBox-tips:after {
+ height: 0;
+ width: 0;
+ border-left: 25rpx solid #EDBA19;
+ border-right: 25rpx solid #EDBA19;
+ border-bottom: 25rpx solid transparent;
+ bottom: -22rpx;
+ left: 0;
+}
+
+.goodsLabel {
+ background: #fff;
+ text-align: right;
+ padding: 20rpx;
+ font-size: 26rpx;
+}
+
+.goodsLabel text {
+ font-weight: 600;
+ font-size: 30rpx;
+ padding-left: 10rpx;
+ color: #f57e32;
+}
+
+/* 底部工具栏 */
+
+.order-footer,
+.order-login-footer {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ border-top: solid 1rpx #f2f2f2;
+ height: 100rpx;
+ line-height: 100rpx;
+ z-index: 99;
+}
+
+.order-footer {
+ background: white;
+}
+
+.order-login-footer {
+ background: #f57e32;
+ text-align: center;
+ color: #fff;
+}
+
+.order-footer-total {
+ padding-right: calc(30vw + 30rpx);
+ padding-right: -webkit-calc(30vw + 30rpx);
+ padding-left: 30rpx;
+ color: #737787;
+ font-size: 28rpx;
+}
+
+.order-footer-total text {
+ color: #f57e32;
+}
+
+.order-footer-total-price {
+ font-weight: bold;
+ font-size: 30rpx;
+}
+
+.order-footer-btn[size="mini"] {
+ width: 30vw;
+ background: #f57e32;
+ color: white;
+ border-radius: 0;
+ height: 100rpx;
+ line-height: 100rpx;
+ font-size: 30rpx;
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+.order-footer-btn:after {
+ border: none;
+}
+
+.order-footer-btn.insufficient {
+ background: #737787;
+ text-align: center;
+}
+
+.order-textarea {
+ padding: 20rpx;
+}
+
+
+.rightsLabel {
+ background: #fff;
+ display: flex;
+ padding: 20rpx;
+ color: #6f7880;
+ font-size: 30rpx;
+ margin: 20rpx 0;
+}
+
+.rightsLabel .rightsLabel-left {
+ flex: 1;
+ color: #747d86;
+}
+
+.rightsLabel-black {
+ padding-top: 30rpx;
+}
+
+.rightsLabel-range {
+ display: flex;
+ color: #000;
+ font-weight: 600;
+}
+
+.rightsLabel-row {
+ width: 38rpx;
+ height: 38rpx;
+ margin: 2rpx 0 0 6rpx;
+}
+
+.rightsLabel-black .rightsLabel-right {
+ color: #000;
+ font-weight: 600;
+ font-size: 32rpx;
+}
+
+.rightsLabel-black .rightsLabel-left {
+ color: #000;
+}
+
+
+.rightsLabel-pay {
+ color: #000;
+}
+
+.rightsLabel-pay .rightsLabel-left {
+ flex: 1;
+}
+
+.rightsLabel-free {
+ color: #999;
+ padding-right: 20rpx;
+}
+
+/* tab */
+.order-tab {
+ display: flex;
+ background: #fff;
+ padding: 20rpx 0 25rpx;
+ color: #999;
+}
+
+.order-tab-item {
+ flex: 2;
+ text-align: center;
+ position: relative;
+}
+
+.order-tab-item::after {
+ position: absolute;
+ left: calc(50% - 50rpx);
+ bottom: -25rpx;
+ width: 100rpx;
+ height: 4rpx;
+ border-radius: 20rpx;
+ content: '';
+ background: transparent;
+}
+
+.order-tab-item.active {
+ color: #e2952b;
+ font-weight: 600;
+}
+
+.order-tab-item.active::after {
+ background: #e2952b;
+}
+
+/* 提示 */
+.goods-tips {
+ background: #fffbec;
+ color: #e2952b;
+ padding: 20rpx;
+ box-sizing: border-box;
+ font-size: 29rpx;
+ display: flex;
+ position: relative;
+}
+
+.goods-tips::after,
+.goods-tips::before {
+ position: absolute;
+ content: '';
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #fef5d1;
+}
+
+.goods-tips::after {
+ bottom: 0;
+}
+
+.goods-tips::before {
+ top: 0;
+}
+
+.goods-tips image {
+ width: 30rpx;
+ height: 30rpx;
+ margin-right: 14rpx;
+ margin-top: 3rpx;
+}
\ No newline at end of file
diff --git a/pages/activityOrder/activityOrder.js b/pages/activityOrder/activityOrder.js
new file mode 100644
index 0000000..72b9f69
--- /dev/null
+++ b/pages/activityOrder/activityOrder.js
@@ -0,0 +1,146 @@
+// pages/activityOrder/activityOrder.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ stateType : '', //状态
+ counts : '', //数量
+ orderArr : [], //列表
+ page : {}, //下一页
+ lodingStats : false //加载状态
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+
+ // 获取商品活动订单
+ this.orderInfo();
+ },
+
+ /**
+ * 商品活动订单
+ */
+ orderInfo(page) {
+ wx.$api.index.activityOrder(this.data.stateType, page).then(res=>{
+ let listArr = this.data.orderArr,
+ newData = []
+ if(page == 1 || page == undefined) listArr = []
+
+ newData = listArr.concat(res.data.data)
+ this.setData({
+ counts : res.data.count,
+ orderArr : newData,
+ page : res.data.page,
+ lodingStats : false
+ })
+ wx.stopPullDownRefresh()
+ })
+ },
+
+ /**
+ * tabs
+ */
+ orderTab(e){
+ if(this.data.stateType != e.currentTarget.dataset.state){
+ this.setData({
+ stateType: e.currentTarget.dataset.state
+ })
+
+ // 获取商品活动订单
+ this.orderInfo()
+
+ wx.pageScrollTo({
+ scrollTop: 0
+ })
+ }
+ },
+
+ /**
+ * 取消订单
+ */
+ orderDelete(e) {
+ let orderId = e.currentTarget.dataset.id
+ wx.showModal({
+ title : '订单取消',
+ content : '确认取消吗?',
+ success : res=> {
+ if (res.confirm) {
+ wx.$api.index.cance(orderId).then(res=>{
+ // 获取商品活动订单
+ this.orderInfo()
+
+ wx.showToast({
+ title: res.data,
+ icon : 'none'
+ })
+ })
+ } else if (res.cancel) {
+ wx.showToast({
+ title : '取消',
+ icon : 'loading',
+ duration: 1000
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 订单支付
+ */
+ orderPay(e) {
+ let orderId = e.currentTarget.dataset.id
+
+ wx.login({
+ success: res=> {
+ wx.$api.index.repay(orderId).then(res=>{
+ let payInfo = JSON.parse(res.data.json)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.redirectTo({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ },2000)
+ }
+ },
+ fail : res=>{
+ wx.redirectTo({
+ url: '/pages/activityOrder/activityOrder',
+ })
+ }
+ })
+ })
+ }
+ })
+ },
+
+ /**
+ * 上拉加载
+ */
+ onReachBottom(){
+ this.setData({
+ lodingStats: true
+ })
+ let pageNumber = this.data.page.current
+ if(this.data.page.has_more){
+ pageNumber++
+ this.orderInfo(pageNumber)
+ }
+ }
+
+})
\ No newline at end of file
diff --git a/pages/activityOrder/activityOrder.json b/pages/activityOrder/activityOrder.json
new file mode 100644
index 0000000..f825b95
--- /dev/null
+++ b/pages/activityOrder/activityOrder.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "我的订单",
+ "enablePullDownRefresh": true
+}
\ No newline at end of file
diff --git a/pages/activityOrder/activityOrder.wxml b/pages/activityOrder/activityOrder.wxml
new file mode 100644
index 0000000..0fce770
--- /dev/null
+++ b/pages/activityOrder/activityOrder.wxml
@@ -0,0 +1,66 @@
+
+
+
+ 全部
+
+
+ 未支付
+ {{counts.init}}
+
+
+ 已支付
+ {{counts.paid}}
+
+
+ 已发货
+ {{counts.send}}
+
+
+
+
+
+
+
+
+ {{item.activity_name}}
+
+
+ {{item.order_id}}
+ {{item.status_text}}
+ {{item.status_text}}
+ {{item.status_text}}
+
+
+
+
+ {{item.title}}
+
+ ¥{{item.price}} × {{item.number}}
+
+
+ 礼盒
+ 购物券
+
+
+
+
+ 订单详情
+ 取消订单
+ 立即支付
+
+
+
+
+
+ 加载中...
+
+
+ 没有更多了~
+
+
+
+
+
+
+ 暂无订单
+
\ No newline at end of file
diff --git a/pages/activityOrder/activityOrder.wxss b/pages/activityOrder/activityOrder.wxss
new file mode 100644
index 0000000..3abc3ae
--- /dev/null
+++ b/pages/activityOrder/activityOrder.wxss
@@ -0,0 +1,228 @@
+/*
+ * 亿时代
+ */
+
+.order-tab {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ display: flex;
+ height: 80rpx;
+ line-height: 80rpx;
+ z-index: 9;
+ background: white;
+}
+
+.order-tab-item {
+ font-size: 28rpx;
+ width: 25%;
+ text-align: center;
+ border-bottom: solid 2rpx #f7f7f7;
+ color: #464854;
+ background: white;
+ position: relative;
+}
+
+.order-tab-item.active {
+ color: #f57e32;
+}
+
+.order-tab-item::after {
+ content: '';
+ position: absolute;
+ width: 30rpx;
+ height: 4rpx;
+ background: transparent;
+ left: calc(50% - 15rpx);
+ bottom: -2rpx;
+}
+
+.order-tab-item.active::after {
+ background: #f57e32;
+}
+
+.state-tips {
+ position: absolute;
+ top: 10rpx;
+ right: 14rpx;
+ background: #e92706;
+ color: #fff;
+ font-size: 24rpx;
+ transform: scale(.7, .7);
+ border-radius: 60rpx 60rpx 60rpx 0;
+ width: 48rpx;
+ height: 34rpx;
+ line-height: 34rpx;
+}
+
+/* 订单列表 */
+
+.order-content {
+ padding: 80rpx 0 20rpx 0;
+}
+
+.order-content-li {
+ background: white;
+ margin-top: 20rpx;
+ position: relative;
+}
+
+.order-name {
+ background: #fff;
+ padding: 20rpx;
+ box-sizing: border-box;
+ border-bottom: solid 1rpx #f3f3f3;
+ display: flex;
+}
+
+.order-name image {
+ background: linear-gradient(#000, #000);
+ background-blend-mode: lighten;
+ background-size: cover;
+ width: 26rpx;
+ height: 26rpx;
+ border-radius: 50%;
+ margin: 8rpx 14rpx 0 0;
+}
+
+.order-store {
+ padding: 20rpx;
+ border-bottom: solid 1rpx #f3f3f3;
+ display: flex;
+}
+
+.order-goods-tips {
+ display: flex;
+}
+
+.order-goods-tips text {
+ display: inline-block;
+ background: #e92706;
+ color: #fff;
+ border-radius: 20rpx;
+ padding: 0 20rpx;
+ height: 42rpx;
+ line-height: 42rpx;
+ font-size: 24rpx;
+ transform: scale(.8, .8);
+}
+
+text.order-goods-tips-color {
+ background: #e6b329;
+}
+
+.order-store-stateText {
+ color: #e6b329;
+ font-size: 26rpx;
+}
+
+.order-store-stateText.red {
+ color: #e92344;
+}
+
+.order-store-stateText.green {
+ color: #79b300;
+}
+
+.order-store-title {
+ flex: 1;
+ color: #999;
+ font-size: 28rpx;
+}
+
+.order-store-orderid {
+ color: #747788;
+ font-size: 25rpx;
+}
+
+.order-store-title text {
+ color: white;
+ font-size: 24rpx;
+ background: #e92344;
+ margin-right: 10rpx;
+ padding: 0 10rpx;
+}
+
+.order-goods {
+ padding: 20rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.order-goods-cover {
+ width: 150rpx;
+ height: 150rpx;
+ vertical-align: top;
+ border-radius: 4rpx;
+}
+
+.order-goods-content {
+ position: absolute;
+ left: 190rpx;
+ top: 20rpx;
+ right: 20rpx;
+ width: calc(100% - 210rpx);
+}
+
+.order-goods-content-name {
+ margin-bottom: 15rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.order-goods-content-price {
+ color: #747788;
+ display: flex;
+ margin-bottom: 14rpx;
+ font-size: 28rpx;
+}
+
+.order-goods-content-price text {
+ color: #f57e32;
+ display: inline-block;
+ margin-right: 10rpx;
+ font-size: 30rpx;
+}
+
+.order-total {
+ padding: 20rpx;
+ box-sizing: border-box;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #747788;
+ display: flex;
+}
+
+.order-total view {
+ margin-right: 30rpx;
+}
+
+.order-total text {
+ color: #e92344;
+ font-weight: bold;
+}
+
+.order-btns {
+ font-size: 25rpx;
+ display: flex;
+ padding: 20rpx;
+ box-sizing: border-box;
+ flex-wrap: wrap;
+ flex-direction: row-reverse;
+}
+
+.order-btn {
+ margin-left: 20rpx;
+ height: 52rpx;
+ line-height: 50rpx;
+ box-sizing: border-box;
+ border: solid 1rpx #747788;
+ padding: 0 20rpx;
+ border-radius: 30rpx;
+}
+
+.order-btn-back {
+ border-color: #f57e32;
+ color: #f57e32;
+}
\ No newline at end of file
diff --git a/pages/address/address.js b/pages/address/address.js
new file mode 100644
index 0000000..20bc164
--- /dev/null
+++ b/pages/address/address.js
@@ -0,0 +1,102 @@
+// pages/address/address.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type : '', //来源类型
+ addressArr : [] //收货地址
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ type: options.type
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow(){
+ this.addressInfo();
+ },
+
+ /* 地址列表
+ */
+ addressInfo(){
+ wx.$api.address.index().then(res=>{
+ this.setData({
+ addressArr: res.data
+ })
+ })
+ },
+
+ /**
+ * 删除地址
+ */
+ addressRemove(e){
+ let id = e.target.dataset.id,
+ index = e.target.dataset.index,
+ list = this.data.addressArr
+
+ list.splice(index,1)
+
+ wx.showModal({
+ title : '提示',
+ content : '是否删除地址',
+ success : res=> {
+ if (res.confirm) {
+ wx.showLoading({
+ title: '删除中',
+ })
+ wx.$api.address.remove(id).then(res=>{
+ this.setData({
+ addressArr: list
+ })
+ wx.showToast({
+ title: res.data,
+ icon : "none"
+ })
+
+ wx.hideLoading()
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 设为默认地址
+ */
+ addressDefault(e){
+ let id = e.currentTarget.dataset.id
+
+ wx.$api.address.setdef(id).then(res=>{
+ this.addressInfo();
+ wx.showToast({
+ title: res.data,
+ icon : "none"
+ })
+ })
+ },
+
+ /**
+ * 选择地址
+ */
+ selectAddress(e){
+ let atAdds = this.data.addressArr[e.currentTarget.dataset.index]
+
+ let pages = getCurrentPages(),
+ prepage = pages[pages.length-2]
+
+ prepage.setData({
+ address: atAdds
+ })
+
+ wx.navigateBack()
+ }
+})
\ No newline at end of file
diff --git a/pages/address/address.json b/pages/address/address.json
new file mode 100644
index 0000000..36ec88b
--- /dev/null
+++ b/pages/address/address.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "我的地址"
+}
\ No newline at end of file
diff --git a/pages/address/address.wxml b/pages/address/address.wxml
new file mode 100644
index 0000000..181f38e
--- /dev/null
+++ b/pages/address/address.wxml
@@ -0,0 +1,40 @@
+
+
+ {{item.name}}{{item.mobile}}
+
+
+ 默认
+
+ {{item.all_address}}
+
+
+
+
+ 选择地址
+
+
+
+ 删除
+ 编辑
+
+
+ 设为默认地址
+
+
+
+
+ 默认地址
+
+
+
+
+
+
+
+
+ 还未添加收货地址
+
+
+
\ No newline at end of file
diff --git a/pages/address/address.wxss b/pages/address/address.wxss
new file mode 100644
index 0000000..47effc5
--- /dev/null
+++ b/pages/address/address.wxss
@@ -0,0 +1,112 @@
+
+/**
+ * 亿时代
+ */
+
+ .address-list{
+ border-bottom: 110rpx solid transparent;
+}
+
+.address{
+ padding: 20rpx 30rpx;
+ border-bottom: solid 20rpx #f2f2f2;
+ background: white;
+}
+
+.address-name{
+ font-size: 32rpx;
+ line-height: 50rpx;
+}
+
+.address-name text{
+ color: #747788;
+ padding-left: 10rpx;
+ font-size: 28rpx;
+}
+
+.address-info{
+ padding-bottom: 20rpx;
+ display: flex;
+}
+
+.address-tool{
+ overflow: hidden;
+}
+
+.address-info-tag{
+ background: #30bb29;
+ margin-right: 20rpx;
+ padding: 0 10rpx;
+ height: 32rpx;
+ line-height: 32rpx;
+ color: white;
+ font-size: 22rpx;
+ border-radius: 4rpx;
+ margin-top: 6rpx;
+}
+
+.address-tool-btn{
+ margin-left: 30rpx;
+ float: right;
+ border:solid 1rpx #c0c0c0;
+ height: 46rpx;
+ line-height: 44rpx;
+ padding: 0 30rpx;
+ border-radius: 6rpx;
+ font-size: 24rpx;
+}
+
+.address-tool-btn.yellow {
+ border:solid 1rpx #f57e32;
+ color: #f57e32;
+ padding: 0 14rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+}
+
+.address-tool-btn.acitve{
+ float: left;
+ margin-left: 0;
+ padding: 0;
+ border: none;
+ color: #747788;
+ font-size: 26rpx;
+}
+
+.address-tool-btn.acitve image{
+ margin-right: 10rpx;
+ vertical-align: -7rpx;
+}
+
+.address-tool-btn image {
+ width: 30rpx;
+ height: 30rpx;
+ margin-right: 4rpx;
+ vertical-align: -6rpx;
+}
+
+/* footer */
+
+.address-footer{
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding-left: 30rpx;
+ padding-right: 30rpx;
+ background: white;
+ z-index: 9;
+ height: 110rpx;
+}
+
+.address-footer navigator{
+ width: 100%;
+ line-height: 80rpx;
+ height: 80rpx;
+ margin: 15rpx 0;
+ text-align: center;
+ background: #f57e32;
+ font-size: 30rpx;
+ color: white;
+ border-radius: 10rpx
+}
diff --git a/pages/address_form/address_form.js b/pages/address_form/address_form.js
new file mode 100644
index 0000000..5df69f0
--- /dev/null
+++ b/pages/address_form/address_form.js
@@ -0,0 +1,240 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ addressInfo: '',
+ type : '', //类型
+ addressId : '',
+ defaultVal :'',
+ name : '',
+ mobile : '',
+ address : '',
+
+ //省份选择
+ areas : [],
+ areaSn : '',
+ areaIndex : 0,
+
+ //市级选择
+ cityList : [],
+ cityId : 0,
+ cityIndex : 0,
+
+ //区域选择
+ regiList : [],
+ regiId : 0,
+ regiIndex : 0,
+
+ cityLayer : false
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ type : options.type
+ })
+ if (options.type == 'Add') {
+ wx.setNavigationBarTitle({
+ title: '添加收货地址'
+ })
+ // 获取位置
+ wx.getLocation({
+ type: 'gcj02',
+ success: res=> {
+ this.setData({
+ longitude : res.longitude,
+ latitude : res.latitude
+ })
+ // 解析坐标
+ getApp().qqmapsdk.reverseGeocoder({
+ location: {
+ latitude : res.latitude,
+ longitude : res.longitude
+ },
+ success: res=>{
+ if(res.message == "query ok"){
+ let addressInfo = res.result.address_component
+ let areaIndex = this.data.areas.findIndex(val => val.name == addressInfo.province)
+ this.setData({
+ areaIndex : areaIndex
+ })
+ this.getProvince()
+ }else{
+ wx.showToast({
+ title: res.message,
+ icon : 'none'
+ })
+ }
+ }
+ })
+ }
+ })
+ this.getProvince()
+ } else if (options.type == 'Compile') {
+ wx.setNavigationBarTitle({
+ title: '编辑收货地址'
+ })
+ this.setData({
+ addressId: options.id
+ })
+ this.getUserAddress()
+ }
+ },
+
+ /**
+ * 获取收货人信息
+ */
+ getUserAddress(){
+ wx.$api.address.edit(this.data.addressId).then(res=>{
+ let areasValue = res.data.provinces.findIndex(val=> val.name == res.data.address.province_name),
+ cityValue = res.data.cities.findIndex(val=> val.name == res.data.address.city_name),
+ regiValue = res.data.districts.findIndex(val=> val.name == res.data.address.district_name)
+ this.setData({
+ name : res.data.address.name,
+ mobile : res.data.address.mobile,
+ areas : res.data.provinces,
+ cityList : res.data.cities,
+ regiList : res.data.districts,
+ areaIndex : areasValue,
+ cityIndex : cityValue,
+ regiIndex : regiValue,
+ areaSn : res.data.address.province_id,
+ cityId : res.data.address.city_id,
+ regiId : res.data.address.district_id,
+ address : res.data.address.address,
+ defaultList : res.data.address,
+ isDefault : res.data.address.is_default
+ })
+ })
+ },
+
+ /**
+ * 获取省信息
+ */
+ getProvince() {
+ wx.$api.address.create().then(res=>{
+ let areaArr = res.data.provinces,
+ areaIndex = this.data.areaIndex
+ this.citylist(areaArr[areaIndex].code)
+ this.setData({
+ areaSn : areaArr[areaIndex].code,
+ areas : areaArr
+ })
+ })
+ },
+
+ /**
+ * 所在省份
+ */
+ areasChange(e) {
+ let area = this.data.areas,
+ index = e.detail.value,
+ atcode = area[index].code
+ if (index != this.data.areaIndex) {
+ this.setData({
+ areaIndex : index,
+ areaSn : atcode
+ })
+
+ // 获取市级列表
+ this.citylist(atcode)
+ }
+ },
+
+ /**
+ * 市级列表
+ */
+ citylist(code) {
+ wx.$api.address.children(code).then(res=>{
+ let cityArr = res.data
+ this.regilist(cityArr[0].code)
+ this.setData({
+ cityId : cityArr[0].code,
+ cityList : cityArr,
+ cityIndex : 0
+ })
+ })
+ },
+
+ /**
+ * 市级下拉筛选
+ */
+ city(e) {
+ let city = this.data.cityList,
+ index = e.detail.value,
+ citycode = city[index].code
+ if (index != this.data.areaIndex) {
+ this.setData({
+ cityIndex: index,
+ cityId : citycode
+ })
+
+ // 获取市级列表
+ this.regilist(citycode)
+ }
+ },
+
+
+ /**
+ * 区列表
+ */
+ regilist(areaCode) {
+ wx.$api.address.children(areaCode).then(res=>{
+ this.setData({
+ regiList : res.data,
+ regiId : res.data[0].code,
+ regiIndex : 0
+ })
+ })
+ },
+
+ /**
+ * 区下拉筛选
+ */
+ regi(e) {
+ let newIndex = e.detail.value
+ this.setData({
+ regiIndex : newIndex,
+ regiId : this.data.regiList[newIndex].code
+ })
+ },
+
+ /**
+ * 保存信息
+ */
+ siteform(e) {
+ if(this.data.type == 'Compile') {
+ // 编辑地址
+ wx.$api.address.keep(this.data.addressId, e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address).then(res=>{
+ wx.navigateBack()
+ })
+ } else {
+ // 创建地址
+ wx.$api.address.add(e.detail.value.name, e.detail.value.mobile, this.data.areaSn, this.data.cityId, this.data.regiId, e.detail.value.address, this.data.defaultVal).then(res=>{
+ wx.navigateBack()
+ })
+ }
+ },
+
+ /**
+ * 设为默认地址
+ */
+ addressDefault(e) {
+ let val = e.detail.value
+ this.setData({
+ defaultVal: val
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/address_form/address_form.json b/pages/address_form/address_form.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/address_form/address_form.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/address_form/address_form.wxml b/pages/address_form/address_form.wxml
new file mode 100644
index 0000000..065679a
--- /dev/null
+++ b/pages/address_form/address_form.wxml
@@ -0,0 +1,71 @@
+
+
\ No newline at end of file
diff --git a/pages/address_form/address_form.wxss b/pages/address_form/address_form.wxss
new file mode 100644
index 0000000..7b78406
--- /dev/null
+++ b/pages/address_form/address_form.wxss
@@ -0,0 +1,148 @@
+/**
+ * 亿时代
+ */
+
+.site-form {
+ background: white;
+ display: block;
+}
+
+.site-btn {
+ padding: 20rpx 30rpx;
+}
+
+.site-input {
+ padding: 0 30rpx 0 200rpx;
+ position: relative;
+ line-height: 90rpx;
+ min-height: 90rpx;
+}
+
+.site-input label {
+ position: absolute;
+ left: 30rpx;
+ top: 0;
+}
+
+.site-input input {
+ height: 90rpx;
+}
+
+.site-input image {
+ width: 38rpx;
+ height: 38rpx;
+ position: absolute;
+ right: 20rpx;
+ top: calc(50% - 19rpx);
+}
+
+.conneColor {
+ width: calc(100%- 100rpx);
+}
+
+.site-input::before {
+ position: absolute;
+ bottom: 0;
+ left: 30rpx;
+ right: 0;
+ height: 1rpx;
+ content: "";
+ background: #e4e6f2;
+}
+
+.site-input:last-child::before {
+ display: none;
+}
+
+.tui-picker-detail {
+ width: 33%;
+}
+
+.site-btn button[size="mini"] {
+ width: 100%;
+ background: #f57e32;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 30rpx;
+ color: white;
+ padding: 0;
+}
+
+/* pickerView */
+
+.pickerView-back {
+ background: rgba(0, 0, 0, .3);
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ display: none;
+}
+
+.pickerView-back.active {
+ display: block;
+}
+
+.pickerView-layer {
+ position: fixed;
+ bottom: -571rpx;
+ left: 0;
+ width: 100%;
+ background: white;
+ transition: all .3s;
+}
+
+.pickerView-layer.active {
+ bottom: 0;
+}
+
+.pickerView-btn {
+ line-height: 90rpx;
+ font-size: 30rpx;
+ padding: 0 30rpx;
+ display: flex;
+ justify-content: space-between;
+}
+
+.pickerView {
+ height: 480rpx;
+ padding: 0 10rpx;
+}
+
+.pickerView-name {
+ line-height: 80rpx;
+ padding: 0 20rpx;
+ text-align: center;
+}
+
+.pickerView-mask {
+ border-top: solid 1rpx #e4e6f2;
+}
+
+.pickerView-indicator {
+ height: 80rpx;
+}
+
+.pickerView-determine {
+ color: #f57e32;
+}
+
+.pickerView-cancel {
+ color: #747788;
+}
+
+.site-switch {
+ font-size: 32rpx;
+ margin: 30rpx;
+ display: flex;
+ line-height: 40rpx;
+}
+
+.site-switch text {
+ flex: 1;
+}
+
+.site-switch-active {
+ color: #797979;
+}
\ No newline at end of file
diff --git a/pages/chooseTel/chooseTel.js b/pages/chooseTel/chooseTel.js
new file mode 100644
index 0000000..8a25ceb
--- /dev/null
+++ b/pages/chooseTel/chooseTel.js
@@ -0,0 +1,151 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ wechatUserId: "",
+ loginCode : "",
+ userInfo : "",
+ isLogin : false,
+ iv : '',
+ enData : '',
+ loginTel : [] //用户手机号
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+
+ // 登录方式-活动
+ this.setData({
+ way : options.way
+ })
+
+ if(options.type == "mobiles") {
+ wx.$api.user.mobiles().then(res=>{
+ this.setData({
+ loginTel : res.data
+ })
+ })
+ }else {
+ // 获取用户手机列表
+ const logintel = wx.getStorageSync("users")
+
+ this.setData({
+ loginTel : logintel
+ })
+ }
+ },
+
+ /**
+ * 生命周期函数--页面显示
+ */
+ onShow() {
+ wx.login({
+ success: res => {
+ this.setData({
+ loginCode: res.code
+ })
+ }
+ })
+ },
+
+ /**
+ * 绑定手机号码
+ */
+ mobile(e){
+ if(e.detail.errMsg == "getPhoneNumber:ok"){
+ this.setData({
+ isLogin : true,
+ iv : e.detail.iv,
+ enData : e.detail.encryptedData
+ })
+ this.binMobel()
+ }else{
+ wx.showToast({
+ title: '拒绝了手机号码授权',
+ icon : 'none'
+ })
+ }
+ },
+
+ /**
+ * 绑定手机号码
+ */
+ binMobel(){
+ let code = this.data.loginCode,
+ iv = this.data.iv,
+ mobile = this.data.enData
+
+ wx.$api.enroll.bindmobile(code, iv, mobile).then(res=>{
+ this.setData({
+ isLogin: false
+ })
+
+ getApp().globalData.token = res.data.token
+
+ // 更新全局存储器用户状态
+ getApp().globalData.isUser = true
+
+
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : res.data.token
+ })
+
+ if(this.data.way == "activity") {
+ // 回到活动首页
+ wx.reLaunch({
+ url: '/pages/activityInfo/activityInfo'
+ })
+ } else {
+ // 回到个人中心
+ wx.switchTab({
+ url: '/pages/user/user'
+ })
+ }
+ })
+ },
+
+ /**
+ * 点击账号登录
+ */
+ loginGo(e) {
+ let username = e.currentTarget.dataset.name,
+ wechatUser_id = app.globalData.wechatUser
+
+ wx.$api.enroll.tel(wechatUser_id, username).then(res=>{
+ app.globalData.token = res.data.token
+ app.globalData.isUser = true
+
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : res.data.token
+ })
+
+ if(this.data.way == "activity") {
+ // 回到活动首页
+ wx.reLaunch({
+ url: '/pages/activityInfo/activityInfo'
+ })
+ } else {
+ // 回到个人中心
+ wx.switchTab({
+ url: '/pages/user/user'
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/chooseTel/chooseTel.json b/pages/chooseTel/chooseTel.json
new file mode 100644
index 0000000..42c8728
--- /dev/null
+++ b/pages/chooseTel/chooseTel.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "绑定手机号"
+}
\ No newline at end of file
diff --git a/pages/chooseTel/chooseTel.wxml b/pages/chooseTel/chooseTel.wxml
new file mode 100644
index 0000000..012a561
--- /dev/null
+++ b/pages/chooseTel/chooseTel.wxml
@@ -0,0 +1,26 @@
+
+
+ 切换手机号登录
+ 轻触账户以登录
+
+
+
+
+
+
+
+ {{item.username}}
+
+ 当前登录
+
+
+
+
+
+
+
+ 您还没有绑定手机号
+
+
+
+
\ No newline at end of file
diff --git a/pages/chooseTel/chooseTel.wxss b/pages/chooseTel/chooseTel.wxss
new file mode 100644
index 0000000..317a7bd
--- /dev/null
+++ b/pages/chooseTel/chooseTel.wxss
@@ -0,0 +1,75 @@
+/* 切换手机号 */
+.chooseTel-title {
+ background: #fff;
+ padding: 40rpx 30rpx;
+ color: #999;
+}
+
+.chooseTel-title text {
+ font-size: 36rpx;
+ font-weight: 600;
+ margin-bottom: 20rpx;
+ display: block;
+ color: #000;
+}
+
+.chooseList {
+ display: flex;
+ background: #fff;
+ line-height: 100rpx;
+ padding: 20rpx;
+ box-sizing: border-box;
+}
+
+.chooseList-left {
+ display: flex;
+}
+
+.chooseList-img {
+ width: 90rpx;
+ height: 90rpx;
+ border-radius: 50%;
+ margin-right: 30rpx;
+}
+
+.chooseList-btn {
+ font-size: 24rpx;
+ background: #00c12d;
+ border-radius: 30rpx;
+ height: 42rpx;
+ line-height: 42rpx;
+ color: #fff;
+ padding: 0 15rpx;
+ margin-top: 28rpx;
+ margin-left: 30rpx;
+}
+
+.chooseAdd {
+ width: calc(100% - 60rpx);
+ margin: 60rpx auto 0;
+ background: #fff;
+ border-radius: 50rpx;
+ line-height: 80rpx;
+ height: 80rpx;
+ text-align: center;
+ box-shadow: 0 0 10rpx rgba(0, 0,0, .05);
+ padding: 0;
+}
+
+.chooseTips {
+ background: #fff;
+ text-align: center;
+ padding: 30rpx 0 50rpx;
+}
+
+.chooseTips image {
+ width: 400rpx;
+ height: 350rpx;
+ display: block;
+ margin: 0 auto 20rpx;
+}
+
+.chooseTips text {
+ font-size: 34rpx;
+ color: #999;
+}
\ No newline at end of file
diff --git a/pages/classify/classify.js b/pages/classify/classify.js
new file mode 100644
index 0000000..c886244
--- /dev/null
+++ b/pages/classify/classify.js
@@ -0,0 +1,84 @@
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ noticeData : '', //公告
+ infoData : '', //权益数据
+ content : '', //内容简介
+ noticeShow : '', //公告开关
+ infoItems : [], //卡券专区
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.indexNav(options.id)
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow () {
+
+ },
+
+ /**
+ * 卡权益分类
+ */
+ indexNav(id) {
+ wx.$api.index.classify(id).then(res=>{
+ this.setData({
+ noticeData : res.data.notice,
+ infoData : res.data.info,
+ infoItems : res.data.items,
+ content : res.data.info.content.replace(/\
{
+ if(!err.login){
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : ''
+ })
+ }
+ })
+ },
+
+ /**
+ * 须知展开收起状态
+ */
+ noticeTap() {
+ this.setData({
+ noticeShow : !this.data.noticeShow
+ })
+ },
+
+ /**
+ * 处理未登录时的转跳
+ */
+ userNav(e){
+ let id = e.currentTarget.dataset.id
+ wx.getStorage({
+ key : 'token',
+ success:res=>{
+ wx.navigateTo({
+ url: '/pages/rights/rights?rightsId=' + id
+ })
+ },
+ fail: (err) => {
+ wx.navigateTo({
+ url: "/pages/login/login"
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/classify/classify.json b/pages/classify/classify.json
new file mode 100644
index 0000000..15b8460
--- /dev/null
+++ b/pages/classify/classify.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {},
+ "navigationBarBackgroundColor": "#000000",
+ "navigationBarTextStyle": "white",
+ "navigationBarTitleText": "卡券权益"
+}
\ No newline at end of file
diff --git a/pages/classify/classify.wxml b/pages/classify/classify.wxml
new file mode 100644
index 0000000..4b41042
--- /dev/null
+++ b/pages/classify/classify.wxml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ {{infoData.two_title}}
+
+
+ {{infoData.three_title == null ? '' : infoData.three_title}}
+
+
+ {{infoData.two_description}}
+
+
+
+
+
+
+
+
+
+ {{noticeData}}
+
+
+
+
+
+ 卡券专区
+
+
+
+ {{item.label}}
+
+
+
+
+
+
+ {{item.title}}
+ {{item.subtitle}}
+
+
+
+
+
+
+ 抱歉, 暂无内容
+
+
+
+
+
+
+
+
+
+
+ 购买前请仔细阅读内容介绍
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/classify/classify.wxss b/pages/classify/classify.wxss
new file mode 100644
index 0000000..0997bb1
--- /dev/null
+++ b/pages/classify/classify.wxss
@@ -0,0 +1,319 @@
+/* 卡券权益 */
+.cont {
+ width: 100%;
+ overflow: hidden;
+}
+
+.contBack {
+ position: relative;
+ width: 200%;
+ height: 400rpx;
+ left: -50%;
+ text-align: center;
+ background: #000000;
+ border-radius: 0 0 100% 100%;
+ overflow: hidden;
+}
+
+.contBack::after {
+ width: 100%;
+ height: 30rpx;
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 2;
+ content: '';
+ background-image: linear-gradient(transparent, rgba(0,0,0,.25));
+}
+
+.classBack {
+ position: absolute;
+ left: 30%;
+ right: 30%;
+ width: 40%;
+ top: 40rpx;
+}
+
+.classCircle {
+ position: relative;
+}
+
+.classCircle::after,
+.contBack::before {
+ position: absolute;
+ border-radius: 50%;
+ content: '';
+ z-index: 1;
+ background-color: rgba(255,255,255,.1);
+}
+
+.classCircle::after {
+ left: 20%;
+ top: -20rpx;
+ width: 260rpx;
+ height: 260rpx;
+}
+
+.contBack::before {
+ right: 20%;
+ top: 55%;
+ width: 300rpx;
+ height: 300rpx;
+}
+
+.rightsCont {
+ position: absolute;
+ z-index: 3;
+ left: calc(30% - 2rpx);
+ right: calc(30% - 2rpx);
+ width: calc(40% + 4rpx);
+ top: 58rpx;
+}
+
+.rightsCont-title {
+ color: #63320a;
+ font-size: 60rpx;
+ margin: 60rpx 0 20rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+
+.rightsCont-btn {
+ background-color: #f4dfcc;
+ width: 100%;
+ line-height: 70rpx;
+ font-size: 38rpx;
+ color: #2d2d2d;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+
+.rightsCont-tips {
+ color: #fff;
+}
+
+/* 须知 */
+.notice,
+.indexNews,
+.special {
+ border-radius: 10rpx;
+ padding: 25rpx 20rpx;
+ box-sizing: border-box;
+ background: #fff;
+ margin: 30rpx 20rpx;
+}
+
+.indexColor {
+ background: #c4c4c4;
+}
+
+.noticeTitle {
+ color: #747d86;
+ display: flex;
+ line-height: 46rpx;
+}
+
+.noticeTitle-flex {
+ flex: 1;
+ display: flex;
+ font-size: 30rpx;
+ color: #000;
+}
+
+.noticeTitle-img {
+ width: 46rpx;
+ height: 46rpx;
+ margin-right: 20rpx;
+}
+
+.noticeText {
+ font-size: 26rpx;
+ height: 0;
+ overflow: hidden;
+}
+
+.noticeText.active {
+ height: auto;
+}
+
+.noticeText-top {
+ margin: 30rpx 0 10rpx;
+ font-weight: 600;
+}
+
+.noticeText-cont {
+ line-height: 60rpx;
+}
+
+.noticeTitle-row {
+ width: 32rpx;
+ height: 32rpx;
+ margin-top: 6rpx;
+ transform:rotate(-180deg);
+}
+
+.noticeTitle-row.active {
+ transform: rotate(90deg);
+}
+
+
+/* 公告 */
+.indexNews {
+ display: flex;
+ font-size: 28rpx;
+ line-height: 46rpx;
+}
+
+.indexNews image {
+ width: 42rpx;
+ height: 42rpx;
+ margin: 4rpx 20rpx 0 0;
+}
+
+/* 卡券专区 */
+.special-list {
+ margin: 20rpx -10rpx 0;
+ flex-wrap: wrap;
+ display: flex;
+}
+
+.special-label {
+ margin: 10rpx;
+ width: calc(50% - 20rpx);
+ height: 330rpx;
+ flex: 0 0 calc(50% - 20rpx);
+ border: 4rpx solid #fb9b00;
+ background-color: #ffe0b8;
+ border-radius: 10rpx;
+ text-align: center;
+ padding: 20rpx 0;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.special-label:last-child {
+ margin-bottom: 0;
+}
+
+.special-rebate {
+ position: absolute;
+ top: -30rpx;
+ right: 10rpx;
+ background: #fe0002;
+ color: #fff;
+ border-radius: 30rpx;
+ line-height: 52rpx;
+ height: 52rpx;
+ font-size: 26rpx;
+ padding: 0 20rpx;
+ font-weight: 600;
+}
+
+.welfareCont-top{
+ white-space: nowrap;
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-around;
+ width: 100%;
+ padding: 0 10rpx;
+ box-sizing: border-box;
+ margin: 10rpx 0;
+}
+
+.welfareCont-list-img {
+ border: 2rpx solid #eccc69;
+ border-radius: 50%;
+ width: 100rpx;
+ height: 100rpx;
+ display: inline-block;
+ margin: 0 10rpx;
+ overflow: hidden;
+}
+
+.welfareCont-list-img image {
+ width: 100%;
+ height: 100%;
+}
+
+
+.special-text {
+ padding: 0 15rpx;
+ box-sizing: border-box;
+ position: relative;
+ font-size: 26rpx;
+ border-top: 4rpx dashed #fb9b00;
+ margin-top: 20rpx;
+ padding-top: 20rpx;
+}
+
+.special-name {
+ color: #6f4a2d;
+ font-weight: 600;
+ font-size: 28rpx;
+}
+
+.special-tips {
+ background-color: #242424;
+ color: #fff;
+ border-radius: 10rpx;
+ padding: 4rpx 20rpx;
+ line-height: 46rpx;
+ height: 46rpx;
+ margin-top: 20rpx;
+ font-size: 24rpx;
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+/* 滚动 */
+/*首页跑马灯效果*/
+@keyframes around {
+ from {
+ margin-left: 60rpx;
+ }
+
+ to {
+ /* var接受传入的变量 */
+ margin-left: var(--marqueeWidth--);
+ }
+}
+
+.marquee_container {
+ width: calc(100% - 40rpx);
+ overflow: hidden;
+}
+
+.marquee_container:hover {
+ /* 不起作用 */
+ animation-play-state: paused;
+}
+
+.marquee_text {
+ font-size: 28rpx;
+ display: inline-block;
+ white-space: nowrap;
+}
+
+.marquee_text.active {
+ animation-name: around;
+ animation-duration: 20s;
+ /*过渡时间*/
+ animation-iteration-count: infinite;
+ animation-timing-function: linear;
+}
+
+
+/* 权益提示 */
+.legalTips {
+ text-align: center;
+ font-size: 26rpx;
+ color: #999;
+}
+
+.legalTips image {
+ width: 180rpx;
+ height: 180rpx;
+ display: block;
+ margin: 0 auto;
+}
\ No newline at end of file
diff --git a/pages/coupon/coupon.js b/pages/coupon/coupon.js
new file mode 100644
index 0000000..18a1096
--- /dev/null
+++ b/pages/coupon/coupon.js
@@ -0,0 +1,96 @@
+// pages/coupon/coupon.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ couponArr : '',
+ coupons : [],
+ count : '',
+ couponLabel : [
+ { title : "未使用", used: 0 },
+ { title : "已使用", used: 1 },
+ { title : "已过期", used: 2 }
+ ],
+ stateType : '0', //卡券状态
+ barHeight : getApp().globalData.statusBarHeight,
+ type : ''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ type : options.type
+ })
+ },
+
+ /**
+ * tabs
+ */
+ orderTab(e){
+ if(this.data.stateType != e.currentTarget.dataset.state){
+ this.setData({
+ stateType: e.currentTarget.dataset.state
+ })
+
+ // 获取卡权益
+ this.couponInfo()
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow () {
+ // 获取列表
+ this.couponInfo();
+ },
+
+ /**
+ * 卡券列表
+ */
+ couponInfo() {
+ wx.$api.user.coupon(this.data.stateType).then(res=>{
+ this.setData({
+ count : res.data.count,
+ coupons : res.data.list
+ })
+ })
+ },
+
+ /**
+ * 去使用卡券
+ */
+ // applyTap(e) {
+ // let id = e.currentTarget.dataset.id
+ // wx.navigateTo({
+ // url: '/pages/couponDetails/couponDetails?id=' + id
+ // })
+ // },
+
+ /**
+ * 查看优惠券分组
+ */
+ couponTap(e) {
+ let id = e.currentTarget.dataset.id,
+ status = e.currentTarget.dataset.status
+ wx.navigateTo({
+ url: '/pages/couponArr/couponArr?id=' + id + '&status=' + status
+ })
+ },
+
+ publicTap() {
+ if(this.data.type == 'couponPublic'){
+ wx.switchTab({
+ url: '/pages/user/user'
+ })
+ }else {
+ wx.navigateBack({
+ delta: 1
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/coupon/coupon.json b/pages/coupon/coupon.json
new file mode 100644
index 0000000..0de239e
--- /dev/null
+++ b/pages/coupon/coupon.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents" : {},
+ "navigationStyle" : "custom"
+}
\ No newline at end of file
diff --git a/pages/coupon/coupon.wxml b/pages/coupon/coupon.wxml
new file mode 100644
index 0000000..ad60812
--- /dev/null
+++ b/pages/coupon/coupon.wxml
@@ -0,0 +1,71 @@
+
+
+
+
+
+ {{item.title}}
+ ({{count.init}}张)
+ ({{count.used}}张)
+ ({{count.pass}}张)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ {{item.startTime}} 至 {{item.endTime}}
+ 活动来源: {{item.activity_name}}
+ 使用时间:{{item.used_at}}
+
+
+
+ 去使用
+
+
+
+
+
+
+
+
+
+ 查看全部{{item.count}}张卡券
+
+
+
+
+
+
+
+
+
+ 暂无优惠券
+
\ No newline at end of file
diff --git a/pages/coupon/coupon.wxss b/pages/coupon/coupon.wxss
new file mode 100644
index 0000000..95086d2
--- /dev/null
+++ b/pages/coupon/coupon.wxss
@@ -0,0 +1,247 @@
+.publicHeader {
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 9;
+ width: 100%;
+ height: 90px;
+ display: flex;
+ line-height: 44px;
+ background: #fff;
+ text-align: center;
+}
+
+.publicHeader-icon {
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ left: 20rpx;
+ z-index: 9;
+ margin-top: 12px;
+}
+
+.publicHeader-title {
+ width: 100%;
+ text-align: center;
+}
+
+/* 优惠券 */
+.couponTab {
+ display: flex;
+ background: #fff;
+ position: fixed;
+ width: 100%;
+ left: 0;
+ height: 100rpx;
+ top: 90px;
+ z-index: 99;
+}
+
+.couponTab-label {
+ flex: 3;
+ text-align: center;
+ position: relative;
+ padding: 10rpx 0 0;
+ font-size: 26rpx;
+}
+
+.couponTab-label::after {
+ position: absolute;
+ content: '';
+ left: calc(50% - 20rpx);
+ bottom: 0;
+ width: 40rpx;
+ background: transparent;
+ height: 6rpx;
+ border-radius: 30%;
+}
+
+.couponTab-label.active {
+ color: #f57e32
+}
+
+.couponTab-label.active::after {
+ background: #f57e32
+}
+
+.couponTab-label view {
+ font-size: 24rpx;
+ margin-top: 6rpx;
+}
+
+
+/* 列表 */
+.coupon {
+ margin-top: 170px;
+}
+
+.couponCont {
+ margin: 0 20rpx 20rpx;
+ width: calc(100% - 40rpx);
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.couponList {
+ background: #fff;
+ width: 100%;
+ height: 160rpx;
+ position: relative;
+}
+
+.couponList-left {
+ position: relative;
+ left: 0;
+ top: 0;
+ width: 160rpx;
+ height: 160rpx;
+}
+
+.couponList-img {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1;
+}
+
+.couponList-icon {
+ position: absolute;
+ left: calc(50% - 56rpx);
+ top: calc(50% - 50rpx);
+ z-index: 2;
+ width: 100rpx;
+ height: 100rpx;
+ background: #fff;
+ border-radius: 50%;
+ padding: 20rpx;
+ box-sizing: border-box;
+}
+
+.couponList-icon image {
+ width: 100%;
+ height: 100%;
+}
+
+.couponList-center {
+ position: absolute;
+ left: 180rpx;
+ top: 35rpx;
+ width: calc(100% - 330rpx);
+}
+
+.couponList-center.active {
+ top: 15rpx;
+}
+
+.couponList-title {
+ margin-bottom: 10rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.couponList-time,
+.couponList-used {
+ font-size: 24rpx;
+ color: grey;
+}
+
+.couponList-used {
+ margin-top: 14rpx;
+ color: grey;
+}
+
+.couponList-right {
+ background: #ee8e44;
+ color: #fff;
+ border-radius: 30rpx;
+ width: 110rpx;
+ text-align: center;
+ height: 50rpx;
+ line-height: 50rpx;
+ position: absolute;
+ right: 20rpx;
+ top: 55rpx;
+ font-size: 24rpx;
+}
+
+.couponList-right.active {
+ background: #dddddd;
+}
+
+.couponMore {
+ font-size: 28rpx;
+ color: #686868;
+ position: relative;
+ height: 120rpx;
+}
+
+.couponMore::after,
+.couponMore::before {
+ position: absolute;
+ content: '';
+ height: 20rpx;
+ border-radius: 10rpx;
+ background: #fff;
+ box-shadow: 0 0 20rpx rgba(0, 0, 0, .1);
+ z-index: 1;
+ height: 30rpx;
+}
+
+.couponMore::after {
+ width: calc(100% - 40rpx);
+ top: 70rpx;
+ left: 20rpx;
+}
+
+.couponMore::before {
+ width: calc(100% - 80rpx);
+ top: 90rpx;
+ left: 40rpx;
+}
+
+.couponMore-text {
+ display: flex;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ z-index: 99;
+ height: 80rpx;
+ border-radius: 0 0 10rpx 10rpx;
+ line-height: 80rpx;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ background: #fff;
+ box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
+}
+
+.couponMore-title {
+ flex: 1;
+}
+
+.couponMore-arrow {
+ width: 28rpx;
+ height: 28rpx;
+ margin-top: 26rpx;
+}
+
+.couponCont.active .couponList-img,
+.couponCont.active .couponList-icon {
+ -webkit-filter: grayscale(100%);
+ -moz-filter: grayscale(100%);
+ -ms-filter: grayscale(100%);
+ -o-filter: grayscale(100%);
+ filter: grayscale(100%);
+ filter: gray;
+}
+
+.coupoTips {
+ position: absolute;
+ top: 22rpx;
+ right: 20rpx;
+ z-index: 99;
+ width: 120rpx;
+ height: 120rpx;
+}
\ No newline at end of file
diff --git a/pages/couponArr/couponArr.js b/pages/couponArr/couponArr.js
new file mode 100644
index 0000000..51856a7
--- /dev/null
+++ b/pages/couponArr/couponArr.js
@@ -0,0 +1,78 @@
+// pages/couponArr/couponArr.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ id : '',
+ status : '',
+ couponArr : '', //卡券组列表
+ page : 1, //分页
+ lodingStats : false //加载状态
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ id : options.id,
+ status : options.status
+ })
+
+ // 获取卡券组列表
+ this.couponInfo();
+ },
+
+ /**
+ * 卡券组列表
+ */
+ couponInfo(page) {
+ wx.$api.user.couponArr(this.data.id, this.data.status, page || '').then(res=>{
+ let listArr = this.data.couponArr,
+ newData = []
+ if(page == 1 || page == undefined) listArr = []
+
+ newData = listArr.concat(res.data.data)
+ this.setData({
+ couponArr : newData,
+ page : res.data.page,
+ lodingStats : false
+ })
+ wx.stopPullDownRefresh()
+ })
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+ // 获取团购列表
+ this.couponInfo();
+ },
+
+ /**
+ * 上拉加载
+ */
+ onReachBottom(){
+ this.setData({
+ lodingStats: true
+ })
+ let pageNumber = this.data.page.current
+ if(this.data.page.has_more){
+ pageNumber++
+ this.couponInfo(pageNumber)
+ }
+ }
+
+ /**
+ * 去使用卡券
+ */
+ // applyTap(e) {
+ // let id = e.currentTarget.dataset.id
+ // wx.navigateTo({
+ // url: '/pages/couponDetails/couponDetails?id=' + id
+ // })
+ // }
+})
\ No newline at end of file
diff --git a/pages/couponArr/couponArr.json b/pages/couponArr/couponArr.json
new file mode 100644
index 0000000..977aa6f
--- /dev/null
+++ b/pages/couponArr/couponArr.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "我的卡券"
+}
\ No newline at end of file
diff --git a/pages/couponArr/couponArr.wxml b/pages/couponArr/couponArr.wxml
new file mode 100644
index 0000000..55ac026
--- /dev/null
+++ b/pages/couponArr/couponArr.wxml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ {{item.startTime}} 至 {{item.endTime}}
+ 活动来源: {{item.activity_name}}
+ 使用时间:{{item.used_at}}
+
+
+
+ 去使用
+
+
+
+
+
+
+
+
+
+ 查看全部{{item.count}}张卡券
+
+
+
+
+
+
+ 加载中...
+
+
+ 没有更多了~
+
+
+
+
+
+
+
+ 暂无优惠券
+
\ No newline at end of file
diff --git a/pages/couponArr/couponArr.wxss b/pages/couponArr/couponArr.wxss
new file mode 100644
index 0000000..874341a
--- /dev/null
+++ b/pages/couponArr/couponArr.wxss
@@ -0,0 +1,173 @@
+
+/* 列表 */
+.coupon {
+ margin: 20rpx 0;
+}
+
+.couponCont {
+ margin: 0 20rpx 20rpx;
+ width: calc(100% - 40rpx);
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.couponList {
+ background: #fff;
+ width: 100%;
+ height: 160rpx;
+ position: relative;
+}
+
+.couponList-left {
+ position: relative;
+ left: 0;
+ top: 0;
+ width: 160rpx;
+ height: 160rpx;
+}
+
+.couponList-img {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1;
+}
+
+.couponList-icon {
+ position: absolute;
+ left: calc(50% - 56rpx);
+ top: calc(50% - 50rpx);
+ z-index: 2;
+ width: 100rpx;
+ height: 100rpx;
+ background: #fff;
+ border-radius:50%;
+ padding: 20rpx;
+ box-sizing: border-box;
+}
+
+.couponList-icon image {
+ width: 100%;
+ height: 100%;
+}
+
+.couponList-center {
+ position: absolute;
+ left: 180rpx;
+ top: 35rpx;
+ width: calc(100% - 330rpx);
+}
+
+.couponList-center.active {
+ top: 15rpx;
+}
+
+.couponList-title {
+ margin-bottom: 10rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.couponList-time, .couponList-used {
+ font-size: 24rpx;
+ color: grey;
+}
+
+.couponList-used {
+ margin-top: 14rpx;
+}
+
+.couponList-right {
+ background: #ee8e44;
+ color: #fff;
+ border-radius: 30rpx;
+ width: 110rpx;
+ text-align: center;
+ height: 50rpx;
+ line-height: 50rpx;
+ position: absolute;
+ right: 20rpx;
+ top: 55rpx;
+ font-size: 24rpx;
+}
+
+.couponList-right.active {
+ background: #dddddd;
+}
+
+.couponMore {
+ font-size: 28rpx;
+ color: #686868;
+ position: relative;
+ height: 120rpx;
+}
+
+.couponMore::after, .couponMore::before {
+ position: absolute;
+ content: '';
+ height: 20rpx;
+ border-radius: 10rpx;
+ background: #fff;
+ box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
+ z-index: 1;
+ height: 30rpx;
+}
+
+.couponMore::after {
+ width: calc(100% - 40rpx);
+ top: 70rpx;
+ left: 20rpx;
+}
+
+.couponMore::before {
+ width: calc(100% - 80rpx);
+ top: 90rpx;
+ left: 40rpx;
+ }
+
+.couponMore-text {
+ display: flex;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ z-index: 99;
+ height: 80rpx;
+ border-radius: 0 0 10rpx 10rpx;
+ line-height: 80rpx;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ background: #fff;
+ box-shadow: 0 0 10rpx rgba(0, 0,0, .1);
+}
+
+.couponMore-title {
+ flex: 1;
+}
+
+.couponMore-arrow {
+ width: 28rpx;
+ height: 28rpx;
+ margin-top: 26rpx;
+}
+
+
+.couponCont.active .couponList-img, .couponCont.active .couponList-icon {
+ -webkit-filter: grayscale(100%);
+ -moz-filter: grayscale(100%);
+ -ms-filter: grayscale(100%);
+ -o-filter: grayscale(100%);
+ filter: grayscale(100%);
+ filter: gray;
+}
+
+.coupoTips {
+ position: absolute;
+ top: 22rpx;
+ right: 20rpx;
+ z-index: 99;
+ width: 120rpx;
+ height: 120rpx;
+}
\ No newline at end of file
diff --git a/pages/couponDetails/couponDetails.js b/pages/couponDetails/couponDetails.js
new file mode 100644
index 0000000..e75b43c
--- /dev/null
+++ b/pages/couponDetails/couponDetails.js
@@ -0,0 +1,213 @@
+// pages/couponDetails/couponDetails.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ id : 0, //优惠券id
+ longitude : 0, //经度
+ latitude : 0, //纬度
+ details : '', //优惠券信息
+ stores : [], //商家列表
+ content : '', //内容介绍
+ remark : '', //使用须知
+ qrcode : '', //二维码
+ barcode : '', //条形码
+ merchantcardinfo:'', //商家券信息
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+
+ onLoad (options) {
+
+ // 优惠券id
+ this.setData({
+ id :options.id
+ })
+
+ // 获取二维码
+ this.detailsCode()
+
+ // 获取条形码
+ this.detailsBarcode()
+ },
+
+ onShow(){
+ this.getCity();
+
+ // 检查定位是否为空
+ // if(this.data.latitude == 0 && this.data.longitude == 0){
+ // wx.getSetting({
+ // success: res=>{
+ // this.getCity()
+ // }
+ // })
+ // }
+ },
+
+ /**
+ * 获取城市信息
+ */
+ getCity(){
+ wx.getLocation({
+ success: res => {
+ this.setData({
+ latitude : res.latitude,
+ longitude : res.longitude
+ })
+
+ },
+ complete: () => {
+ // 获取详情信息
+ this.detailsInfo();
+ }
+ })
+ },
+
+ /**
+ * 二维码
+ */
+ detailsCode() {
+ let coupon_id = this.data.id
+ wx.$api.user.qrcode(coupon_id).then(res=>{
+ this.setData({
+ qrcode : res.data.qrcode
+ })
+ })
+ },
+
+ /**
+ * 条形码
+ */
+ detailsBarcode() {
+ let coupon_id = this.data.id
+ wx.$api.user.barcode(coupon_id).then(res=>{
+ this.setData({
+ barcode : res.data.barcode
+ })
+ })
+ },
+
+ /**
+ * 详情信息
+ */
+ detailsInfo() {
+ let coupon_id = this.data.id,
+ user_lng = this.data.longitude,
+ user_lat = this.data.latitude
+ wx.$api.user.couponinfo(coupon_id, user_lng, user_lat).then(res=>{
+ let stores = res.data.stores
+ stores.map(res=>{
+ let distance = res.distance
+ if(res.distance > 1000){
+ distance = (distance / 1000) + "km"
+ }else{
+ distance = distance + "m"
+ }
+ res.km = distance
+ })
+
+ this.setData({
+ details : res.data.info,
+ stores : stores,
+ remark : res.data.info.right.remark.replace(/\
{
+ if(res.tapIndex==0){
+ wx.makePhoneCall({
+ phoneNumber: tel
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 查看门店详情页
+ */
+ detailsTap(e) {
+ let store_id = e.currentTarget.dataset.id,
+ user_lng = this.data.longitude,
+ user_lat = this.data.latitude
+
+ wx.navigateTo({
+ url: '/pages/storeDetails/storeDetails?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat,
+ })
+ },
+
+ /**
+ * 加入微信卡包
+ */
+ join(e) {
+ let cardId = this.data.id
+ wx.$api.user.jssdk(cardId).then(res=>{
+ let pay = JSON.parse(res.data)
+ wx.addCard({
+ cardList : pay,
+ success : res => {
+ // 获取详情信息
+ this.detailsInfo();
+ },fail : res=> {
+ }
+ })
+ })
+ },
+
+ /**
+ * 商家券信息
+ */
+ getMerchantCardInfo(){
+ let coupon_id = this.data.id
+ wx.$api.user.merchant_card(coupon_id).then(res=>{
+ this.setData({
+ merchantcardinfo : res.data
+ })
+ })
+ },
+
+ /**
+ * 小程序插件领取
+ */
+ getcoupon(params) {
+ let detail = params.detail
+ if(detail.errcode !=='OK'){
+ wx.showToast({
+ title : detail.errmsg,
+ icon : 'none'
+ })
+ }else{
+ if(detail.send_coupon_result[0].code !=='SUCCESS'){
+ wx.showToast({
+ title : detail.send_coupon_result[0].message,
+ icon : 'none'
+ })
+ }else{
+ wx.showToast({
+ title : '领取成功',
+ icon : 'none'
+ })
+ }
+
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/couponDetails/couponDetails.json b/pages/couponDetails/couponDetails.json
new file mode 100644
index 0000000..649c84c
--- /dev/null
+++ b/pages/couponDetails/couponDetails.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "send-coupon": "plugin://sendCoupon/send-coupon"
+ },
+ "navigationBarTitleText": "卡券详情"
+}
\ No newline at end of file
diff --git a/pages/couponDetails/couponDetails.wxml b/pages/couponDetails/couponDetails.wxml
new file mode 100644
index 0000000..0ab2f15
--- /dev/null
+++ b/pages/couponDetails/couponDetails.wxml
@@ -0,0 +1,114 @@
+
+
+
+
+ {{details.name}}
+
+
+ 有效期: {{details.startTime}} - {{details.endTime}}
+
+
+ 活动来源 : {{details.activity_name}}
+
+ 劵码
+
+
+
+ {{details.code}}
+
+
+
+
+ 请出示以上券码给网点工作人员
+
+
+
+
+
+ 已加入微信卡包
+
+
+ 加入微信卡包
+
+
+
+
+
+
+ 已加入微信卡包
+
+
+ 加入微信卡包
+
+
+
+
+
+
+
+
+ 适用门店
+
+
+ 查看所有
+
+
+
+
+
+ 您尚未授权本时生活开启定位服务
+ 不能看到附近的商家哦,点击下方按钮开启
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+ {{item.address}}
+ {{item.km}}
+
+
+
+
+
+
+
+
+
+ 暂无门店
+
+
+
+
+
+
+
+
+
+ 使用须知
+
+
+
+
+
+
+
+
+
+
+ 内容介绍
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/couponDetails/couponDetails.wxss b/pages/couponDetails/couponDetails.wxss
new file mode 100644
index 0000000..82d7ede
--- /dev/null
+++ b/pages/couponDetails/couponDetails.wxss
@@ -0,0 +1,215 @@
+/* 卡券详情 */
+.details {
+ background: #fff;
+ margin: 20rpx;
+ width: calc(100% - 40rpx);
+ border-radius: 20rpx;
+ padding: 30rpx;
+ box-sizing: border-box;
+ box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
+}
+
+.detailsTop {
+ border-bottom: 2rpx dashed #c8c8c8;
+ padding-bottom: 40rpx;
+}
+
+.detailsTop-name {
+ font-size: 36rpx;
+ font-weight: 600;
+ margin-bottom: 20rpx;
+}
+
+.detailsTop-time {
+ color: #7e7e7e;
+ font-size: 26rpx;
+}
+
+.detailsCode {
+ text-align: center;
+ padding: 0 0 20rpx;
+ margin: 40rpx 0 30rpx;
+}
+
+.detailsCode image {
+ width: 300rpx;
+ height: 300rpx;
+ margin-bottom: 30rpx;
+}
+
+.detailsCode-text, .detailsStore-row {
+ color: #949494;
+ font-size: 28rpx;
+}
+
+.detailsCode-text {
+ text-align: center;
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #000;
+}
+
+.detailsCode-text text {
+ color: #999;
+ font-weight: normal;
+ font-size: 26rpx;
+}
+
+.detailsStore {
+ border-top: 2rpx #c8c8c8 solid;
+ padding-top: 40rpx;
+}
+
+.detailsStore-top, .detailsStore-row {
+ display: flex;
+ line-height: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.detailsStore-title {
+ flex: 1;
+ font-weight: 600;
+}
+
+.detailsStore-row image {
+ width: 26rpx;
+ height: 26rpx;
+ margin: 3rpx 0 0 6rpx;
+}
+
+.detailsStore-list {
+ position: relative;
+ margin-bottom: 40rpx;
+}
+
+.detailsStore-list:last-child {
+ margin-bottom: 0;
+}
+
+.detailsStore-logo {
+ width: 100rpx;
+ height: 100rpx;
+ border-radius: 10rpx;
+}
+
+.detailsStore-cont {
+ position: absolute;
+ left: 130rpx;
+ top: 0;
+ width: calc(100% - 130rpx);
+ display: flex;
+}
+
+.detailsStore-left {
+ width: calc(100% - 90rpx);
+ margin-right: 30rpx;
+}
+
+.detailsStore-tel {
+ width: 60rpx;
+ height: 60rpx;
+ margin-top: 25rpx;
+}
+
+.detailsStore-place {
+ font-size: 24rpx;
+ line-height: 40rpx;
+ color: #5a5a5a;
+ display: flex;
+}
+
+.detailsStore-place text {
+ flex: 1;
+ display: inline-block;
+ font-size: 28rpx;
+ margin-right: 20rpx;
+}
+
+
+.detailsStore-name {
+ margin-bottom: 20rpx;
+}
+
+.detailsText {
+ padding: 30rpx 30rpx 20rpx;
+ box-sizing: border-box;
+}
+
+.detailsText-title {
+ font-size: 32rpx;
+ font-weight: 600;
+ margin-bottom: 20rpx;
+}
+
+.detailsText-tips {
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #555557;
+ padding-bottom: 20rpx;
+}
+
+.detailsCode-join {
+ color: #ee8e44;
+ font-size: 24rpx;
+ border-radius: 50rpx;
+ border: 2rpx solid #ee8e44;
+ padding: 10rpx 20rpx;
+ display: inline-block;
+ margin-top: 30rpx;
+}
+
+.detailsCode-join.active {
+ border: 2rpx solid #999;
+ color: #999;
+}
+
+.source{
+ margin: 30rpx 0;
+ font-size: 28rpx;
+}
+
+.location {
+ background: white;
+ width: 100%;
+ text-align: center;
+ margin: 60rpx 0 0;
+}
+
+.location text {
+ font-size: 28rpx;
+ display: block;
+ line-height: 46rpx;
+ color: #999;
+}
+
+.location-btn[size="mini"] {
+ background-color: #ee8e44;
+ color: #fff;
+ font-size: 26rpx;
+ line-height: 66rpx;
+ margin-top: 30rpx;
+}
+
+.location-img {
+ width: 150rpx;
+ height: 120rpx;
+ margin-bottom: 20rpx;
+}
+
+.detailsBar {
+ text-align: center;
+ padding: 0 50rpx;
+ box-sizing: border-box;
+ margin-top: 60rpx;
+ margin-bottom: 40rpx;
+}
+
+
+.detailsBar image {
+ width: 100%;
+}
+
+.detailsBar .detailsCode-text {
+ margin-bottom: 10px;
+ color: #000;
+}
\ No newline at end of file
diff --git a/pages/frozen/frozen.js b/pages/frozen/frozen.js
new file mode 100644
index 0000000..725a08e
--- /dev/null
+++ b/pages/frozen/frozen.js
@@ -0,0 +1,40 @@
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ type : '', //类型
+ frozenData : [], //数组列表
+ blockeds : '', //待发放金额
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ type : options.type,
+ blockeds : options.blockeds
+ })
+ // 获取冻结列表
+ this.frozenInfo()
+ },
+
+ /**
+ * 冻结列表
+ */
+ frozenInfo() {
+ wx.$api.user.ungrants(this.data.type).then(res=>{
+ this.setData({
+ frozenData: res.data
+ })
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/frozen/frozen.json b/pages/frozen/frozen.json
new file mode 100644
index 0000000..aa6068c
--- /dev/null
+++ b/pages/frozen/frozen.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "待发放"
+}
\ No newline at end of file
diff --git a/pages/frozen/frozen.wxml b/pages/frozen/frozen.wxml
new file mode 100644
index 0000000..25b4fb9
--- /dev/null
+++ b/pages/frozen/frozen.wxml
@@ -0,0 +1,28 @@
+
+
+
+ 待发放(额度)
+ {{blockeds}}
+
+ 待发放期数详情
+ 共 {{frozenData.length}} 期
+
+
+ 分期
+
+
+ 第{{item.num}}期
+ 发放时间:{{item.start_at}}
+
+
+ +{{item.variable}}
+ 发放额度
+
+
+
+
+
+
+
+ 抱歉,目前暂无内容~
+
\ No newline at end of file
diff --git a/pages/frozen/frozen.wxss b/pages/frozen/frozen.wxss
new file mode 100644
index 0000000..adcbeee
--- /dev/null
+++ b/pages/frozen/frozen.wxss
@@ -0,0 +1,101 @@
+/* 待发放 */
+.frozenTop {
+ background: #3e3c37;
+ color: #e7e4d5;
+ margin: 20rpx;
+ padding: 40rpx;
+ box-sizing: border-box;
+ border-radius: 20rpx;
+ font-size: 34rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.frozenTop-number {
+ font-size: 40rpx;
+ font-weight: 600;
+ margin-top: 30rpx;
+}
+
+.frozenTop-tips {
+ position: absolute;
+ top: 0;
+ right: 0;
+ background: #030200;
+ color: #fff;
+ font-size: 28rpx;
+ padding: 12rpx 20rpx;
+ border-radius: 0 0 20rpx 20rpx;
+ display: flex;
+}
+
+.frozenTop-tips image {
+ width: 30rpx;
+ height: 30rpx;
+ margin: 4rpx 10rpx 0 0;
+}
+
+.frozenTop-btn {
+ position: absolute;
+ top: 110rpx;
+ right: 40rpx;
+ background: #dab684;
+ color: #fff;
+ font-size: 28rpx;
+ border-radius: 80rpx;
+ padding: 8rpx 30rpx;
+}
+
+.frozenCont {
+ background-color: #fff;
+ margin: 30rpx 20rpx;
+ border-radius: 20rpx;
+ font-size: 36rpx;
+}
+
+.frozenTitle {
+ padding: 20rpx;
+ box-sizing: border-box;
+ color: #9c9c9c;
+}
+
+.frozenList {
+ padding: 20rpx;
+ display: flex;
+ font-size: 32rpx;
+}
+
+.frozenList-left {
+ flex: 1;
+ line-height: 50rpx;
+}
+
+.frozenList-number {
+ line-height: 50rpx;
+ text-align: center;
+}
+
+.frozenList-name {
+ display: flex;
+}
+
+.frozenList-name image {
+ width: 32rpx;
+ height: 32rpx;
+ margin: 10rpx 10rpx 0 0;
+}
+
+.frozenList-time {
+ padding-left: 40rpx;
+}
+
+.frozenList-variable,
+.frozenList-time {
+ font-size: 26rpx;
+ color: #aaaaaa;
+}
+
+.frozenList-yellow {
+ color: #317afa;
+ font-weight: 600;
+}
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
new file mode 100644
index 0000000..e060074
--- /dev/null
+++ b/pages/index/index.js
@@ -0,0 +1,240 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ swiperCurrent :0,
+ current :0, //轮播图当前的下标
+ dots :true,
+ cityAll : '',
+ statusBarHeight : getApp().globalData.systInfo.statusBarHeight,
+ longitude : 0, //经度
+ latitude : 0, //纬度
+ adverts : [], //轮播图
+ stateType : "silver",
+ cardArr : [], //权益数组
+ activities : [], //周五福利
+ isUser : false, //用户登录状态
+ noticeData : '', //首页公告
+ loading : true, //骨架屏加载
+ address : {
+ city: "", //市
+ area: "", //区
+ city_code: "", //市编号
+ area_code: "" //区编号
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow () {
+ this.locaTion()
+ // 获取用户登录状态
+ this.setData({
+ isUser : getApp().globalData.isUser
+ })
+ },
+
+ /**
+ * 获取位置
+ */
+ locaTion(){
+ wx.getLocation({
+ success: res => {
+ this.setData({
+ latitude : res.latitude,
+ longitude : res.longitude
+ })
+
+ },
+ complete: () => {
+ // 获取卡权益
+ this.indexInfo();
+ }
+ })
+ },
+
+ /**
+ * 卡权益
+ */
+ indexInfo() {
+ if(this.data.stateType == 'shaky') {
+ wx.$api.index.index(this.data.city, this.data.longitude, this.data.latitude).then(res=>{
+ this.setData({
+ adverts : res.data.adverts,
+ cardArr : res.data.rights,
+ activities : res.data.activities,
+ noticeData : res.data.notice,
+ loading : false,
+ address : {
+ city: res.data.location.city_name,
+ area: res.data.location.district_name || "",
+ city_code: res.data.location.city_id,
+ area_code: res.data.location.district_id || ""
+ }
+ })
+ wx.stopPullDownRefresh()
+ }).catch(err=>{
+ if(!err.login){
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : ''
+ })
+ }
+ })
+ } else {
+ wx.$api.index.choice(this.data.stateType,this.data.city, this.data.longitude, this.data.latitude).then(res=>{
+ this.setData({
+ adverts : res.data.adverts,
+ cardArr : res.data.categorys,
+ noticeData : res.data.notice,
+ cityName : res.data.city_name,
+ loading : false,
+ address : {
+ city: res.data.location.city_name,
+ area: res.data.location.district_name || "",
+ city_code: res.data.location.city_id,
+ area_code: res.data.location.district_id || ""
+ }
+ })
+
+ wx.stopPullDownRefresh()
+ }).catch(err=>{
+ if(!err.login){
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : ''
+ })
+ }
+ })
+ }
+ },
+
+
+ /**
+ * tabs
+ */
+ orderTab(e){
+ if(this.data.stateType != e.currentTarget.dataset.state){
+ this.setData({
+ stateType: e.currentTarget.dataset.state
+ })
+ // 获取卡权益
+ this.indexInfo()
+
+ // 重置轮播图
+ this.setData({
+ current : 0,
+ swiperCurrent: 0
+ });
+ }
+ },
+
+ /**
+ * 处理未登录时的转跳
+ */
+ userNav(e){
+ let id = e.currentTarget.dataset.id
+ wx.getStorage({
+ key : 'token',
+ success:res=>{
+ wx.navigateTo({
+ url: '/pages/classify/classify?id=' + id
+ })
+ },
+ fail: (err) => {
+ wx.navigateTo({
+ url: "/pages/login/login"
+ })
+ }
+ })
+ },
+
+ /**
+ * 点击图片放大
+ */
+ clickImg(e) {
+ if(e.currentTarget.dataset.img == "") return
+ let imgUrl = [e.currentTarget.dataset.img]
+ wx.previewImage({
+ urls : imgUrl, //需要预览的图片http链接列表,注意是数组
+ current : imgUrl[0] // 当前显示图片的http链接,默认是第一个
+ })
+ },
+
+ /**
+ * 周五福利抢购
+ */
+ Snapup(e) {
+ let canBuy = e.currentTarget.dataset.can,
+ canText = e.currentTarget.dataset.text,
+ canId = e.currentTarget.dataset.id
+ if(!canBuy) {
+ wx.showToast({
+ title : canText,
+ icon : 'none',
+ duration: 2000
+ })
+ return
+ }
+
+ // 跳转分类页
+ wx.navigateTo({
+ url: '/pages/welfare/welfare?id=' + canId
+ })
+ },
+
+ /**
+ * 活动中心权益跳转详情
+ */
+ rightNav(e) {
+ let id = e.currentTarget.dataset.id
+ wx.getStorage({
+ key : 'token',
+ success:res=>{
+ wx.navigateTo({
+ url: '/pages/rights/rights?id=' + id
+ })
+ },
+ fail: (err) => {
+ wx.navigateTo({
+ url: "/pages/login/login"
+ })
+ }
+ })
+ },
+
+ /**
+ * 下拉刷新
+ */
+ onPullDownRefresh(){
+ // 获取卡权益
+ this.indexInfo();
+ this.locaTion();
+ },
+
+ /**
+ * 防止swiper控件卡死
+ */
+ swiperChange(e){
+ if (this.data.current == 0 && this.data.swiperCurrent>1 ) {//卡死时,重置current为正确索引
+ this.setData({ current: this.data.swiperCurrent });
+ }
+ else {//正常轮转时,记录正确页码索引
+ this.setData({ swiperCurrent: e.detail.current });
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/pages/index/index.json b/pages/index/index.json
new file mode 100644
index 0000000..2d21589
--- /dev/null
+++ b/pages/index/index.json
@@ -0,0 +1,10 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "",
+ "navigationBarBackgroundColor": "#000000",
+ "backgroundColor": "#f4f4f4",
+ "navigationBarTextStyle": "white",
+ "navigationStyle" : "custom",
+ "backgroundTextStyle" : "dark",
+ "enablePullDownRefresh" : true
+}
\ No newline at end of file
diff --git a/pages/index/index.skeleton.wxml b/pages/index/index.skeleton.wxml
new file mode 100644
index 0000000..f3b4dfc
--- /dev/null
+++ b/pages/index/index.skeleton.wxml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+ 哈尔滨市南岗区
+
+
+
+
+
+ 活动中心
+
+ 白金会员
+
+ 钻石会员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 您的预约已成功,请点击继续办理
+
+
+
+
+
+
+ 抱歉, 此地区暂无权益
+
+
+
+
+ 周五会员福利日
+
+
+
+
+
+
+ 15
+ 元
+
+ 全车型洗车券
+
+
+
+
+ 每周五:
+ 08:00:00 开抢
+ [限量100份] [剩余97份]
+
+
+
+ 抢
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/index/index.skeleton.wxss b/pages/index/index.skeleton.wxss
new file mode 100644
index 0000000..be722ac
--- /dev/null
+++ b/pages/index/index.skeleton.wxss
@@ -0,0 +1,94 @@
+/*
+此文件为开发者工具生成,生成时间: 2021/4/22 下午3:55:40
+
+在 H:\工作项目\亿时代-本时生活-2021-04-13\本时生活\pages\index\index.wxss 中引入样式
+```
+@import "./index.skeleton.wxss";
+```
+
+更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
+*/
+.sk-transparent {
+ color: transparent !important;
+ }
+.sk-text-30-0000-789 {
+ background-image: linear-gradient(transparent 30.0000%, #EEEEEE 0%, #EEEEEE 70.0000%, transparent 0%) !important;
+ background-size: 100% 80.0000rpx;
+ position: relative !important;
+ }
+.sk-text {
+ background-origin: content-box !important;
+ background-clip: content-box !important;
+ background-color: transparent !important;
+ color: transparent !important;
+ background-repeat: repeat-y !important;
+ }
+.sk-text-32-2222-11 {
+ background-image: linear-gradient(transparent 32.2222%, #EEEEEE 0%, #EEEEEE 67.7778%, transparent 0%) !important;
+ background-size: 100% 90.0000rpx;
+ position: relative !important;
+ }
+.sk-text-32-2222-270 {
+ background-image: linear-gradient(transparent 32.2222%, #EEEEEE 0%, #EEEEEE 67.7778%, transparent 0%) !important;
+ background-size: 100% 90.0000rpx;
+ position: relative !important;
+ }
+.sk-text-14-2857-898 {
+ background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+ background-size: 100% 39.2000rpx;
+ position: relative !important;
+ }
+.sk-text-14-2857-980 {
+ background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+ background-size: 100% 39.2000rpx;
+ position: relative !important;
+ }
+.sk-text-14-2857-662 {
+ background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+ background-size: 100% 39.2000rpx;
+ position: relative !important;
+ }
+.sk-text-14-2857-553 {
+ background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
+ background-size: 100% 39.2000rpx;
+ position: relative !important;
+ }
+.sk-text-13-6364-777 {
+ background-image: linear-gradient(transparent 13.6364%, #EEEEEE 0%, #EEEEEE 86.3636%, transparent 0%) !important;
+ background-size: 100% 44.0000rpx;
+ position: relative !important;
+ }
+.sk-text-13-6364-28 {
+ background-image: linear-gradient(transparent 13.6364%, #EEEEEE 0%, #EEEEEE 86.3636%, transparent 0%) !important;
+ background-size: 100% 44.0000rpx;
+ position: relative !important;
+ }
+.sk-text-22-7273-273 {
+ background-image: linear-gradient(transparent 22.7273%, #EEEEEE 0%, #EEEEEE 77.2727%, transparent 0%) !important;
+ background-size: 100% 44.0000rpx;
+ position: relative !important;
+ }
+.sk-image {
+ background: #EFEFEF !important;
+ }
+.sk-pseudo::before, .sk-pseudo::after {
+ background: #EFEFEF !important;
+ background-image: none !important;
+ color: transparent !important;
+ border-color: transparent !important;
+ }
+.sk-pseudo-rect::before, .sk-pseudo-rect::after {
+ border-radius: 0 !important;
+ }
+.sk-pseudo-circle::before, .sk-pseudo-circle::after {
+ border-radius: 50% !important;
+ }
+.sk-container {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ background-color: transparent;
+ }
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
new file mode 100644
index 0000000..db5acf4
--- /dev/null
+++ b/pages/index/index.wxml
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+ {{address.city}}{{address.area}}
+
+
+
+
+
+
+
+
+ 活动中心
+
+ 白金会员
+
+ 钻石会员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{noticeData}}
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+ {{item.label}}
+
+
+
+
+
+ 抱歉, 此地区暂无权益
+
+
+
+
+
+
+ 周五会员福利日
+
+
+
+
+
+ {{item.price}} 元
+ {{item.title}}
+
+
+
+
+ 每周五:
+ {{item.start_time}} 开抢
+ {{item.end_time}} 结束
+ [限量{{item.stock}}份] [剩余{{item.surplus}}份]
+
+
+
+ 抢
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+ {{item.label}}
+
+
+
+
+
+ 抱歉, 此地区暂无权益
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
new file mode 100644
index 0000000..177c5b0
--- /dev/null
+++ b/pages/index/index.wxss
@@ -0,0 +1,544 @@
+/* 首页 */
+page {
+ background: #fff;
+}
+
+.indexTab {
+ position: fixed;
+ display: flex;
+ width: 100%;
+ height: 90rpx;
+ line-height: 90rpx;
+ z-index: 999;
+ padding: 0 40rpx;
+ top: 80rpx;
+ box-sizing: border-box;
+ background-color: #07081d;
+}
+
+.indexTab-lable {
+ text-align: center;
+ flex: 3;
+ color: #fff;
+ position: relative;
+}
+
+.indexTab-lable.active {
+ background-image: -webkit-linear-gradient(left, #e4dab7, #d9b672);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ font-weight: 600;
+ font-size: 38rpx;
+}
+
+/* 轮播图 */
+.indexBanner {
+ height: 360rpx;
+ position: relative;
+ padding-top: 20rpx;
+}
+
+.indexBanner::after {
+ position: absolute;
+ left: 0;
+ top: 0;
+ height: 240rpx;
+ width: 100%;
+ content: '';
+ background: #07081d;
+ border-radius: 0 0 200rpx 200rpx;
+}
+
+.banner {
+ position: relative;
+ padding-top: 48%;
+ width: calc(100% - 100rpx);
+ background: white;
+ margin: 0 50rpx;
+ border-radius: 30rpx;
+ overflow: hidden;
+ z-index: 99;
+}
+
+.banner-swiper {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.banner-img {
+ width: 100%;
+ height: 100%;
+ vertical-align: top;
+}
+
+/* 指示点 */
+.dots {
+ margin: 30rpx 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+}
+
+.dots view {
+ width: 14rpx;
+ height: 14rpx;
+ margin: 0 6rpx;
+ border-radius: 50%;
+ background-color: #c5c5c5;
+}
+
+.dots .active {
+ width: 24rpx;
+ border-radius: 40rpx;
+ background-color: #f46851;
+}
+
+/* 提示 */
+.indexNews {
+ background: #dddddd;
+ padding: 25rpx 40rpx;
+ display: flex;
+ font-size: 28rpx;
+}
+
+.indexNews image {
+ width: 34rpx;
+ height: 34rpx;
+ margin: 4rpx 20rpx 0 0;
+}
+
+/* 权益列表 */
+.cardArr {
+ padding: 40rpx 30rpx 30rpx;
+ box-sizing: border-box;
+ overflow: hidden;
+}
+
+.cardArr-top {
+ flex-wrap: wrap;
+ display: flex;
+}
+
+.indexCard {
+ width: 33.33%;
+ text-align: center;
+ position: relative;
+ flex: 0 0 33.3333%;
+ margin-bottom: 40rpx;
+}
+
+.indexCard-img {
+ width: 140rpx;
+ height: 140rpx;
+ border-radius: 50%;
+}
+
+.activity-tips {
+ position: absolute;
+ top: -10rpx;
+ right: 10rpx;
+ z-index: 9;
+ background-image: -webkit-linear-gradient(left, #ff0000, #ff0000);
+ color: #fff;
+ font-size: 24rpx;
+ padding: 0 18rpx;
+ height: 40rpx;
+ line-height: 40rpx;
+ border-radius: 20rpx;
+ animation: zy 2.5s .15s linear infinite;
+ -moz-animation: zy 2.5s .15s linear infinite;
+ -webkit-animation: zy 2.5s .15s linear infinite;
+ -o-animation: zy 2.5s .15s linear infinite;
+}
+
+.indexCard-tips {
+ background-image: -webkit-linear-gradient(left, #ef354c, #ef001e);
+ color: #fff300;
+ height: 34rpx;
+ line-height: 32rpx;
+ padding: 0 10rpx;
+ right: 25rpx;
+}
+
+@keyframes zy {
+ 10% {
+ transform: rotate(15deg);
+ }
+
+ 20% {
+ transform: rotate(-10deg);
+ }
+
+ 30% {
+ transform: rotate(5deg);
+ }
+
+ 40% {
+ transform: rotate(-5deg);
+ }
+
+ 50%,
+ 100% {
+ transform: rotate(0deg);
+ }
+}
+
+.indexCard-title {
+ font-weight: 600;
+ margin: 5rpx 20rpx;
+ font-size: 30rpx;
+}
+
+.indexCard-remark {
+ font-size: 26rpx;
+ color: #8a8a8a;
+}
+
+/* 新增活动权利列表样式 */
+.activity-remark {
+ background-color: #000000;
+ display: inline-block;
+ border-radius: 40rpx;
+ height: 38rpx;
+ line-height: 38rpx;
+ padding: 0 10rpx;
+}
+
+.activity-remark text {
+ display: block;
+ background-image: -webkit-linear-gradient(left, #e4dab7, #d9b672);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ font-size: 22rpx;
+}
+
+
+/* 定位 */
+
+.locationPicker {
+ background: #000;
+ color: #fff;
+ height: 80rpx;
+ line-height: 80rpx;
+ position: fixed;
+ width: 100%;
+ z-index: 1009;
+ top: 0;
+ left: 0;
+}
+
+.locationPicker-icon {
+ width: 38rpx;
+ height: 38rpx;
+ float: left;
+ vertical-align: middle;
+ margin: 22rpx 10rpx 0 20rpx;
+}
+
+.locationPicker-region-icon {
+ width: 44rpx;
+ height: 44rpx;
+ margin-top: 12rpx;
+}
+
+.cityCont {
+ width: 60%;
+ display: flex;
+}
+
+.cityCont view {
+ max-width: calc(100% - 50rpx);
+}
+
+.cityCont image {
+ width: 50rpx;
+ height: 50rpx;
+ margin-top: 16rpx;
+}
+
+/* 权益提示 */
+.legalTips {
+ text-align: center;
+ font-size: 28rpx;
+ color: #999;
+ padding: 80rpx;
+ margin: 0 auto;
+}
+
+.legalTips image {
+ width: 240rpx;
+ height: 180rpx;
+ display: block;
+ margin: 0 auto 40rpx;
+}
+
+/* 滚动 */
+/*首页跑马灯效果*/
+@keyframes around {
+ from {
+ margin-left: 60rpx;
+ }
+
+ to {
+ /* var接受传入的变量 */
+ margin-left: var(--marqueeWidth--);
+ }
+}
+
+.marquee_container {
+ width: calc(100% - 40rpx);
+ overflow: hidden;
+}
+
+.marquee_container:hover {
+ /* 不起作用 */
+ animation-play-state: paused;
+}
+
+.marquee_text {
+ font-size: 28rpx;
+ display: inline-block;
+ white-space: nowrap;
+}
+
+.marquee_text.active {
+ animation-name: around;
+ animation-duration: 20s;
+ /*过渡时间*/
+ animation-iteration-count: infinite;
+ animation-timing-function: linear;
+}
+
+/* 福利日 */
+
+.Welfare {
+ text-align: center;
+}
+
+.WelfareTitle {
+ display: inline-block;
+ background-color: #020202;
+ border-radius: 20rpx 20rpx 10rpx 10rpx;
+ height: 68rpx;
+ line-height: 68rpx;
+ padding: 0 50rpx;
+}
+
+.WelfareTitle text,
+.WelfareList-btn text {
+ background-image: -webkit-linear-gradient(left, #e4dab7, #d9b672);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+}
+
+.WelfareTitle text {
+ font-weight: 600;
+ font-size: 38rpx;
+}
+
+.WelfareList {
+ background-color: #020202;
+ border-radius: 20rpx;
+ padding: 40rpx 30rpx;
+ box-sizing: border-box;
+ position: relative;
+ overflow: hidden;
+}
+
+.WelfareList::after {
+ position: absolute;
+ content: '';
+ top: -60rpx;
+ right: 0;
+ background-image: -moz-linear-gradient(right, rgba(255, 255, 255, .2), rgba(0, 0, 0, 0));
+ background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, .2), rgba(0, 0, 0, 0));
+ background-image: linear-gradient(right, rgba(255, 255, 255, .2), rgba(0, 0, 0, 0));
+ width: 200rpx;
+ height: 200rpx;
+ border-radius: 50%;
+}
+
+.WelfareList-back {
+ position: relative;
+ width: 100%;
+ height: 220rpx;
+ padding: 30rpx;
+ box-sizing: border-box;
+ margin-bottom: 40rpx;
+}
+
+.WelfareList-back:last-child {
+ margin: 0;
+}
+
+.WelfareList-img {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 1;
+}
+
+.WelfareList-img.active {
+ -webkit-filter: grayscale(100%);
+ -moz-filter: grayscale(100%);
+ -ms-filter: grayscale(100%);
+ -o-filter: grayscale(100%);
+ filter: grayscale(100%);
+ filter: gray;
+}
+
+.WelfareList-left,
+.WelfareList-right,
+.WelfareList-btn {
+ position: absolute;
+ z-index: 2;
+ left: 0;
+}
+
+.WelfareList-left {
+ top: -4rpx;
+ width: 180rpx;
+ font-weight: 600;
+ display:table;
+ height: 226rpx;
+}
+
+.cell {
+ display:table-cell;
+ vertical-align:middle;
+}
+
+.WelfareList-left-title {
+ font-size: 28rpx;
+ word-break:normal;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+}
+
+.WelfareList-left .WelfareList-left-price {
+ font-size: 40rpx;
+}
+
+.WelfareList-left text {
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.WelfareList-right {
+ line-height: 44rpx;
+ width: 100%;
+ padding-left: 200rpx;
+ padding-right: 160rpx;
+ box-sizing: border-box;
+ text-align: left;
+ display: flex;
+}
+
+.WelfareList-cont {
+ width: 100%;
+ margin-top: -8rpx;
+}
+
+.WelfareList-btn {
+ left: auto;
+ top: 55rpx;
+ right: 30rpx;
+ background-color: #020202;
+ width: 110rpx;
+ height: 110rpx;
+ text-align: center;
+ line-height: 110rpx;
+ border-radius: 50%;
+ overflow: hidden;
+}
+
+.WelfareList-btn::after {
+ position: absolute;
+ content: '';
+ top: -50rpx;
+ left: 0;
+ background-image: -moz-linear-gradient(right, rgba(255, 255, 255, .25), rgba(0, 0, 0, 0));
+ background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, .25), rgba(0, 0, 0, 0));
+ background-image: linear-gradient(right, rgba(255, 255, 255, .25), rgba(0, 0, 0, 0));
+ width: 100rpx;
+ height: 100rpx;
+ border-radius: 50%;
+}
+
+.WelfareList-btn.active {
+ background-color: #9c9c9c;
+}
+
+.WelfareList-btn.active::before {
+ position: absolute;
+ content: '';
+ width: 100%;
+ height: 4rpx;
+ background-color: #cecece;
+ left: 0;
+ top: 50%;
+ transform:rotate(45deg);
+}
+
+.WelfareList-btn.active text {
+ background-image: -moz-linear-gradient(#c3c3c3);
+ background-image: -webkit-linear-gradient(#c3c3c3);
+ background-image: linear-gradient(#c3c3c3);
+ -webkit-text-fill-color: #c3c3c3;
+}
+
+
+.WelfareList-btn text {
+ font-weight: 600;
+ font-size: 54rpx;
+}
+
+.WelfareList-all {
+ font-size: 24rpx;
+}
+
+.WelfareList-text {
+ font-size: 28rpx;
+}
+
+.light {
+ cursor: pointer;
+ position: absolute;
+ left: -100%;
+ top: 0;
+ width: 40px;
+ height: 100%;
+ background: rgba(255, 255, 255, 0);
+ transform: skewx(25deg);
+ -webkit-transition: all .5s ease-in;
+ -moz-transition: all .5s ease-in;
+ -o-transition: all .5s ease-in;
+ transition: all .5s ease-in;
+ animation-name: example;
+ animation-duration: 3.5s;
+ animation-iteration-count: infinite;
+}
+
+
+@keyframes example {
+ 0% {
+ left: -100%;
+ background: rgba(255, 255, 255, .4);
+ }
+
+ 50% {
+ left: -50%;
+ background: rgba(255, 255, 255, .7);
+ }
+
+ 100% {
+ left: 100%;
+ background: rgba(255, 255, 255, 0);
+ }
+}
\ No newline at end of file
diff --git a/pages/login/login.js b/pages/login/login.js
new file mode 100644
index 0000000..5c792e3
--- /dev/null
+++ b/pages/login/login.js
@@ -0,0 +1,124 @@
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isLogin : false,
+ loginCode : "", //code
+ userInfo : {}, //用户
+ iv : '',
+ encryptedData : '',
+ way : '' //登录方式-活动
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ // 登录方式-活动
+ this.setData({
+ way : options.way
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow () {
+ wx.login({
+ success: res => {
+ this.setData({
+ loginCode: res.code
+ })
+ }
+ })
+ },
+
+ /**
+ * 登录
+ */
+ userInfo(e){
+ if(e.detail.errMsg == "getUserInfo:ok"){
+ this.setData({
+ isLogin : true,
+ userInfo : e.detail.rawData,
+ iv : e.detail.iv,
+ encryptedData : e.detail.encryptedData
+ })
+
+ // 检查用户登录Code是否过期
+ wx.checkSession({
+ success: res=>{
+ this.userLogin()
+ },
+ fail: err=>{
+ // 登录过期重新获取code
+ wx.login({
+ success: res=>{
+ this.setData({
+ loginCode: res.code
+ })
+ // 登录
+ this.userLogin()
+ }
+ })
+ }
+ })
+ }else{
+ wx.showToast({
+ title: '拒绝了登录授权',
+ icon : 'none'
+ })
+ }
+ },
+
+ /**
+ * 用户登录
+ */
+ userLogin(){
+ let code = this.data.loginCode,
+ iv = this.data.iv,
+ encryptedData = this.data.encryptedData
+
+ wx.$api.enroll.record(code, iv, encryptedData).then(res=>{
+ getApp().globalData.token = res.data.token
+
+ // 更新全局存储器用户状态
+ getApp().globalData.isUser = true
+
+
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : res.data.token
+ })
+
+ // 存入缓存
+ app.globalData.userInfo = res.data.users
+ app.globalData.wechatUser = res.data.wechatUser_id
+
+ this.setData({
+ isLogin: false
+ })
+
+ wx.navigateTo({
+ url: "/pages/chooseTel/chooseTel?way=" + this.data.way
+ })
+
+ // 写入缓存
+ wx.setStorage({
+ key : 'users',
+ data : res.data.users
+ })
+ })
+ }
+
+})
\ No newline at end of file
diff --git a/pages/login/login.json b/pages/login/login.json
new file mode 100644
index 0000000..c67fc7a
--- /dev/null
+++ b/pages/login/login.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "微信授权",
+ "navigationBarBackgroundColor": "#000000",
+ "navigationBarTextStyle": "white"
+}
\ No newline at end of file
diff --git a/pages/login/login.wxml b/pages/login/login.wxml
new file mode 100644
index 0000000..d72aee6
--- /dev/null
+++ b/pages/login/login.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/login/login.wxss b/pages/login/login.wxss
new file mode 100644
index 0000000..e36d466
--- /dev/null
+++ b/pages/login/login.wxss
@@ -0,0 +1,36 @@
+/* 登录 */
+
+page {
+ background: #000;
+}
+
+.loginImg {
+ position: relative;
+ height: 100vh;
+ width: 100%;
+}
+
+.loginImg image {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.loginBtn[size="mini"]{
+ background: #33f800;
+ color: #000;
+ width: 240rpx;
+ height: 86rpx;
+ line-height: 76rpx;
+ border-radius: 30rpx;
+ position: absolute;
+ bottom: 5vh;
+ left: calc(50% - 120rpx);
+ padding: 0;
+ margin: 0;
+ border: 4rpx solid #fff;
+ box-sizing: border-box;
+ font-size: 36rpx;
+}
\ No newline at end of file
diff --git a/pages/order/order.js b/pages/order/order.js
new file mode 100644
index 0000000..69d81f8
--- /dev/null
+++ b/pages/order/order.js
@@ -0,0 +1,187 @@
+// pages/activityOrder/activityOrder.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ stateType : 'all', //状态
+ counts : '', //数量
+ orderArr : [], //列表
+ page : {}, //下一页
+ lodingStats : false, //加载状态
+ pay : {
+ payTips : 1, //支付方式
+ payState : false, //支付状态
+ orderId : '', //支付订单
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ stateType: options.stateType
+ })
+ },
+
+ onShow() {
+ // 获取商品活动订单
+ this.orderInfo();
+ },
+
+ /**
+ * 商品活动订单
+ */
+ orderInfo(page) {
+ wx.$api.exchange.index(this.data.stateType, page).then(res=>{
+ let listArr = this.data.orderArr,
+ newData = []
+ if(page == 1 || page == undefined) listArr = []
+
+ newData = listArr.concat(res.data.data)
+ this.setData({
+ counts : res.data.count,
+ orderArr : newData,
+ page : res.data.page,
+ lodingStats : false
+ })
+ wx.stopPullDownRefresh()
+ })
+ },
+
+ /**
+ * tabs
+ */
+ orderTab(e){
+ if(this.data.stateType != e.currentTarget.dataset.state){
+ this.setData({
+ stateType: e.currentTarget.dataset.state
+ })
+
+ // 获取商品活动订单
+ this.orderInfo()
+
+ wx.pageScrollTo({
+ scrollTop: 0
+ })
+ }
+ },
+
+ /**
+ * 取消订单
+ */
+ orderDelete(e) {
+ let orderId = e.currentTarget.dataset.id
+ wx.showModal({
+ title : '订单取消',
+ content : '确认取消吗?',
+ success : res=> {
+ if (res.confirm) {
+ wx.$api.exchange.cancel(orderId).then(res=>{
+ // 获取商品活动订单
+ this.orderInfo()
+
+ wx.showToast({
+ title: res.data,
+ icon : 'none'
+ })
+ })
+ } else if (res.cancel) {
+ wx.showToast({
+ title : '取消',
+ icon : 'loading',
+ duration: 1000
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 支付提交
+ */
+ orderPay() {
+ wx.$api.exchange.payments(this.data.pay.orderId).then(res=>{
+ // payTips为1的时候为微信支付
+ if(this.data.pay.payTips == 1) {
+ wx.$api.index.wechat(res.data.trade_no).then(res=>{
+ let payInfo = JSON.parse(res.data)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/coupon/coupon?type=couponPublic'
+ })
+ },2000)
+ }
+ },
+ fail : res=>{
+ wx.redirectTo({
+ url: '/pages/order/order?stateType=unpay'
+ })
+ }
+ })
+ })
+ }
+ // payTips为2的时候为沃钱包支付
+ if(this.data.pay.payTips == 2) {
+ const newUrl = "https://lifetest.ysd-bs.com/unicom/payment?trade_no=" + res.data.trade_no
+ let url= encodeURIComponent(newUrl)
+ wx.navigateTo({
+ // 跳转到webview页面
+ url: `/pages/webView/webView?url=${url}`
+ });
+ }
+
+ this.setData({
+ ['pay.payState']: false
+ })
+ })
+
+ },
+
+ /**
+ * 支付选择弹出
+ */
+ submitPay(e) {
+ this.setData({
+ ['pay.payState']: !this.data.pay.payState,
+ ['pay.orderId'] : e.currentTarget.dataset.id
+ })
+ },
+
+ /**
+ * 上拉加载
+ */
+ onReachBottom(){
+ this.setData({
+ lodingStats: true
+ })
+ let pageNumber = this.data.page.current
+ if(this.data.page.has_more){
+ pageNumber++
+ this.orderInfo(pageNumber)
+ }
+ },
+
+ /**
+ * 选择支付方式
+ */
+ radioChange(e) {
+ this.setData({
+ ['pay.payTips']: e.detail.value
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/order/order.json b/pages/order/order.json
new file mode 100644
index 0000000..a06e085
--- /dev/null
+++ b/pages/order/order.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "兑换订单"
+}
\ No newline at end of file
diff --git a/pages/order/order.wxml b/pages/order/order.wxml
new file mode 100644
index 0000000..b282543
--- /dev/null
+++ b/pages/order/order.wxml
@@ -0,0 +1,94 @@
+
+
+
+ 全部
+
+
+ 待支付
+
+
+
+ 待发货
+
+
+
+
+ 已发货
+
+
+
+
+
+
+
+
+
+ {{item.orderid}}
+ {{item.state_text}}
+ {{item.state_text}}
+ {{item.state_text}}
+
+
+
+
+ {{item.items.title}}
+
+ 红包电子券
+ 实物券
+
+
+ ¥{{item.items.price}} × {{item.items.qty}}
+
+
+
+
+ 订单详情
+
+ 取消订单
+ 立即支付
+
+
+
+
+
+
+ 加载中...
+
+
+ 没有更多了~
+
+
+
+
+
+
+ 暂无订单
+
+
+
+
+ 请选择支付方式
+
+
+
+
+ 微信支付
+
+
+
+
+
+
+ 沃钱包支付
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order/order.wxss b/pages/order/order.wxss
new file mode 100644
index 0000000..0904a21
--- /dev/null
+++ b/pages/order/order.wxss
@@ -0,0 +1,319 @@
+/*
+ * 亿时代
+ */
+
+.order-tab {
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ display: flex;
+ height: 80rpx;
+ line-height: 80rpx;
+ z-index: 9;
+ background: white;
+}
+
+.order-tab-item {
+ font-size: 28rpx;
+ width: 25%;
+ text-align: center;
+ border-bottom: solid 2rpx #f7f7f7;
+ color: #464854;
+ background: white;
+ position: relative;
+}
+
+.order-tab-item.active {
+ color: #f57e32;
+}
+
+.order-tab-item::after {
+ content: '';
+ position: absolute;
+ width: 30rpx;
+ height: 4rpx;
+ background: transparent;
+ left: calc(50% - 15rpx);
+ bottom: -2rpx;
+}
+
+.order-tab-item.active::after {
+ background: #f57e32;
+}
+
+.state-tips {
+ position: absolute;
+ top: 10rpx;
+ right: 14rpx;
+ background: #e92706;
+ color: #fff;
+ font-size: 24rpx;
+ transform: scale(.7, .7);
+ border-radius: 60rpx 60rpx 60rpx 0;
+ width: 48rpx;
+ height: 34rpx;
+ line-height: 34rpx;
+}
+
+/* 订单列表 */
+
+.order-content {
+ padding: 80rpx 0 20rpx 0;
+}
+
+.order-content-li {
+ background: white;
+ margin-top: 20rpx;
+ position: relative;
+}
+
+.order-name {
+ background: #fff;
+ padding: 20rpx;
+ box-sizing: border-box;
+ border-bottom: solid 1rpx #f3f3f3;
+ display: flex;
+}
+
+.order-name image {
+ background: linear-gradient(#000, #000);
+ background-blend-mode: lighten;
+ background-size: cover;
+ width: 26rpx;
+ height: 26rpx;
+ border-radius: 50%;
+ margin: 8rpx 14rpx 0 0;
+}
+
+.order-store {
+ padding: 20rpx;
+ border-bottom: solid 1rpx #f3f3f3;
+ display: flex;
+}
+
+.order-goods-tips {
+ display: flex;
+}
+
+.order-goods-tips text {
+ display: inline-block;
+ background: #e92706;
+ color: #fff;
+ border-radius: 20rpx;
+ padding: 0 20rpx;
+ height: 42rpx;
+ line-height: 42rpx;
+ font-size: 24rpx;
+ transform: scale(.8, .8);
+}
+
+text.order-goods-tips-color {
+ background: #e6b329;
+}
+
+.order-store-stateText {
+ color: #e6b329;
+ font-size: 26rpx;
+}
+
+.order-store-stateText.red {
+ color: #e92344;
+}
+
+.order-store-stateText.green {
+ color: #79b300;
+}
+
+.order-store-title {
+ flex: 1;
+ color: #999;
+ font-size: 28rpx;
+}
+
+.order-store-orderid {
+ color: #747788;
+ font-size: 25rpx;
+}
+
+.order-store-title text {
+ color: white;
+ font-size: 24rpx;
+ background: #e92344;
+ margin-right: 10rpx;
+ padding: 0 10rpx;
+}
+
+.order-goods {
+ padding: 20rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.order-goods-cover {
+ width: 150rpx;
+ height: 150rpx;
+ vertical-align: top;
+ border-radius: 4rpx;
+}
+
+.order-goods-content {
+ position: absolute;
+ left: 190rpx;
+ top: 20rpx;
+ right: 20rpx;
+ width: calc(100% - 210rpx);
+}
+
+.order-goods-content-name {
+ margin-bottom: 10rpx;
+ font-size: 30rpx;
+ font-weight: 600;
+}
+
+.order-goods-content-price {
+ color: #747788;
+ display: flex;
+ margin-top: 10rpx;
+ font-size: 28rpx;
+}
+
+.order-goods-content-price text {
+ color: #f57e32;
+ display: inline-block;
+ margin-right: 10rpx;
+ font-size: 30rpx;
+}
+
+.order-total {
+ padding: 20rpx;
+ box-sizing: border-box;
+ font-size: 26rpx;
+ line-height: 50rpx;
+ color: #747788;
+ display: flex;
+}
+
+.order-total view {
+ margin-right: 30rpx;
+}
+
+.order-total text {
+ color: #e92344;
+ font-weight: bold;
+}
+
+.order-btns {
+ font-size: 25rpx;
+ display: flex;
+ padding: 20rpx;
+ box-sizing: border-box;
+ flex-wrap: wrap;
+ flex-direction: row-reverse;
+}
+
+.order-btn {
+ margin-left: 20rpx;
+ height: 52rpx;
+ line-height: 50rpx;
+ box-sizing: border-box;
+ border: solid 1rpx #747788;
+ padding: 0 20rpx;
+ border-radius: 30rpx;
+}
+
+.order-btn-back {
+ border-color: #f57e32;
+ color: #f57e32;
+}
+
+.orderVirtual {
+ background: #f57e32;
+ color: #fff;
+ border-radius: 4rpx;
+ display: inline-block;
+ font-size: 24rpx;
+ padding: 2rpx 8rpx
+}
+
+.orderVirtual.active {
+ background: #88be2d;
+}
+
+/* 选择支付方式 */
+.payWayBack {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, .4);
+ left: 0;
+ top: 0;
+ z-index: 98;
+ display: none;
+}
+
+.payWayBack.active {
+ display: block;
+}
+
+.payWay {
+ position: fixed;
+ z-index: 99;
+ left: 0;
+ bottom: -100%;
+ width: 100%;
+ background-color: #fff;
+ padding: 60rpx 50rpx 120rpx;
+ box-sizing: border-box;
+ border-top: 2rpx solid #f0f0f0;
+ transition: .2s;
+}
+
+.payWay.active {
+ bottom: 0;
+}
+
+.payWay-name {
+ font-weight: 600;
+ font-size: 30rpx;
+ margin-bottom: 80rpx;
+}
+
+.payContList-label {
+ display: flex;
+ margin-bottom: 40rpx;
+ border-bottom: 2rpx solid #f6f6f6;
+ padding-bottom: 40rpx;
+}
+
+.payContList-label:last-child {
+ border:none
+}
+
+.payContList-label-name {
+ flex: 1;
+ font-size: 32rpx;
+ display: flex;
+ line-height: 46rpx;
+}
+
+.payContList-label-img {
+ width: 46rpx;
+ height: 46rpx;
+ margin-right: 20rpx;
+}
+
+radio {
+ transform:scale(0.8);
+}
+
+.payWayBtn {
+ background: #eacf88;
+ text-align: center;
+ line-height: 80rpx !important;
+ border-radius: 10rpx;
+ margin-top: 80rpx;
+ width: 100% !important;
+ padding: 0;
+ font-size: 32rpx;
+}
\ No newline at end of file
diff --git a/pages/orderData/orderData.js b/pages/orderData/orderData.js
new file mode 100644
index 0000000..03debea
--- /dev/null
+++ b/pages/orderData/orderData.js
@@ -0,0 +1,134 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ statusHeight : app.globalData.statusBarHeight,
+ order : '' //订单详情
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ // 获取商品活动订单详情
+ this.orderInfo(options.id);
+ },
+
+ /**
+ * 商品活动订单详情
+ */
+ orderInfo(id) {
+ wx.$api.exchange.show(id).then(res=>{
+ this.setData({
+ order : res.data
+ })
+ })
+ },
+
+ /**
+ * 取消订单
+ */
+ orderDelete(e) {
+ let orderId = e.currentTarget.dataset.id
+ wx.showModal({
+ title : '订单取消',
+ content : '确认取消吗?',
+ success : res=> {
+ if (res.confirm) {
+ wx.$api.exchange.cancel(orderId).then(res=>{
+ wx.reLaunch({
+ url: '/pages/order/order'
+ })
+
+ wx.showToast({
+ title: res.data,
+ icon : 'none'
+ })
+ })
+ } else if (res.cancel) {
+ wx.showToast({
+ title : '取消',
+ icon : 'loading',
+ duration: 1000
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 支付提交
+ */
+ orderPay(e) {
+ let orderid = e.currentTarget.dataset.id
+ wx.$api.exchange.payments(orderid).then(res=>{
+ wx.$api.index.wechat(res.data.trade_no).then(res=>{
+ let payInfo = JSON.parse(res.data)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/coupon/coupon?type=couponPublic'
+ })
+ },2000)
+ }
+ },
+ fail : res=>{
+ wx.reLaunch({
+ url: '/pages/order/order?stateType=unpay'
+ })
+ }
+ })
+ })
+ })
+
+ },
+
+ /**
+ * 返回上一页
+ */
+ orderRun() {
+ wx.navigateBack({
+ delta: 1
+ })
+ },
+
+ /**
+ * 复制快递单号
+ */
+ copyText (e) {
+ let text = e.currentTarget.dataset.text
+ wx.setClipboardData({
+ data : text,
+ success : res=> {
+ wx.getClipboardData({
+ success: res => {
+ wx.showToast({
+ title: '复制成功'
+ })
+ }
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/orderData/orderData.json b/pages/orderData/orderData.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/orderData/orderData.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/orderData/orderData.wxml b/pages/orderData/orderData.wxml
new file mode 100644
index 0000000..5b93712
--- /dev/null
+++ b/pages/orderData/orderData.wxml
@@ -0,0 +1,63 @@
+
+
+ {{order.state_text}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 收货人:{{order.express.name}}
+ {{order.express.mobile}}
+
+ {{order.express.address}}
+
+
+
+
+
+
+
+ {{order.items.title}}
+ ¥{{order.items.price}}
+ ×{{order.items.qty}}
+
+
+
+
+
+
+
+ 权益类型
+ {{order.type_text}}
+
+
+ 订单号
+ {{order.orderid}}
+
+
+ 下单时间
+ {{order.created_at}}
+
+
+
+
+ 实际支付
+ ¥{{order.amount}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/orderData/orderData.wxss b/pages/orderData/orderData.wxss
new file mode 100644
index 0000000..ccf95fa
--- /dev/null
+++ b/pages/orderData/orderData.wxss
@@ -0,0 +1,241 @@
+
+/*
+ * 亿时代
+ */
+ .order-statl{
+ background-color: #f57e32;
+ padding: 0 30rpx 10rpx;
+ color: white;
+ line-height: 90rpx;
+ height: 90rpx;
+ position: relative;
+}
+
+.order-statl-icon{
+ width: 80rpx;
+ height: 80rpx;
+ vertical-align: middle;
+ position: absolute;
+ right: 30rpx;
+ top: 5rpx;
+}
+
+ /* 收货人信息 */
+.order-address{
+ padding: 30rpx 30rpx 40rpx 100rpx;
+ position: relative;
+ background: white;
+}
+
+.order-address-back{
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ vertical-align:bottom;
+}
+
+.order-address-name{
+ padding-right: 300rpx;
+ position: relative;
+ font-size: 33rpx;
+ padding-bottom: 10rpx;
+}
+
+.order-address-name text{
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 280rpx;
+ text-align: right;
+}
+
+.order-address-text{
+ color: #464854;
+ font-size: 26rpx;
+}
+
+.address-icon,
+.arrows-right{
+ position: absolute;
+}
+
+.address-icon{
+ height: 42rpx;
+ width: 42rpx;
+ left: 30rpx;
+ top: calc(50% - 26rpx);
+ top: -webkit-calc(50% - 26rpx);
+}
+
+.arrows-right{
+ height: 28rpx;
+ width: 28rpx;
+ right: 30rpx;
+ top: calc(50% - 19rpx);
+ top: -webkit-calc(50% - 19rpx);
+}
+
+.order-add-address{
+ text-align: center;
+ padding: 30rpx 0;
+}
+
+.order-add-address navigator{
+ display: inline-block;
+ background: #e92344;
+ color: white;
+ line-height: 60rpx;
+ padding: 0 30rpx;
+ margin-right: 20rpx;
+}
+
+/* 订单商品 */
+
+.order-content{
+ border-bottom: solid 100rpx transparent;
+}
+
+.order-goods{
+ margin-bottom: 20rpx;
+}
+
+.goods-goods-mall{
+ padding: 20rpx 30rpx 0 30rpx;
+ line-height: 50rpx;
+}
+
+.goods-goods-mall image{
+ width: 48rpx;
+ height: 48rpx;
+ vertical-align: middle;
+ margin-right: 15rpx;
+ margin-bottom: 2rpx;
+}
+
+.goods-goods-li{
+ padding: 20rpx 30rpx;
+ position: relative;
+ border-bottom: solid 1rpx #f2f2f2;
+ min-height: 130rpx;
+ background: white;
+}
+
+.goods-goods-li:last-child{
+ border-bottom: none;
+}
+
+.goods-img{
+ position: absolute;
+ top: 20rpx;
+ left: 30rpx;
+ height: 130rpx;
+ width: 130rpx;
+ background: #f5f6fa;
+}
+
+.goods-body{
+ padding-left: 150rpx;
+}
+
+.goods-name{
+ font-weight: bold;
+ padding: 10rpx 0 20rpx;
+}
+
+.goods-price{
+ color: #e92344;
+}
+
+.goods-qty{
+ color: gray;
+ font-weight: normal;
+ padding-left: 10rpx;
+ font-size: 28rpx;
+}
+
+.goods-params{
+ color: gray;
+ padding-bottom: 20rpx;
+ font-size: 28rpx;
+}
+
+/* 统计信息 */
+
+.order-total{
+ background: white;
+ margin: 20rpx 0;
+}
+
+.order-total-li{
+ padding: 0 30rpx;
+ line-height: 90rpx;
+ position: relative;
+ font-size: 28rpx;
+}
+
+.order-total-li::before{
+ position: absolute;
+ content: " ";
+ left: 30rpx;
+ bottom: 0;
+ right: 0;
+ height: 1rpx;
+ background: #f2f2f2;
+}
+
+.order-total-li:last-child::before{
+ display: none;
+}
+
+.order-total-li text{
+ float: right;
+ color: #999;
+}
+
+.order-total-li .redCor {
+ color: #e92344;
+ font-size: 32rpx;
+}
+
+.order-type text {
+ color: #e92344;
+}
+
+/* 底部工具栏 */
+.order-data-footer{
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ border-top: solid 1rpx #f2f2f2;
+ padding-top: 17rpx;
+ padding-right: 30rpx;
+ padding-left: 30rpx;
+ height: 83rpx;
+ background: white;
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction:row-reverse;
+}
+
+.order-data-footer.iphoneX {
+ padding-bottom: 30rpx;
+}
+
+.order-btn{
+ margin-left: 20rpx;
+ height: 54rpx;
+ line-height: 50rpx;
+ box-sizing: border-box;
+ border:solid 1rpx #747788;
+ padding: 0 20rpx;
+ font-size: 26rpx;
+ border-radius: 40rpx;
+ margin-top: 10rpx;
+}
+
+.order-btn-back {
+ border-color: #f57e32;
+ color: #f57e32;
+}
\ No newline at end of file
diff --git a/pages/packet/packet.js b/pages/packet/packet.js
new file mode 100644
index 0000000..528c03e
--- /dev/null
+++ b/pages/packet/packet.js
@@ -0,0 +1,140 @@
+// pages/packet/packet.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ mobile : '', //手机号码
+ code : '',
+ iscode : null, //用于存放验证码接口里获取到的code
+ codename : '获取验证码',
+ countDownNum: '',
+ popContHide : false, //领取成功弹出
+ popData : '', //领取金额
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+
+ },
+
+ /**
+ * 获取手机号码
+ */
+ getNameValue(e) {
+ this.setData({
+ mobile: e.detail.value
+ })
+ },
+
+ /**
+ * 获取验证码
+ */
+ getCodeValue(e) {
+ this.setData({
+ code: e.detail.value
+ })
+ },
+
+ /**
+ * code
+ */
+ codeBind(e){
+ let mobile = this.data.mobile,
+ myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/
+
+ var _this = this
+
+ if (mobile == "") {
+ wx.showToast({
+ title : '手机号不能为空',
+ icon : 'none',
+ duration : 1000
+ })
+ return false;
+ }else if (!myreg.test(mobile)) {
+ wx.showToast({
+ title : '请输入正确的手机号',
+ icon : 'none',
+ duration : 1000
+ })
+ return false;
+ }else{
+ wx.$api.user.send(mobile,'DEFAULT','unicom').then(res=>{
+ wx.showToast({
+ title : '发送成功',
+ icon : 'success',
+ duration: 2000
+ })
+ var num = 61;
+ var timer = setInterval(function () {
+ num--;
+ if (num <= 0) {
+ clearInterval(timer);
+ _this.setData({
+ codename : '重新发送',
+ disabled : false
+ })
+
+ } else {
+ _this.setData({
+ codename : num + "s后重新获取",
+ disabled : true
+ })
+ }
+ }, 1000)
+ })
+ }
+ },
+
+ /**
+ * 立即领取
+ */
+ forgetlogin(e) {
+ let mobile = this.data.mobile,
+ code = this.data.code,
+ that = this,
+ countDownNum = 5 //获取倒计时初始值
+
+ that.setData({
+ countDownNum: countDownNum
+ })
+
+ wx.$api.user.unicom(mobile,'DEFAULT',code).then(res=>{
+ that.setData({
+ popContHide : !this.data.popContHide,
+ popData : res.data
+ })
+ var timerPop = setInterval(function () {
+ countDownNum--;
+ that.setData({
+ countDownNum: countDownNum
+ })
+ if (countDownNum <= 0) {
+ clearInterval(timerPop);
+ that.setData({
+ countDownNum: 0
+ })
+ wx.switchTab({
+ url: '/pages/user/user'
+ })
+ }
+ }, 1000)
+ })
+ },
+
+ /**
+ * 关闭弹窗
+ */
+ popContHide() {
+ this.setData({
+ popContHide : !this.data.popContHide
+ })
+ wx.switchTab({
+ url: '/pages/user/user'
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/packet/packet.json b/pages/packet/packet.json
new file mode 100644
index 0000000..fa7e476
--- /dev/null
+++ b/pages/packet/packet.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents" : {},
+ "navigationBarTitleText": "联通红包"
+}
\ No newline at end of file
diff --git a/pages/packet/packet.wxml b/pages/packet/packet.wxml
new file mode 100644
index 0000000..2e8b7f0
--- /dev/null
+++ b/pages/packet/packet.wxml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+ 请输入办理业务手机号
+ 例:185XXXX0001
+
+
+
+
+
+
+
+
+
+ 领取成功,共领取{{popData}},可在账户中查看
+ 我知道了 ({{countDownNum}})
+
+
\ No newline at end of file
diff --git a/pages/packet/packet.wxss b/pages/packet/packet.wxss
new file mode 100644
index 0000000..2d01234
--- /dev/null
+++ b/pages/packet/packet.wxss
@@ -0,0 +1,223 @@
+/* 红包领取 */
+.packetCont-img {
+ width: 100vw;
+ height: 100vh;
+ position: fixed;
+}
+
+.packetCont-title {
+ width: 100vw;
+ position: absolute;
+ z-index: 1;
+ left: 0;
+ top: 0;
+ text-align: center;
+ margin-top: 60rpx;
+}
+
+.packetText {
+ position: absolute;
+ top: 16%;
+ left: 40rpx;
+ right: 40rpx;
+ text-align: center;
+}
+
+.packetText-form {
+ background: rgba(255, 255, 255, .7);
+ border-radius: 30rpx;
+ padding: 40rpx 40rpx 70rpx 40rpx;
+ box-sizing: border-box;
+ color: #000;
+ text-align: left;
+ margin-bottom: 100rpx;
+ position: relative;
+}
+
+.packetText-tips {
+ margin: 0 auto;
+ display: block;
+}
+
+.packetText-title {
+ font-weight: 600;
+ font-size: 26rpx;
+ padding: 0 10rpx 40rpx 10rpx;
+}
+
+.packetText-title-name {
+ font-size: 38rpx;
+ margin-bottom: 10rpx;
+}
+
+.packetText-label {
+ background-color: #fff;
+ border-radius: 80rpx;
+ margin-bottom: 60rpx;
+ box-shadow: 0 10rpx 10rpx rgba(0, 0, 0, .4);
+ display: flex;
+ padding: 25rpx 30rpx;
+ box-sizing: border-box;
+}
+
+.packetText-label image {
+ width: 40rpx;
+ height: 40rpx;
+ margin-top: 2rpx;
+ margin-right: 30rpx;
+}
+
+.packetText-label button {
+ border: none;
+ background-color: transparent;
+ width: auto !important;
+ padding: 0;
+ font-weight: normal;
+ font-size: 32rpx;
+}
+
+.inputs-input {
+ position: relative;
+ padding-left: 30rpx;
+}
+
+.inputs-code {
+ position: relative;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ flex: 1;
+ margin-right: 30rpx;
+}
+.inputs-input::after,
+.inputs-code::after {
+ position: absolute;
+ content: '';
+ top: 0;
+ background: #000;
+ width: 4rpx;
+ height: 100%;
+}
+
+.inputs-input::after {
+ left: 0;
+}
+
+.inputs-code::after {
+ right: 0;
+}
+
+.packetText-cozy {
+ font-weight: 600;
+ font-size: 26rpx;
+}
+
+.packetText-cozy text {
+ display: block;
+ margin: 15rpx 0;
+ position: relative;
+ padding-left: 30rpx;
+}
+
+.packetText-cozy text::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ top: 12rpx;
+ background-color: #000;
+ width: 12rpx;
+ height: 12rpx;
+ border-radius: 50%;
+}
+
+.packetText-cozy-name {
+ font-size: 34rpx;
+}
+
+.packetText-btn {
+ width: 100%;
+ text-align: center;
+ height: 90rpx;
+ position: absolute;
+ bottom: -40rpx;
+ left: 0;
+}
+
+.packetText-btn button {
+ line-height: 90rpx;
+ border-radius: 25rpx;
+ background-image: radial-gradient(#fdcf7c 50%,#fdebb8);
+ border: none;
+ font-size: 38rpx;
+ color: #fff;
+ margin: 0 auto;
+ padding: 0;
+}
+
+.packetText-btn text{
+ background: linear-gradient(to bottom, #e38b3c, #cb6418);
+ -webkit-background-clip: text;
+ color: transparent;
+}
+
+.packetText-btn image {
+ width: 34rpx;
+ height: 34rpx;
+ vertical-align: -4rpx;
+ margin-left: 14rpx;
+}
+
+/* 弹出 */
+.popBack {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ background-color: rgba(0, 0, 0, .8);
+ z-index: 8;
+ display: none;
+}
+
+.popCont {
+ position: fixed;
+ z-index: 9;
+ width: 100vw;
+ height: 100vh;
+ text-align: center;
+ display: none;
+}
+
+.popCont-text {
+ padding: 0 10rpx;
+ box-sizing: border-box;
+ position: absolute;
+ z-index: 10;
+ left: 20%;
+ top: 340px;
+ width: 60%;
+}
+
+.popBack.active,
+.popCont.active {
+ display: block;
+}
+
+.popCont-name {
+ margin-bottom: 50rpx;
+ font-size: 30rpx;
+}
+
+.popCont-name text {
+ font-size: 40rpx;
+ color: #fd5238;
+ padding: 0 10rpx;
+}
+
+.popCont-btn {
+ background-color: #ffea37;
+ color: #ff3900;
+ display: inline-block;
+ border-radius: 80rpx;
+ padding: 20rpx 70rpx;
+ box-shadow: 0 10rpx 10rpx rgba(196, 160, 0, 0.4);
+}
\ No newline at end of file
diff --git a/pages/rights/rights.js b/pages/rights/rights.js
new file mode 100644
index 0000000..9eebacd
--- /dev/null
+++ b/pages/rights/rights.js
@@ -0,0 +1,353 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ address : '', //默认收货地址
+ allAddress : '', //收货地址列表
+ groupId : '', //权益id
+ detail : '', //权益详情
+ amount : '', //总金额
+ moreAmount : '', //产品金额
+ score : '', //应付总积分
+ freight : '', //运费
+ num : 1, //购买的数量
+ content : '', //内容介绍
+ notification: '', //重要提示
+ remark : '', //使用须知
+ noticeShow : false, //须知显示状态
+ addressShow : false, //收货地址显示
+ getType : '', //是否显示自提
+ platIndex : 0, //选择提交方式下标
+ isdeliver : '',
+ platformCp : [], //选择提交数组
+ pointMoreShow: false,
+ from : '',
+ typeNo : '',
+ uniUrl : '', //跳转h5页面
+ openid : '',
+ webShow : false,
+ rightsTap : false,
+ disabled : false,
+ payWayIndex : 0,
+ payWay :[
+ {value: 0, name: "微信支付"},
+ {value: 1, name: "沃钱包支付"}
+ ]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.setData({
+ groupId : options.rightsId || options.id,
+ typeWeb : options.type,
+ getType : options.getType,
+ openid : options.openid || ''
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+ // 获取详情
+ this.rightsInfo();
+ },
+
+ /**
+ * 详情
+ */
+ rightsInfo() {
+ wx.$api.index.rightShow(this.data.groupId, this.data.address.id, this.data.num, this.data.isdeliver).then(res=>{
+ let obj = res.data.detail.express
+ let defGet = res.data.detail.def_get
+ let arr = new Array
+
+ arr = Object.keys(obj).map(val=>{
+ return { ...obj[val], ...{key: val} }
+ })
+
+ this.setData({
+ address : res.data.address,
+ allAddress : res.data.all_address,
+ detail : res.data.detail,
+ num : res.data.num,
+ freight : res.data.freight,
+ platformCp : arr,
+ from : res.data.detail.from,
+ amount : res.data.total,
+ moreAmount : res.data.amount,
+ score : res.data.score,
+ typeNo : res.data.detail.type_no,
+ remark : res.data.detail.remark.replace(/\
{
+ this.setData({
+ uniUrl : encodeURIComponent(res.data)
+ })
+ })
+ }
+ }
+ }).catch(err=>{
+ if(!err.login){
+ wx.showModal({
+ title : '用户登录已过期',
+ content : '请重新登录',
+ showCancel : false,
+ success : res => {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/pages/login/login'
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 商品数量加减
+ */
+ goodsNumber(e){
+ let num = this.data.num
+ if (e.currentTarget.dataset.type == 'plus'){
+ num ++;
+ }else{
+ if (num > 1){
+ num --;
+ }else{
+ wx.showToast({
+ title : '商品数量不能小于1',
+ icon : 'none'
+ })
+ }
+ }
+ this.setData({
+ num : num
+ })
+
+ // 获取详情
+ this.rightsInfo()
+ },
+ /**
+ * 输入商品数量
+ */
+ goodsNumberInput(e){
+ let goodsNum = e.detail.value
+ if (goodsNum > 0){
+ this.setData({
+ num : goodsNum
+ })
+ }else{
+ wx.showToast({
+ title : '商品数量不能小于1',
+ icon : 'none'
+ })
+ this.setData({
+ num : goodsNum
+ })
+ }
+
+ // 获取详情
+ this.rightsInfo()
+ },
+
+ /**
+ * 须知展开收起状态
+ */
+ noticeTap() {
+ this.setData({
+ noticeShow : !this.data.noticeShow
+ })
+ },
+
+ /**
+ * 选择提交方式
+ */
+ platBind(e) {
+ this.setData({
+ platIndex : e.detail.value,
+ isdeliver : this.data.platformCp[e.detail.value].value
+ })
+ // 获取详情
+ this.rightsInfo()
+ },
+
+ /**
+ * 收货地址弹出
+ */
+ addressTap() {
+ this.setData({
+ addressShow : true
+ })
+ },
+
+ /**
+ * 收货地址收起
+ */
+ addressHide() {
+ this.setData({
+ addressShow : false
+ })
+ },
+
+ /**
+ * 选择收货地址
+ */
+ selectAddress(e){
+ let new_addressId = e.currentTarget.dataset.id,
+ addressId = this.data.address.id
+ if (new_addressId != addressId) {
+ this.setData({
+ address : e.currentTarget.dataset.index,
+ addressShow : false
+ })
+ }else{
+ this.setData({
+ addressShow : false
+ })
+ }
+
+ // 获取详情
+ this.rightsInfo()
+ },
+
+ /**
+ * 普通商品支付提交
+ */
+ ordinary() {
+ this.submitOrder();
+ this.setData({
+ disabled : true
+ })
+ },
+
+ /**
+ * 只有银联商品获取
+ */
+ unionOrder() {
+ // 更新openid
+ wx.$api.index.unionCode(this.data.openid).then(res=>{})
+ this.submitOrder();
+ },
+
+ /**
+ * 支付选择
+ */
+ payBind(e) {
+ this.setData({
+ payWayIndex: e.detail.value
+ })
+ },
+
+ /**
+ * 支付提交
+ */
+ submitOrder() {
+ if(this.data.isdeliver.length == 0) {
+ this.setData({
+ isdeliver: this.data.detail.def_get
+ })
+ }
+ let right_id = this.data.detail.right_id,
+ address_id = this.data.address.id,
+ is_deliver = this.data.isdeliver,
+ qty = this.data.num
+
+ wx.$api.index.rightStore(right_id, address_id, is_deliver, qty).then(res=>{
+ if(res.data.canPay == false) {
+ wx.showToast({
+ title : '支付成功',
+ icon : 'success',
+ duration: 2000
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/order/order'
+ })
+ },3000)
+ this.setData({
+ rightsTap: true
+ })
+ }else {
+ // payWayIndex为0的时候为微信支付
+ if(this.data.payWayIndex == 0) {
+ wx.$api.index.wechat(res.data.trade_no).then(res=>{
+ let payInfo = JSON.parse(res.data)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/coupon/coupon?type=couponPublic'
+ })
+ },3000)
+ }
+ },
+ fail : res=>{
+ wx.reLaunch({
+ url: '/pages/order/order?stateType=unpay'
+ })
+ }
+ })
+ })
+ }
+ // payWayIndex为1的时候为沃钱包支付
+ if(this.data.payWayIndex == 1) {
+ const newUrl = "https://lifetest.ysd-bs.com/unicom/payment?trade_no=" + res.data.trade_no
+ let url= encodeURIComponent(newUrl)
+ wx.navigateTo({
+ // 跳转到webview页面
+ url: `/pages/webView/webView?url=${url}`
+ });
+ }
+ }
+ })
+ },
+
+
+ /**
+ * 新增收货地址
+ */
+ addSelect() {
+ wx.navigateTo({
+ url: '/pages/address/address?type=selectAddress'
+ })
+ this.setData({
+ addressShow : false
+ })
+ },
+
+ /**
+ * 新增收货地址
+ */
+ pointMoreTap() {
+ this.setData({
+ pointMoreShow : !this.data.pointMoreShow
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/rights/rights.json b/pages/rights/rights.json
new file mode 100644
index 0000000..3e0f2bc
--- /dev/null
+++ b/pages/rights/rights.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents" : {},
+ "navigationBarTitleText" : "卡券权益",
+ "navigationBarBackgroundColor": "#151619",
+ "navigationBarTextStyle" : "white"
+}
\ No newline at end of file
diff --git a/pages/rights/rights.wxml b/pages/rights/rights.wxml
new file mode 100644
index 0000000..757ff2d
--- /dev/null
+++ b/pages/rights/rights.wxml
@@ -0,0 +1,214 @@
+
+
+
+ 立即领取
+
+
+ 立即购买
+ 立即购买
+
+
+
+
+
+
+
+
+
+
+
+
+ 重要提示
+
+
+
+
+
+ {{pointMoreShow == true ? '收起' : '展开'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{detail.four_title}}
+
+
+
+
+
+
+
+ {{detail.three_title}}
+
+
+
+
+
+
+ 数量
+
+ -
+
+ +
+
+
+
+
+
+
+ {{detail.attribute.form_price}}
+ ¥{{moreAmount}}
+
+
+ 电子券
+ {{detail.qty}}张
+
+
+
+
+
+
+ 请选择提交方式
+
+
+
+ {{platformCp[platIndex].name}}
+
+
+
+
+
+
+ 收货地址
+
+
+ {{address.all_address}}
+
+
+
+
+
+ 添加收货地址
+
+
+
+
+ 快递运费
+ ¥{{freight}}
+
+
+
+
+
+
+ {{detail.attribute.form_type}}
+ ¥{{detail.score}}
+
+
+ {{detail.attribute.form_pay}}
+ ¥{{amount}}
+
+
+
+
+
+
+ 请选择支付方式
+
+
+
+ {{payWay[payWayIndex].name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 购买前请仔细阅读使用须知、内容介绍
+
+
+
+
+ 购买须知
+
+
+
+
+ 内容介绍
+
+
+
+
+
+
+
+
+
+
+
+ 请选择收货地址
+ 新增收货地址
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/rights/rights.wxss b/pages/rights/rights.wxss
new file mode 100644
index 0000000..0625c65
--- /dev/null
+++ b/pages/rights/rights.wxss
@@ -0,0 +1,606 @@
+page {
+ background-color: #f7f7f7;
+}
+
+.cont {
+ width: 100%;
+ overflow: hidden;
+}
+
+
+/* 卡券权益 */
+.contBack {
+ position: relative;
+ width: 200%;
+ height: 400rpx;
+ left: -50%;
+ text-align: center;
+ background: #000000;
+ border-radius: 0 0 100% 100%;
+ overflow: hidden;
+}
+
+/* .contBack::after {
+ width: 100%;
+ height: 30rpx;
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ z-index: 2;
+ content: '';
+ background-image: linear-gradient(transparent, rgba(0,0,0,.25));
+} */
+
+.classBack {
+ position: absolute;
+ left: 30%;
+ right: 30%;
+ width: 40%;
+ top: 40rpx;
+}
+
+.classCircle {
+ position: relative;
+}
+
+.classCircle::after,
+.contBack::before {
+ position: absolute;
+ border-radius: 50%;
+ content: '';
+ z-index: 1;
+ background-color: rgba(255,255,255,.1);
+}
+
+.classCircle::after {
+ left: 20%;
+ top: -20rpx;
+ width: 260rpx;
+ height: 260rpx;
+}
+
+.contBack::before {
+ right: 20%;
+ top: 55%;
+ width: 300rpx;
+ height: 300rpx;
+}
+
+.rightsCont {
+ position: absolute;
+ z-index: 3;
+ left: calc(30% - 2rpx);
+ right: calc(30% - 2rpx);
+ width: calc(40% + 4rpx);
+ top: 58rpx;
+}
+
+.rightsCont-btn {
+ background-color: #f4dfcc;
+ width: 100%;
+ line-height: 70rpx;
+ font-size: 38rpx;
+ color: #694425;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+
+.rightsCont-tips {
+ color: #fff;
+}
+
+.rightsNumber {
+ display: flex;
+ width: 100%;
+ margin: 30px 0 20px;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+}
+
+.rightsNumber text {
+ display: inline-block;
+ flex: 1;
+}
+
+.rightsAdd {
+ display: flex;
+}
+
+.rightsAdd-btn {
+ background: #eaeaea;
+ color: #535353;
+ border-radius: 50%;
+ text-align: center;
+ width: 50rpx;
+ height: 50rpx;
+ line-height: 45rpx;
+ font-size: 40rpx;
+ font-weight: 600;
+}
+
+.rightsAdd-input {
+ width: 100rpx;
+ text-align: center;
+ font-size: 28rpx;
+ line-height: 50rpx;
+}
+
+.rightsTips {
+ padding: 0 30rpx;
+ color: #ff5b5d;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.rightsList,
+.notice,
+.detailsStore {
+ background: white;
+ margin: 30rpx;
+ border-radius: 10rpx;
+ padding: 10rpx 0;
+ box-sizing: border-box;
+ box-shadow: 0 0 30rpx rgba(0,0,0,.15);
+}
+
+.rightsLabel,
+.rightsLabel-pay {
+ display: flex;
+ padding: 20rpx;
+ color: #6f7880;
+ font-size: 30rpx;
+}
+
+.rightsLabel .rightsLabel-left {
+ flex: 1;
+ color: #747d86;
+}
+
+.rightsLabel-black {
+ padding-top: 30rpx;
+}
+
+.rightsLabel-range {
+ display: flex;
+ color: #000;
+ font-weight: 600;
+}
+
+.rightsLabel-row {
+ width: 38rpx;
+ height: 38rpx;
+ margin: 2rpx 0 0 6rpx;
+}
+
+.rightsLabel-black .rightsLabel-right,
+.rightsLabel-red {
+ color: #ff5b5d;
+ font-weight: 600;
+ font-size: 32rpx;
+}
+
+.rightsLabel-black .rightsLabel-left {
+ color: #000;
+}
+
+.rightsLabel-score {
+ font-weight: 600;
+ color: #000;
+ font-size: 38rpx;
+}
+
+.rightsLabel-pay {
+ color: #000;
+}
+
+.rightsLabel-pay .rightsLabel-left {
+ flex: 1;
+}
+
+.notice {
+ padding: 20rpx;
+}
+
+.noticeTitle {
+ display: flex;
+}
+
+.noticeTitle-flex {
+ flex: 1;
+ display: flex;
+ font-size: 30rpx;
+ line-height: 46rpx;
+}
+
+.noticeTitle-img {
+ width: 46rpx;
+ height: 46rpx;
+ margin-right: 20rpx;
+}
+
+.noticeText {
+ font-size: 26rpx;
+ height: 0;
+ overflow: hidden;
+}
+
+.noticeText.active {
+ height: auto;
+}
+
+.noticeText-top {
+ margin: 30rpx 0 10rpx;
+ font-weight: 600;
+}
+
+.noticeText-cont {
+ line-height: 60rpx;
+}
+
+.noticeTitle-row {
+ width: 46rpx;
+ height: 46rpx;
+}
+
+.noticeTitle-row.active {
+ transform: rotate(90deg);
+}
+
+/* 门店 */
+.detailsStore {
+ padding: 20rpx;
+}
+
+.detailsStore-top {
+ display: flex;
+ line-height: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.detailsStore-see {
+ color: #dfae2e;
+ border: 2rpx solid #dfae2e;
+ border-radius: 10rpx;
+ font-size: 28rpx;
+ margin-top: 30rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+}
+
+.detailsStore-see text {
+ display: inline-block;
+}
+
+.detailsStore-see image {
+ width: 50rpx;
+ height: 50rpx;
+ margin-left: 10rpx;
+}
+
+/* 购买按钮 */
+.rightsBtn {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 100rpx;
+ z-index: 9;
+ background: #fff;
+}
+
+.rightsBtn button,
+.rightsBtn text {
+ display: block;
+ margin: 12rpx 30rpx;
+ width: calc(100% - 60rpx) !important;
+ height: 74rpx !important;
+ line-height: 74rpx !important;
+ padding: 0;
+ background: #eacf88;
+ text-align: center;
+ border-radius: 60rpx;
+ font-size: 30rpx;
+}
+
+
+.rightsBtn.active text {
+ background: #dedede;
+ color: #888;
+}
+
+/* 选择收货地址 */
+.addressBack {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, .4);
+ z-index: 10;
+ width: 100%;
+ height: 100%;
+ display: none;
+}
+
+.addressBack.active {
+ display: block;
+}
+
+.addressCont {
+ position: fixed;
+ left: 0;
+ bottom: -1000%;
+ transition: .2s;
+ background: #fff;
+ z-index: 11;
+ width: 100%;
+}
+
+.addressCont.active {
+ bottom: 0;
+}
+
+.addressCont-title {
+ height: 90rpx;
+ line-height: 90rpx;
+ display: flex;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.addressCont-left {
+ flex: 1;
+}
+
+.addressCont-right {
+ color: #309ded;
+}
+
+.header-classify {
+ white-space: nowrap;
+ box-sizing: border-box;
+ height: 600rpx;
+}
+
+.addressCont-list {
+ padding: 30rpx 20rpx;
+ box-sizing: border-box;
+ font-size: 30rpx;
+ overflow: hidden;
+ position: relative;
+}
+
+.addressCont-top {
+ display: flex;
+ margin-bottom: 10rpx;
+}
+
+.addressCont-name {
+ font-weight: 600;
+}
+
+.addressCont-text {
+ color: #666;
+ width: calc(100% - 160rpx);
+}
+
+.addressCont-list:last-child {
+ border: none;
+}
+
+.rightsLabel-address {
+ display: flex;
+}
+
+.rightsLabel-address text {
+ display: inline-block;
+ width: calc(100% - 46rpx);
+}
+
+.rightsLabel-address .rightsLabel-right {
+ display: flex;
+ font-size: 28rpx;
+}
+
+.address-tool {
+ display: flex;
+ float: right;
+}
+
+.address-tool-btn {
+ font-size: 24rpx;
+ margin-top: 20rpx;
+ border: 2rpx solid #666;
+ color: #666;
+ border-radius: 6rpx;
+ text-align: center;
+ height: 50rpx;
+ line-height: 50rpx;
+ padding: 0 20rpx;
+ margin-right: 20rpx;
+ display: flex;
+}
+
+.address-tool-btn-del {
+ color: #dfae2e;
+ border-color: #dfae2e;
+}
+
+.address-tool-icon {
+ width: 120rpx;
+ height: 54rpx;
+ line-height: 54rpx;
+ border-radius: 4rpx;
+ text-align: center;
+ color: #fff;
+ position: absolute;
+ top: 45rpx;
+ right: 10rpx;
+ background: #dfae2e;
+ transform: scale(.9, .9);
+ font-size: 24rpx;
+}
+
+.rightsPoint {
+ position: fixed;
+ left: 0;
+ bottom: 100rpx;
+ background: #fff;
+ z-index: 9;
+ width: 100%;
+ padding: 20rpx 20rpx 10rpx;
+ box-sizing: border-box;
+}
+
+.rightsPoint-cont {
+ width: 100%;
+ background: #fff8e5;
+ border: 2rpx solid #f2ecde;
+ border-radius: 10rpx;
+ position: relative;
+ max-height: 50vh;
+ overflow-y: scroll;
+}
+
+.rightsPoint-top {
+ font-size: 28rpx;
+ display: flex;
+ padding: 20rpx;
+ box-sizing: border-box;
+ font-weight: 600;
+}
+
+.rightsPoint-top image {
+ width: 36rpx;
+ height: 36rpx;
+ margin-right: 10rpx;
+}
+
+.rightsPoint-text {
+ padding: 0 20rpx;
+ box-sizing: border-box;
+ font-size: 24rpx;
+ line-height: 44rpx;
+ height: 90rpx;
+ transition: height 25s;
+ overflow: hidden;
+}
+
+.rightsPoint-text.active {
+ height: auto;
+ transition: 2s;
+}
+
+.rightsPoint-text view {
+ position: relative;
+ padding-left: 40rpx;
+}
+
+.rightsPoint-text view::after {
+ position: absolute;
+ content: '';
+ left: 10rpx;
+ top: 20rpx;
+ background: #000;
+ width: 10rpx;
+ height: 10rpx;
+ border-radius: 50%;
+}
+
+.rightsPoint-bolck {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: calc(100% - 40rpx);
+}
+
+.pointMore {
+ text-align: center;
+ width: 100%;
+ background: #fff8e5;
+ height: 80rpx;
+ line-height: 82rpx;
+ position: relative;
+ margin-top: 10rpx;
+}
+
+.pointMore::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #f2ecde;
+}
+
+.pointMore text {
+ font-size: 28rpx;
+ color: #c38e00;
+ animation: dong 1.8s infinite;
+ display: inline-block;
+}
+
+.pointMore image {
+ width: 30rpx;
+ height: 30rpx;
+ margin-left: 4rpx;
+ vertical-align: -4rpx;
+ animation: dong 1.8s infinite;
+}
+
+@keyframes dong {
+ 0% {
+ transform: translate(0px, 0px);
+ }
+
+ 50% {
+ transform: translate(0px, -6rpx);
+ }
+
+ 100% {
+ transform: translate(0px, 0px);
+ }
+}
+
+.webBack {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ z-index: 9999;
+ background-color: #fff;
+ text-align: center;
+ display: none;
+}
+
+.webBack.active {
+ display: block;
+}
+
+.welfareCont-top{
+ white-space: nowrap;
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-around;
+ width: 100%;
+ padding: 0 10rpx;
+ box-sizing: border-box;
+ margin: 50rpx 0 20rpx;
+}
+
+.welfareCont-list-img {
+ border-radius: 50%;
+ width: 120rpx;
+ height: 120rpx;
+ display: inline-block;
+ margin: 0 15rpx;
+ overflow: hidden;
+}
+
+.welfareCont-list-img image {
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/pages/store/store.js b/pages/store/store.js
new file mode 100644
index 0000000..9e841c8
--- /dev/null
+++ b/pages/store/store.js
@@ -0,0 +1,213 @@
+// pages/store/store.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ stores : [], //门店列表
+ id : 0, //优惠券id
+ searchText : '', //搜索关键字
+ longitude : 0, //经度
+ latitude : 0, //纬度
+ //省份选择
+ areas : [],
+ areaIndex : 0,
+ //市级选择
+ cityList : [],
+ cityIndex : 0,
+ //区域选择
+ regiList : [],
+ regiIndex : 0,
+
+ page : {}, //下一页
+ lodingStats : false //加载状态
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ // 优惠券id
+ this.setData({
+ id :options.id
+ })
+
+ // 获取位置
+ wx.getLocation({
+ type: 'gcj02',
+ success: res=> {
+ this.setData({
+ longitude : res.longitude,
+ latitude : res.latitude
+ })
+ // 解析坐标
+ getApp().qqmapsdk.reverseGeocoder({
+ location: {
+ latitude : res.latitude,
+ longitude : res.longitude
+ },
+ success: res=>{
+ if(res.message == "query ok"){
+ let addressInfo = res.result.address_component
+ // 获取门店列表
+ this.storesInfo(addressInfo);
+ }else{
+ wx.showToast({
+ title: res.message,
+ icon : 'none'
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 选择城市信息
+ */
+ regi(e){
+ let chantType = e.currentTarget.dataset.type,
+ chantIndex = e.detail.value,
+ name = ""
+
+ if(chantType == "area"){
+ name = "areaIndex"
+ }else if(chantType == "city"){
+ name = "cityIndex"
+ this.getAreas(this.data.cityList[chantIndex].code, "")
+ }else if(chantType == "regi"){
+ name = "regiIndex"
+ }
+
+ this.setData({
+ [name] : chantIndex
+ })
+
+ // 获取门店列表
+ this.storesInfo()
+ },
+
+ /**
+ * 门店列表
+ */
+ storesInfo(addressInfo, page) {
+ let coupon_id = this.data.id,
+ user_lng = this.data.longitude,
+ user_lat = this.data.latitude,
+ province_id = "",
+ city_id = "",
+ district_id = "",
+ title = this.data.searchText || "",
+ areaIndex = this.data.areaIndex,
+ cityIndex = this.data.cityIndex,
+ regiIndex = this.data.regiIndex,
+ cityList = this.data.cityList,
+ areas = this.data.areas,
+ regiList = this.data.regiList
+
+ if(!addressInfo){
+ province_id = areas[areaIndex].code
+ city_id = cityList[cityIndex].code
+ district_id = regiList[regiIndex].code
+ }
+
+ wx.$api.user.stores(coupon_id, province_id, city_id, district_id, title, user_lng, user_lat, page).then(res=>{
+ let stores = this.data.stores,
+ newData = []
+ if(page == 1 || page == undefined) stores = []
+ newData = stores.concat(res.data.stores.data)
+
+ newData.map(res=>{
+ let distance = res.distance
+ if(res.distance > 1000){
+ distance = (distance / 1000) + "km"
+ }else{
+ distance = distance + "m"
+ }
+ res.km = distance
+ })
+
+ if(addressInfo){
+ cityList = res.data.citys
+ areas = res.data.provinces
+
+ areaIndex = areas.findIndex(val => val.name == addressInfo.province)
+ cityIndex = cityList.findIndex(val => val.name == addressInfo.city)
+ // this.getAreas(cityList[cityIndex].code, addressInfo.district)
+ this.getAreas(cityList[cityIndex].code, '')
+
+ }
+ this.setData({
+ areas : areas,
+ stores : newData,
+ cityList : cityList,
+ areaIndex : areaIndex,
+ cityIndex : cityIndex,
+ page : res.data.stores.page,
+ lodingStats : false
+ })
+ wx.stopPullDownRefresh()
+ })
+ },
+
+ /**
+ * 获取区级信息
+ */
+ getAreas(sn, areas){
+ wx.$api.user.areas(sn).then(res=>{
+ let regiList = res.data,
+ regiIndex = 0
+
+ if(areas) regiIndex = regiList.findIndex(val => val.name == areas)
+
+ this.setData({
+ regiList : regiList,
+ regiIndex : regiIndex
+ })
+ })
+ },
+
+ /**
+ * 查看门店详情页
+ */
+ detailsTap(e) {
+ let store_id = e.currentTarget.dataset.id,
+ user_lng = this.data.longitude,
+ user_lat = this.data.latitude
+
+ wx.navigateTo({
+ url: '/pages/storeDetails/storeDetails?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat,
+ })
+ },
+
+ /**
+ * 搜索门店
+ */
+ searchForm(e) {
+ this.setData({
+ searchText : e.detail.value.search
+ })
+
+ // 获取门店列表
+ this.storesInfo()
+ },
+
+ /**
+ * 上拉加载
+ */
+ onReachBottom(){
+ this.setData({
+ lodingStats: true
+ })
+ let pageNumber = this.data.page.current
+ if(this.data.page.has_more){
+ pageNumber++
+ this.setData({
+ page: pageNumber
+ })
+ this.storesInfo('', pageNumber)
+ }
+ }
+})
\ No newline at end of file
diff --git a/pages/store/store.json b/pages/store/store.json
new file mode 100644
index 0000000..e0dff17
--- /dev/null
+++ b/pages/store/store.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "门店列表"
+}
\ No newline at end of file
diff --git a/pages/store/store.wxml b/pages/store/store.wxml
new file mode 100644
index 0000000..1abd8e7
--- /dev/null
+++ b/pages/store/store.wxml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+ {{areas[areaIndex].name}}
+
+
+
+
+
+
+
+ {{cityList[cityIndex].name}}
+
+
+
+
+
+
+
+ {{regiList[regiIndex].name}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+ {{item.address}}
+ {{item.km}}
+
+
+
+
+
+ 加载中...
+
+
+ 没有更多了~
+
+
+
+
+
+
+
+ 暂无商家
+
\ No newline at end of file
diff --git a/pages/store/store.wxss b/pages/store/store.wxss
new file mode 100644
index 0000000..93b8b97
--- /dev/null
+++ b/pages/store/store.wxss
@@ -0,0 +1,136 @@
+/* 搜索 */
+.search {
+ background: #fff;
+ position: fixed;
+ width: 100%;
+ left: 0;
+ top: 0;
+ height: 110rpx;
+ z-index: 99;
+}
+
+.searchCont {
+ background: #f7f7f7;
+ border-radius: 50rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 28rpx;
+ margin: 20rpx 20rpx 0;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ display: flex;
+}
+
+.searchCont image {
+ width: 34rpx;
+ height: 34rpx;
+ margin: 24rpx 20rpx 0 0;
+}
+
+.searchCont input {
+ height: 100%;
+ width: calc(100% - 150rpx);
+}
+
+.searchCont button {
+ background: transparent;
+ width: 100rpx !important;
+ text-align: right;
+ padding: 0 !important;
+ margin: 0 !important;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 30rpx;
+ color: #ff9b1a;
+}
+
+/* 筛选 */
+.screen {
+ background: #fff;
+ position: fixed;
+ width: 100%;
+ left: 0;
+ top: 110rpx;
+ height: 90rpx;
+ overflow: hidden;
+ z-index: 99;
+}
+
+.screenLabel {
+ float: left;
+ width: calc(33.33% - 20rpx);
+ text-align: center;
+ color: #5f5f5f;
+ line-height: 90rpx;
+ font-size: 28rpx;
+ margin: 0 10rpx;
+}
+
+.screenLabel picker {
+ width: calc(100% - 17rpx);
+ position: relative;
+}
+
+.screenLabel-arrow {
+ position: absolute;
+ right: 0;
+ top: calc(50% - 17rpx);
+ width: 34rpx;
+ height: 34rpx;
+}
+
+/* 门店列表 */
+
+.storeList {
+ background: #fff;
+ padding: 20rpx;
+ box-sizing: border-box;
+ margin-top: 220rpx;
+ padding-bottom: 40rpx;
+}
+
+.detailsStore-list {
+ position: relative;
+ margin-bottom: 40rpx;
+}
+
+.detailsStore-list:last-child {
+ margin-bottom: 0;
+}
+
+.detailsStore-logo {
+ width: 120rpx;
+ height: 120rpx;
+ border-radius: 10rpx;
+}
+
+.detailsStore-cont {
+ position: absolute;
+ left: 150rpx;
+ top: 10rpx;
+ width: calc(100% - 150rpx);
+}
+
+.detailsStore-tel {
+ width: 60rpx;
+ height: 60rpx;
+ margin-top: 25rpx;
+}
+
+.detailsStore-place {
+ font-size: 24rpx;
+ line-height: 40rpx;
+ color: #5a5a5a;
+ display: flex;
+}
+
+.detailsStore-place text {
+ flex: 1;
+ display: inline-block;
+ font-size: 28rpx;
+ margin-right: 20rpx;
+}
+
+.detailsStore-name {
+ margin-bottom: 20rpx;
+}
\ No newline at end of file
diff --git a/pages/storeDetails/storeDetails.js b/pages/storeDetails/storeDetails.js
new file mode 100644
index 0000000..62f651f
--- /dev/null
+++ b/pages/storeDetails/storeDetails.js
@@ -0,0 +1,62 @@
+// pages/storeDetails/storeDetails.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ storeinfo : '', //门店详情
+ distance : 0,
+ longitude : 0,
+ latitude : 0
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+
+ wx.$api.user.storesShow(options.store_id, options.user_lng, options.user_lat).then(res=>{
+ let distance = res.data.distance
+
+ if(distance > 1000){
+ distance = (distance / 1000) + "km"
+ }else{
+ distance = distance + "m"
+ }
+
+ this.setData({
+ storeinfo : res.data,
+ distance : distance
+ })
+ })
+ },
+
+ /**
+ * 拨打电话
+ */
+ tel(e) {
+ let tel = this.data.storeinfo.mobile
+ wx.showActionSheet({
+ itemList : ['呼叫商家'],
+ success : res =>{
+ if(res.tapIndex==0){
+ wx.makePhoneCall({
+ phoneNumber: tel
+ })
+ }
+ }
+ })
+ },
+
+ /**
+ * 导航
+ */
+ siteMap(){
+ wx.openLocation({
+ latitude : parseFloat(this.data.storeinfo.latitude),
+ longitude : parseFloat(this.data.storeinfo.longitude),
+ address : this.data.storeinfo.address
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/storeDetails/storeDetails.json b/pages/storeDetails/storeDetails.json
new file mode 100644
index 0000000..5bd1958
--- /dev/null
+++ b/pages/storeDetails/storeDetails.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "门店详情"
+}
\ No newline at end of file
diff --git a/pages/storeDetails/storeDetails.wxml b/pages/storeDetails/storeDetails.wxml
new file mode 100644
index 0000000..aa896e8
--- /dev/null
+++ b/pages/storeDetails/storeDetails.wxml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ {{storeinfo.title}}
+
+
+
+
+
+ {{storeinfo.address}}
+ 距您 {{distance}}
+
+
+
+
+
+
+
+
+ 营业时间
+ {{storeinfo.open_time}}
+ 00:00
+
+
+
+
+
+
+
+
+
+ 去导航
+
+
\ No newline at end of file
diff --git a/pages/storeDetails/storeDetails.wxss b/pages/storeDetails/storeDetails.wxss
new file mode 100644
index 0000000..53be56d
--- /dev/null
+++ b/pages/storeDetails/storeDetails.wxss
@@ -0,0 +1,102 @@
+/* 门店详情 */
+.detailsImg {
+ position: relative;
+ width: 100%;
+ padding-top: 60%;
+}
+
+.detailsImg image {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.detailsCont {
+ background: #fff;
+}
+
+.detailsName {
+ font-size: 34rpx;
+ padding: 30rpx;
+ font-weight: 600;
+ box-sizing: border-box;
+}
+
+.detailsLabel {
+ display: flex;
+ padding: 30rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.detailsLabel::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ top: 0;
+ background: #e7e7e7;
+ width: 100%;
+ height: 2rpx;
+}
+
+.detailsLabel-left {
+ width: calc(100%- 40rpx);
+ display: flex;
+ flex: 1;
+ color: #5e5e5e;
+}
+
+.detailsLabel-left image {
+ width: 40rpx;
+ height: 40rpx;
+ margin: 20rpx 20rpx 0 0;
+}
+
+.detailsLabel-tel {
+ width: 60rpx;
+ height: 60rpx;
+ margin-top: 14rpx;
+}
+
+.detailsLabel-name {
+ font-size: 26rpx;
+ width: calc(100% - 110rpx);
+ margin-right: 10rpx;
+}
+
+.detailsLabel-name text {
+ font-weight: 600;
+ font-size: 30rpx;
+ display: block;
+ margin-bottom: 10rpx;
+}
+
+.detailsLabel-add {
+ width: 34rpx;
+ height: 34rpx;
+ margin-top: 24rpx;
+}
+
+.detailsBtn {
+ background: #fff;
+ width: 100%;
+ height: 120rpx;
+ text-align: center;
+ left: 0;
+ bottom: 0;
+ position: fixed;
+ padding: 20rpx;
+ box-sizing: border-box;
+}
+
+.detailsBtn-cont {
+ width: 100%;
+ background: #ef8e41;
+ color: #fff;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ border-radius: 50rpx;
+}
\ No newline at end of file
diff --git a/pages/switchcity/switchcity.js b/pages/switchcity/switchcity.js
new file mode 100644
index 0000000..de4c22d
--- /dev/null
+++ b/pages/switchcity/switchcity.js
@@ -0,0 +1,180 @@
+// 获取城市
+const app = getApp()
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ winHeight : 0, //可视高度
+ cityList : [], //城市列表
+ adcode : 0, //城市code
+ scrollTop : 0, //置顶高度
+ scrollTopId : '', //置顶id
+ searchLetter: [], //热门城市
+ regionShow : false, //区域显示开关
+ city : '', //城市名称
+ area : '', //区域名称
+ cityName : '', //定位城市名称
+ defaultcity : '', //定位区域名称
+ defaultregi : '', //区域名称
+ regiList : [], //区域列表
+ address : {
+ city_code: "",
+ area_code: ""
+ }
+ },
+
+ onLoad(e) {
+ wx.getLocation({
+ success: res => {
+ // 解析坐标
+ getApp().qqmapsdk.reverseGeocoder({
+ location: {
+ latitude : res.latitude,
+ longitude : res.longitude
+ },
+ success: res=>{
+ this.setData({
+ defaultcity : res.result.ad_info.city,
+ defaultregi : res.result.ad_info.district
+ })
+ }
+ })
+ },
+ fail: res => {}
+ })
+
+ if(e.area === '') e.area_code = '0'
+
+ this.setData({
+ address : {
+ area_code: e.area_code,
+ city_code: e.city_code,
+ area: e.area,
+ city: e.city
+ }
+ })
+
+ // 获取全部城市
+ this.local();
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onShow() {},
+
+ /**
+ * 全部城市
+ */
+ local() {
+ wx.$api.index.newCity().then(res=>{
+ this.setData({
+ cityList : res.data
+ })
+ // 获取区级列表
+ this.regilist(this.data.address.city_code)
+ }).catch(err=>{
+ if(!err.login){
+ // 写入缓存
+ wx.setStorage({
+ key : 'token',
+ data : ''
+ })
+ }
+ })
+ },
+
+ /**
+ * 城市字母
+ */
+ clickLetter (e) {
+ var showLetter = e.currentTarget.dataset.letter;
+ this.setData({
+ showLetter : showLetter,
+ isShowLetter: true,
+ scrollTopId : showLetter,
+ })
+ var that = this;
+ setTimeout(function () {
+ that.setData({
+ isShowLetter: false
+ })
+ }, 1000)
+ },
+
+ /**
+ * 选择城市
+ */
+ bindCity(e) {
+ let stairid = e.currentTarget.dataset.citycode,
+ city = e.currentTarget.dataset.city
+
+ this.setData({
+ address: {
+ city_code: stairid,
+ city: city
+ }
+ })
+
+ // 获取区级列表
+ this.regilist(stairid)
+ },
+
+ /**
+ * 地区列表
+ */
+ regilist(areaCode) {
+ wx.$api.index.newidxCity(areaCode).then(res=>{
+ res.data.unshift({ code: '0', name:'全部'})
+ this.setData({
+ regiList : res.data
+ })
+ })
+ },
+
+ /**
+ * 选择市区返回
+ */
+ regionOpt (e) {
+ let area_name = e.currentTarget.dataset.city
+ var pages = getCurrentPages();
+ var prevPage = pages[pages.length - 2];
+
+ if(area_name === '全部') area_name = this.data.address.city
+
+ prevPage.setData({
+ city: area_name
+ })
+ wx.navigateBack({
+ delta: 1
+ })
+ },
+
+ /**
+ * 选择定位城市返回
+ */
+ nowLocation () {
+ var pages = getCurrentPages();
+ var prevPage = pages[pages.length - 2];
+
+ prevPage.setData({
+ cityName: this.data.defaultcity,
+ city : this.data.defaultregi
+ })
+ wx.navigateBack({
+ delta: 1
+ })
+ },
+
+ /**
+ * 点击当前回到顶部
+ */
+ hotCity () {
+ this.setData({
+ scrollTop: 0,
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/switchcity/switchcity.json b/pages/switchcity/switchcity.json
new file mode 100644
index 0000000..1ac166c
--- /dev/null
+++ b/pages/switchcity/switchcity.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "切换城市"
+}
\ No newline at end of file
diff --git a/pages/switchcity/switchcity.wxml b/pages/switchcity/switchcity.wxml
new file mode 100644
index 0000000..5ee18b1
--- /dev/null
+++ b/pages/switchcity/switchcity.wxml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ {{showLetter}}
+
+
+
+
+ 当前定位:{{defaultcity}}{{defaultregi}}
+
+ 当前定位:
+
+
+
+
+
+
+
+ 黑龙江省
+ {{address.city}}
+ {{address.area ? address.area : '请选择区域'}}
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/switchcity/switchcity.wxss b/pages/switchcity/switchcity.wxss
new file mode 100644
index 0000000..db5b69e
--- /dev/null
+++ b/pages/switchcity/switchcity.wxss
@@ -0,0 +1,399 @@
+page {
+ background: #fff;
+}
+
+.hotcity-top {
+ border-bottom: 20rpx #f5f5f5 solid;
+}
+
+.searchLetter {
+ position: fixed;
+ right: 0;
+ width: 50rpx;
+ text-align: center;
+ justify-content: center;
+ display: flex;
+ flex-direction: column;
+ color: #666;
+ z-index: 1;
+}
+
+.searchLetter view {
+ margin-top: 20rpx;
+}
+
+.touchClass {
+ background-color: #fff;
+ color: #fff;
+ padding-top: 46rpx;
+}
+
+.showSlectedLetter {
+ background-color: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ margin: -100rpx;
+ width: 200rpx;
+ height: 200rpx;
+ border-radius: 20rpx;
+ font-size: 52rpx;
+ z-index: 1;
+}
+
+.selection {
+ display: flex;
+ width: 100%;
+ flex-direction: column;
+}
+
+.selection.active .item_city {
+ color: #e83339;
+}
+
+.item_letter {
+ display: flex;
+ background-color: #f5f5f5;
+ height: 60rpx;
+ padding-left: 34rpx;
+ align-items: center;
+ font-size: 24rpx;
+ color: #666;
+}
+
+.item_city {
+ position: relative;
+ display: flex;
+ height: 100rpx;
+ padding-left: 34rpx;
+ align-items: center;
+ border-bottom: 1rpx solid #eaeaea;
+ font-size: 26rpx;
+ color: #666;
+}
+
+.checkImg {
+ width: 28rpx;
+ height: 28rpx;
+ position: absolute;
+ right: 20rpx;
+ top: 38rpx;
+ display: none;
+}
+
+.checkImg.active {
+ display: block;
+}
+
+.thisCityName {
+ display: inline-block;
+ border: 1rpx solid #1c74c6;
+ border-radius: 8rpx;
+ padding: 10rpx;
+ font-size: 24rpx;
+ color: #1c74c6;
+ text-align: center;
+ min-width: 149.5rpx;
+ margin: 20rpx 0 20rpx 30rpx;
+}
+
+.thishotText {
+ color: #1c74c6;
+ font-size: 20rpx;
+ margin: 0 !important;
+}
+
+.slectCity {
+ border-color: #1c74c6 !important;
+}
+
+.slectCity view {
+ color: #1c74c6 !important;
+}
+
+.weui-grid {
+ position: relative;
+ float: left;
+ padding: 10rpx 0;
+ width: 149.5rpx;
+ box-sizing: border-box;
+ border: 1rpx solid #ececec;
+ border-radius: 8rpx;
+ margin: 10rpx 12rpx;
+}
+
+.weui-grid__label {
+ display: block;
+ text-align: center;
+ color: #333;
+ font-size: 24rpx;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+
+/* 热门城市 */
+
+.searchLetter {
+ position: fixed;
+ right: 0;
+ width: 50rpx;
+ text-align: center;
+ justify-content: center;
+ display: flex;
+ flex-direction: column;
+ color: #666;
+ z-index: 1;
+}
+
+.searchLetter view {
+ margin-top: 20rpx;
+}
+
+.touchClass {
+ background-color: #fff;
+ color: #fff;
+ padding-top: 46rpx;
+}
+
+.showSlectedLetter {
+ background-color: rgba(0, 0, 0, 0.5);
+ color: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ margin: -100rpx;
+ width: 200rpx;
+ height: 200rpx;
+ border-radius: 20rpx;
+ font-size: 52rpx;
+ z-index: 1;
+}
+
+/* 公共标题 */
+.hotcity {
+ position: fixed;
+ width: 100%;
+ left: 0;
+ top: 0;
+ z-index: 1000;
+ background-color: #fff;
+ font-size: 28rpx;
+ height: 90rpx;
+}
+
+.hotcity-location {
+ color: #999;
+ padding: 10px;
+ box-sizing: border-box;
+ display: flex;
+ line-height: 54rpx;
+}
+
+.hotcity-location text {
+ color: #1c74c6;
+ display: inline-block;
+ padding: 0 10rpx;
+ font-size: 26rpx;
+ height: 54rpx;
+ line-height: 54rpx;
+ border-radius: 6rpx;
+ margin-left: 10rpx;
+ flex: 1;
+}
+
+.hotcity-location image {
+ width: 34rpx;
+ height: 34rpx;
+ margin: 10rpx 10rpx 0 0;
+}
+
+.hotcity-choice {
+ padding: 10px 10px 0 10px;
+ box-sizing: border-box;
+ color: #1c74c6;
+ border-top: 1rpx solid #ededed;
+}
+
+
+/* 区域选择 */
+.region {
+ position: fixed;
+ z-index: 1000;
+ left: 0;
+ top: 178rpx;
+ width: 100%;
+ height: calc(100% - 178rpx);
+ padding-left: 280rpx;
+ box-sizing: border-box;
+ background: #f5f5f5;
+}
+
+.region.active {
+ display: block;
+}
+
+.region .item_city {
+ padding-left: 10rpx;
+}
+
+.city-name {
+ background: #f5f5f5;
+ line-height: 60rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+ font-size: 28rpx;
+}
+
+.region .item_city {
+ padding: 0 0 0 20rpx;
+ box-sizing: border-box;
+ font-weight: normal;
+ font-size: 24rpx;
+ height: 102rpx;
+}
+
+/* 开启定位 */
+.location-btn[size="mini"] {
+ background-color: #ee8e44;
+ color: #fff;
+ font-size: 24rpx;
+ line-height: 54rpx;
+ margin: 0 0 0 20rpx;
+}
+
+/* 搜索框 */
+.weui-search-bar {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 50px;
+ padding: 0 10px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ box-sizing: border-box;
+ background-color: #f5f5f5;
+ border-top: 1rpx solid #f1f1f1;
+ border-bottom: 1rpx solid #f1f1f1;
+}
+
+.weui-icon-search_in-box {
+ position: absolute;
+ left: 10px;
+ top: 6px;
+}
+
+.weui-search-bar__form {
+ -webkit-box-flex: 1;
+ height: 32px;
+ line-height: 32px;
+ margin-top: 7px;
+ -webkit-flex: auto;
+ flex: auto;
+ border-radius: 5px;
+ background: #FFFFFF;
+ border: 1rpx solid #f1f1f1;
+}
+
+.weui-search-bar__box {
+ position: relative;
+ padding-left: 30px;
+ padding-right: 30px;
+ height: 32px;
+ width: 100%;
+ box-sizing: border-box;
+ z-index: 1;
+}
+
+.weui-search-bar__input {
+ height: 32px;
+ line-height: 32px;
+ font-size: 14px;
+ padding-left: 10rpx;
+}
+
+.weui-search-bar__cancel-btn {
+ margin-left: 10px;
+ line-height: 50px;
+ color: #09BB07;
+ white-space: nowrap;
+ font-size: 30rpx;
+}
+
+
+.scrollLeft {
+ position: fixed;
+ top: 178rpx;
+ height: calc(100% - 178rpx);
+ left: 0;
+ width: 260rpx;
+ z-index: 1001;
+ border-right: 1rpx solid #f1f1f1;
+ background-color: #fff;
+}
+
+
+.newLetter {
+ position: fixed;
+ top: 90rpx;
+ left: 0;
+ width: 100%;
+ height: 90rpx;
+ line-height: 90rpx;
+ background-color: #fff;
+ z-index: 1001;
+ font-size: 28rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+
+.newLetter::before {
+ position: absolute;
+ content: '';
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #f1f1f1;
+}
+
+.newLetter::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #f1f1f1;
+}
+
+.newLetter text {
+ display: inline-block;
+ position: relative;
+ margin-right: 20rpx;
+ padding: 0 10rpx;
+}
+
+.newLetter text.active {
+ color: #e83339;
+}
+
+.newLetter text.active::before {
+ position: absolute;
+ content: '';
+ left: 0;
+ bottom: -2rpx;
+ width: 100%;
+ height: 4rpx;
+ background: #e83339;
+}
\ No newline at end of file
diff --git a/pages/user/user.js b/pages/user/user.js
new file mode 100644
index 0000000..cd92fd6
--- /dev/null
+++ b/pages/user/user.js
@@ -0,0 +1,174 @@
+
+/*
+ * 本时生活
+ */
+
+const app = getApp()
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ isUser : false, //用户登录状态
+ currentId : '', //轮播下标
+ infos : '', //用户信息
+ order : '', //订单信息
+ account : '',
+ // 卡轮播
+ swiper: {
+ imgUrls: [
+ {
+ id : 0,
+ src : '/static/img/user_card_00.png',
+ color : '#676869',
+ type : 'silver'
+ },
+ {
+ id : 2,
+ src : '/static/img/user_card_02.png',
+ color : '#192b4c',
+ type : 'drill'
+ }
+ ],
+ autoplay: false,
+ interval: 5000,
+ duration: 1000,
+ current : 0
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ },
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow () {
+ // 检查用户是否已登录
+ const current = wx.getStorageSync("current")
+ this.setData({
+ currentId: current
+ })
+
+ if(wx.getStorageSync("token") == ""){
+ this.setData({
+ infos : '',
+ order : '',
+ account : '',
+ isUser : false
+ })
+ return
+ }
+
+ this.setData({
+ isUser : getApp().globalData.isUser
+ })
+
+ // 获取用户信息
+ this.userInfo();
+ },
+
+ /**
+ * 用户信息
+ */
+ userInfo() {
+ wx.$api.user.index().then(res=>{
+ this.setData({
+ infos : res.data.info,
+ order : res.data.order,
+ account : res.data.info.account
+ })
+ }).catch(err=>{
+ if(!err.login){
+ this.setData({
+ infos : '',
+ order : '',
+ account : '',
+ isUser : false
+ })
+ }
+ })
+ },
+
+ /**
+ * 处理未登录时的转跳
+ */
+ userNav(e){
+ let pageUrl = e.currentTarget.dataset.url
+ if(this.data.isUser){
+ wx.navigateTo({
+ url: pageUrl
+ })
+ }else{
+ // 去登录
+ wx.navigateTo({
+ url: "/pages/login/login"
+ })
+ }
+ },
+
+ /**
+ * 判断是否新用户
+ */
+ userLogin(){
+ if(app.globalData.token != '') {
+ wx.navigateTo({
+ url: '/pages/chooseTel/chooseTel'
+ })
+ }else {
+ wx.navigateTo({
+ url: '/pages/login/login',
+ })
+ }
+ },
+
+ /**
+ * 切换用户
+ */
+ switchParty() {
+ wx.navigateTo({
+ url: '/pages/chooseTel/chooseTel?type=mobiles'
+ })
+ },
+
+ /**
+ * 左箭头
+ */
+ prevImg () {
+ var swiper = this.data.swiper;
+ var current = swiper.current;
+
+ swiper.current = current > 0 ? current - 1 : swiper.imgUrls.length - 1;
+ this.setData({
+ swiper: swiper,
+ })
+ },
+
+ /**
+ * 右箭头
+ */
+ nextImg () {
+ var swiper = this.data.swiper;
+ var current = swiper.current;
+ swiper.current = current < (swiper.imgUrls.length - 1) ? current + 1 : 0;
+ this.setData({
+ swiper: swiper,
+ })
+ },
+
+ /**
+ * 敬请期待
+ */
+ await() {
+ wx.showToast({
+ title : '努力开发中~',
+ icon : 'none',
+ duration: 1000
+ })
+ }
+
+})
\ No newline at end of file
diff --git a/pages/user/user.json b/pages/user/user.json
new file mode 100644
index 0000000..7d66fe4
--- /dev/null
+++ b/pages/user/user.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents" : {},
+ "navigationBarTitleText": "个人中心"
+}
\ No newline at end of file
diff --git a/pages/user/user.wxml b/pages/user/user.wxml
new file mode 100644
index 0000000..050ca0d
--- /dev/null
+++ b/pages/user/user.wxml
@@ -0,0 +1,171 @@
+
+
+
+
+
+ {{infos.identity.identity_id == 0 ? '普通用户':'惠生活会员'}}
+
+
+
+ {{infos.nickname}}
+
+
+ {{infos.username}}
+
+
+
+
+ 切换账号
+
+
+
+
+
+
+
+
+ 去登录
+
+
+
+
+
+
+
+ 我的会员卡
+
+
+
+
+
+ 可用余额:
+ {{account.silver}}
+ {{account.gold}}
+ {{account.drill}}
+
+
+
+
+
+
+
+
+
+
+ 滑动切换,查看更多权益
+
+
+
+
+
+
+ 我的服务
+
+
+
+
+
+ 我的卡券
+
+
+
+
+
+ 红包领取
+
+
+
+
+
+
+ 收货地址
+
+
+
+
+
+ 实体卡激活
+
+
+
+
+
+
+ 兑换订单
+
+
+
+
+
+
+
+ 所有订单
+
+
+
+
+
+ 待支付
+
+
+
+
+
+ 待发货
+
+
+
+
+
+ 已发货
+
+
+
+
diff --git a/pages/user/user.wxss b/pages/user/user.wxss
new file mode 100644
index 0000000..ad9d9ce
--- /dev/null
+++ b/pages/user/user.wxss
@@ -0,0 +1,228 @@
+/* 个人中心 */
+.userHead {
+ display: flex;
+ padding: 30rpx;
+ box-sizing: border-box;
+ background: white;
+}
+
+.userHead-img {
+ width: 135rpx;
+ height: 135rpx;
+ border-radius: 50%;
+ position: relative;
+}
+
+.userHead-img image {
+ position: absolute;
+ left: 22rpx;
+ top: 0;
+ width: 110rpx;
+ height: 110rpx;
+ border-radius: 50%;
+}
+
+.no-userHead {
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.userHead-img view {
+ display: inline-block;
+ position: absolute;
+ bottom: 0;
+ left: 10rpx;
+ background: #c6c6c6;
+ border-radius: 30rpx;
+ color: #fff;
+ font-size: 24rpx;
+ padding: 4rpx 0;
+ text-align: center;
+ width: 130rpx;
+ display: inline-block;
+ z-index: 99;
+}
+
+.userHead-img view.active {
+ width: 144rpx;
+ left: 8rpx;
+ background: #000;
+ color: #fff;
+}
+
+.userHead-text {
+ margin-left: 30rpx;
+ width: calc(100% - 340rpx);
+}
+
+.userHead-switch {
+ border: 2rpx solid #000;
+ border-radius: 50rpx;
+ font-size: 24rpx;
+ height: 58rpx;
+ line-height: 58rpx;
+ width: 160rpx;
+ margin-top: 30rpx;
+ display: flex;
+}
+
+.userHead-switch image {
+ width: 30rpx;
+ height: 30rpx;
+ margin: 15rpx 6rpx 0 12rpx;
+}
+
+.userHead-name {
+ margin: 10rpx 0 20rpx;
+ font-size: 32rpx;
+ font-weight: 600;
+}
+
+
+.userHead-login {
+ border: 2rpx solid #313131;
+ border-radius: 6rpx;
+ font-size: 28rpx;
+ padding: 8rpx 30rpx;
+ margin-top: 30rpx;
+ display: inline-block;
+}
+
+.userHead-tel {
+ font-size: 28rpx;
+}
+
+/* 轮播图 */
+.userCard {
+ background: white;
+ padding-bottom: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.userCard-title {
+ font-size: 32rpx;
+ font-weight: 600;
+ padding: 30rpx 30rpx 0;
+ margin: 20rpx 0;
+}
+
+.userCard-cont {
+ padding: 30rpx 80rpx;
+ box-sizing: border-box;
+ position: relative;
+}
+
+.userCard-clip {
+ position: relative;
+ padding-top: 55%;
+ width: 100%;
+}
+
+/* .userCard-clip::after {
+ content: '';
+ left: 10%;
+ top: 0;
+ background: rgba(0, 0, 0, .5);
+ position: absolute;
+ z-index: 1;
+ width: 80%;
+ height: 90%;
+ border-radius: 20px;
+} */
+
+.userCard-swiper {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 9;
+}
+
+.userCard-item {
+ padding: 0 10rpx;
+ box-sizing: border-box;
+}
+
+.userCard-img {
+ width: 100%;
+ height: 100%;
+ background-size: 100% 100%;
+}
+
+.userCard-parice {
+ position: absolute;
+ z-index: 9;
+ left: 30rpx;
+ bottom: 50rpx;
+ color: #f79210;
+ font-weight: 600;
+ font-size: 36rpx;
+}
+
+.userCard-arrow-left, .userCard-arrow-right {
+ width: 50rpx;
+ height: 50rpx;
+ position: absolute;
+ top: calc(50% - 25rpx);
+}
+
+.userCard-arrow-left {
+ right: 10rpx;
+}
+
+.userCard-arrow-right {
+ left: 10rpx;
+}
+
+.userCard-tips {
+ background: #f0f4fa;
+ border-radius: 30rpx;
+ width: 360rpx;
+ text-align: center;
+ margin: 0 auto;
+ color: #b4bbc4;
+ font-size: 26rpx;
+ padding: 14rpx 0;
+}
+
+.userCard-tips image {
+ width: 20rpx;
+ height: 20rpx;
+}
+
+.userOrder {
+ overflow: hidden;
+ margin-top: 40rpx;
+}
+
+.userOrder-label {
+ float: left;
+ width: 25%;
+ text-align: center;
+ font-size: 28rpx;
+}
+
+.userOrder-label-new .userOrder-label {
+ width: 25%;
+}
+
+.userOrder-icon {
+ width: 94rpx;
+ height: 94rpx;
+ background: #000;
+ border-radius: 50%;
+ padding: 18rpx;
+ box-sizing: border-box;
+ margin: 0 auto 10rpx;
+}
+
+.userOrder-icon.active {
+ background: #000;
+}
+
+.userOrder-icon image {
+ width: 100%;
+ height: 100%;
+}
+
diff --git a/pages/webView/webView.js b/pages/webView/webView.js
new file mode 100644
index 0000000..721259a
--- /dev/null
+++ b/pages/webView/webView.js
@@ -0,0 +1,68 @@
+// pages/webView/webView.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url:''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ url : decodeURIComponent(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..77a6354
--- /dev/null
+++ b/pages/webView/webView.wxml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/pages/webView/webView.wxss b/pages/webView/webView.wxss
new file mode 100644
index 0000000..baae063
--- /dev/null
+++ b/pages/webView/webView.wxss
@@ -0,0 +1 @@
+/* pages/webView/webView.wxss */
\ No newline at end of file
diff --git a/pages/welfare/welfare.js b/pages/welfare/welfare.js
new file mode 100644
index 0000000..d69a27e
--- /dev/null
+++ b/pages/welfare/welfare.js
@@ -0,0 +1,127 @@
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ noticeShow : false, //须知显示状态
+ pointMoreShow : false, //重要提示显示状态
+ groupId : '', //权益id
+ contData : '', //全局内容
+ rightData : '', //权益详情
+ content : '', //内容介绍
+ notification : '', //重要提示
+ remark : '', //使用须知
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad (options) {
+ this.setData({
+ groupId : options.id
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+ // 获取详情
+ this.rightsInfo();
+ },
+
+ /**
+ * 详情
+ */
+ rightsInfo() {
+ wx.$api.index.welfares(this.data.groupId).then(res=>{
+ this.setData({
+ contData : res.data,
+ rightData : res.data.right,
+ remark : res.data.remark.replace(/\
{
+ if(!err.login){
+ wx.showModal({
+ title : '用户登录已过期',
+ content : '请重新登录',
+ showCancel : false,
+ success : res => {
+ if (res.confirm) {
+ wx.redirectTo({
+ url: '/pages/login/login'
+ })
+ }
+ }
+ })
+ }
+ })
+ },
+
+ /**
+ * 须知展开收起状态
+ */
+ noticeTap() {
+ this.setData({
+ noticeShow : !this.data.noticeShow
+ })
+ },
+
+ /**
+ * 重要提示展开收起状态
+ */
+ pointMoreTap() {
+ this.setData({
+ pointMoreShow : !this.data.pointMoreShow
+ })
+ },
+
+ /**
+ * 普通商品支付提交
+ */
+ ordinary() {
+ this.submitOrder();
+ this.setData({
+ disabled : true
+ })
+ },
+
+ /**
+ * 支付提交
+ */
+ submitOrder() {
+ let welfareId = this.data.contData.welfare_id
+ wx.$api.index.fridayInfo(welfareId).then(res=>{
+ wx.$api.index.fridayPay(res.data.trade_no).then(res=>{
+ let payInfo = JSON.parse(res.data)
+ wx.requestPayment({
+ timeStamp: payInfo.timeStamp,
+ nonceStr : payInfo.nonceStr,
+ package : payInfo.package,
+ paySign : payInfo.paySign,
+ signType : payInfo.signType,
+ success : res=>{
+ if(res.errMsg == "requestPayment:ok"){
+ wx.showToast({
+ title: '支付成功',
+ icon : 'success'
+ })
+ setTimeout(()=>{
+ wx.reLaunch({
+ url: '/pages/coupon/coupon?type=couponPublic'
+ })
+ },3000)
+ }
+ },
+ fail : res=>{
+ wx.reLaunch({
+ url: '/pages/order/order?stateType=unpay'
+ })
+ }
+ })
+ })
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/welfare/welfare.json b/pages/welfare/welfare.json
new file mode 100644
index 0000000..c805305
--- /dev/null
+++ b/pages/welfare/welfare.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "支付详情",
+ "navigationBarBackgroundColor": "#ededed"
+}
\ No newline at end of file
diff --git a/pages/welfare/welfare.wxml b/pages/welfare/welfare.wxml
new file mode 100644
index 0000000..910f9bb
--- /dev/null
+++ b/pages/welfare/welfare.wxml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+ 重要提示
+
+
+
+
+
+ {{pointMoreShow == true ? '收起' : '展开'}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{rightData.title}}
+ {{rightData.subtitle}}
+
+
+
+
+
+
+ {{contData.attribute.form_price}}
+ ¥{{contData.total}}
+
+
+ {{contData.attribute.form_qty}}
+ 1张
+
+
+ {{contData.attribute.form_type}}
+ ¥{{contData.score}}
+
+
+
+
+
+
+ {{contData.attribute.form_pay}}
+ ¥{{contData.price}}
+
+
+
+
+
+
+ 支付方式
+ 微信支付
+
+
+
+
+
+
+
+
+ 购买前请仔细阅读内容介绍
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/welfare/welfare.wxss b/pages/welfare/welfare.wxss
new file mode 100644
index 0000000..a9556cd
--- /dev/null
+++ b/pages/welfare/welfare.wxss
@@ -0,0 +1,567 @@
+/* 卡券权益 */
+.welfare {
+ text-align: center;
+ width: 100%;
+ background-color: #fff;
+ padding: 30rpx;
+ box-sizing: border-box;
+}
+
+.welfareCont-top{
+ flex-wrap: wrap;
+ flex-direction: column;
+ margin: 10rpx 0;
+}
+
+.welfareCont-list-img {
+ border: 2rpx solid #eccc69;
+ border-radius: 50%;
+ width: 100rpx;
+ height: 100rpx;
+ display: inline-block;
+ margin: 0 10rpx;
+}
+
+.welfareCont-text {
+ position: relative;
+ padding: 20rpx 50rpx;
+ box-sizing: border-box;
+ width: 100%;
+ display: grid;
+ border-top: 4rpx dashed #ebcc68;
+}
+
+.welfareCont-tips {
+ background-color: #000000;
+ color: #ffd88d;
+ border-radius: 10rpx;
+ margin-top: 20rpx;
+ height: 54rpx;
+ line-height: 54rpx;
+ font-size: 27rpx;
+ display: inline-block;
+ font-weight: 600;
+ padding: 0 20rpx;
+}
+
+.welfareCont {
+ background: #fcf9e8;
+ border: 2rpx solid #eac85c;
+ border-radius: 20rpx;
+ display: inline-block;
+ text-align: center;
+ box-sizing: border-box;
+}
+
+
+.rightsNumber {
+ display: flex;
+ width: 100%;
+ margin: 30px 0 20px;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+}
+
+.rightsNumber text {
+ display: inline-block;
+ flex: 1;
+}
+
+.rightsAdd {
+ display: flex;
+}
+
+.rightsAdd-btn {
+ background: #eaeaea;
+ color: #535353;
+ border-radius: 50%;
+ text-align: center;
+ width: 50rpx;
+ height: 50rpx;
+ line-height: 45rpx;
+ font-size: 40rpx;
+ font-weight: 600;
+}
+
+.rightsAdd-input {
+ width: 100rpx;
+ text-align: center;
+ font-size: 28rpx;
+ line-height: 50rpx;
+}
+
+.rightsTips {
+ padding: 0 30rpx;
+ color: #ff5b5d;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.rightsList,
+.notice,
+.detailsStore {
+ background: white;
+ margin: 30rpx;
+ border-radius: 10rpx;
+ padding: 10rpx 0;
+ box-sizing: border-box;
+}
+
+.rightsLabel,
+.rightsLabel-pay {
+ display: flex;
+ padding: 20rpx;
+ color: #6f7880;
+ font-size: 30rpx;
+}
+
+.rightsLabel .rightsLabel-left {
+ flex: 1;
+ color: #747d86;
+}
+
+.rightsLabel-black {
+ padding-top: 30rpx;
+}
+
+.rightsLabel-range {
+ display: flex;
+ color: #000;
+ font-weight: 600;
+}
+
+.rightsLabel-row {
+ width: 38rpx;
+ height: 38rpx;
+ margin: 2rpx 0 0 6rpx;
+}
+
+.rightsLabel-black .rightsLabel-right,
+.rightsLabel-red {
+ color: #ff5b5d;
+ font-size: 32rpx;
+}
+
+.rightsLabel-black .rightsLabel-left {
+ color: #000;
+}
+
+.rightsLabel-score {
+ font-weight: 600;
+ color: #000;
+ font-size: 38rpx;
+}
+
+.rightsLabel-pay {
+ color: #000;
+}
+
+.rightsLabel-pay .rightsLabel-left {
+ flex: 1;
+}
+
+.notice {
+ padding: 20rpx;
+}
+
+.noticeTitle {
+ display: flex;
+ margin-bottom: 20rpx;
+}
+
+.noticeTitle-flex {
+ flex: 1;
+ display: flex;
+ font-size: 30rpx;
+ line-height: 46rpx;
+}
+
+.noticeTitle-img {
+ width: 46rpx;
+ height: 46rpx;
+ margin-right: 20rpx;
+}
+
+.noticeText {
+ font-size: 26rpx;
+ height: 0;
+ overflow: hidden;
+}
+
+.noticeText.active {
+ height: auto;
+}
+
+.noticeText-top {
+ margin: 30rpx 0 10rpx;
+ font-weight: 600;
+}
+
+.noticeText-cont {
+ line-height: 60rpx;
+ color: #666;
+}
+
+.noticeTitle-row {
+ width: 46rpx;
+ height: 46rpx;
+}
+
+.noticeTitle-row.active {
+ transform: rotate(90deg);
+}
+
+/* 门店 */
+.detailsStore {
+ padding: 20rpx;
+}
+
+.detailsStore-top {
+ display: flex;
+ line-height: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.detailsStore-see {
+ color: #dfae2e;
+ border: 2rpx solid #dfae2e;
+ border-radius: 10rpx;
+ font-size: 28rpx;
+ margin-top: 30rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+}
+
+.detailsStore-see text {
+ display: inline-block;
+}
+
+.detailsStore-see image {
+ width: 50rpx;
+ height: 50rpx;
+ margin-left: 10rpx;
+}
+
+/* 购买按钮 */
+.rightsBtn {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 100rpx;
+ z-index: 9;
+ background: #fff;
+}
+
+.rightsBtn button,
+.rightsBtn text {
+ display: block;
+ margin: 12rpx 30rpx;
+ width: calc(100% - 60rpx) !important;
+ height: 74rpx !important;
+ line-height: 74rpx !important;
+ padding: 0;
+ background: #eacf88;
+ text-align: center;
+ border-radius: 60rpx;
+ font-size: 30rpx;
+}
+
+
+.rightsBtn.active text {
+ background: #dedede;
+ color: #888;
+}
+
+/* 选择收货地址 */
+.addressBack {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, .4);
+ z-index: 10;
+ width: 100%;
+ height: 100%;
+ display: none;
+}
+
+.addressBack.active {
+ display: block;
+}
+
+.addressCont {
+ position: fixed;
+ left: 0;
+ bottom: -1000%;
+ transition: .2s;
+ background: #fff;
+ z-index: 11;
+ width: 100%;
+}
+
+.addressCont.active {
+ bottom: 0;
+}
+
+.addressCont-title {
+ height: 90rpx;
+ line-height: 90rpx;
+ display: flex;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ font-size: 28rpx;
+ font-weight: 600;
+}
+
+.addressCont-left {
+ flex: 1;
+}
+
+.addressCont-right {
+ color: #309ded;
+}
+
+.header-classify {
+ white-space: nowrap;
+ box-sizing: border-box;
+ height: 600rpx;
+}
+
+.addressCont-list {
+ padding: 30rpx 20rpx;
+ box-sizing: border-box;
+ font-size: 30rpx;
+ overflow: hidden;
+ position: relative;
+}
+
+.addressCont-top {
+ display: flex;
+ margin-bottom: 10rpx;
+}
+
+.addressCont-name {
+ font-weight: 600;
+}
+
+.addressCont-text {
+ color: #666;
+ width: calc(100% - 160rpx);
+}
+
+.addressCont-list:last-child {
+ border: none;
+}
+
+.rightsLabel-address {
+ display: flex;
+}
+
+.rightsLabel-address text {
+ display: inline-block;
+ width: calc(100% - 46rpx);
+}
+
+.rightsLabel-address .rightsLabel-right {
+ display: flex;
+ font-size: 28rpx;
+}
+
+.address-tool {
+ display: flex;
+ float: right;
+}
+
+.address-tool-btn {
+ font-size: 24rpx;
+ margin-top: 20rpx;
+ border: 2rpx solid #666;
+ color: #666;
+ border-radius: 6rpx;
+ text-align: center;
+ height: 50rpx;
+ line-height: 50rpx;
+ padding: 0 20rpx;
+ margin-right: 20rpx;
+ display: flex;
+}
+
+.address-tool-btn-del {
+ color: #dfae2e;
+ border-color: #dfae2e;
+}
+
+.address-tool-icon {
+ width: 120rpx;
+ height: 54rpx;
+ line-height: 54rpx;
+ border-radius: 4rpx;
+ text-align: center;
+ color: #fff;
+ position: absolute;
+ top: 45rpx;
+ right: 10rpx;
+ background: #dfae2e;
+ transform: scale(.9, .9);
+ font-size: 24rpx;
+}
+
+.rightsPoint {
+ position: fixed;
+ left: 0;
+ bottom: 100rpx;
+ background: #fff;
+ z-index: 9;
+ width: 100%;
+ padding: 20rpx 20rpx 10rpx;
+ box-sizing: border-box;
+}
+
+.rightsPoint-cont {
+ width: 100%;
+ background: #fcf9e8;
+ border: 2rpx solid #ecd390;
+ border-radius: 10rpx;
+ position: relative;
+ max-height: 50vh;
+ overflow-y: scroll;
+}
+
+.rightsPoint-top {
+ font-size: 28rpx;
+ display: flex;
+ padding: 20rpx;
+ box-sizing: border-box;
+ font-weight: 600;
+}
+
+.rightsPoint-top image {
+ width: 36rpx;
+ height: 36rpx;
+ margin-right: 10rpx;
+}
+
+.rightsPoint-text {
+ padding: 0 20rpx;
+ box-sizing: border-box;
+ font-size: 24rpx;
+ line-height: 44rpx;
+ height: 90rpx;
+ transition: height 25s;
+ overflow: hidden;
+}
+
+.rightsPoint-text.active {
+ height: auto;
+ transition: 2s;
+}
+
+.rightsPoint-text view {
+ position: relative;
+ padding-left: 40rpx;
+}
+
+.rightsPoint-text view::after {
+ position: absolute;
+ content: '';
+ left: 10rpx;
+ top: 20rpx;
+ background: #000;
+ width: 10rpx;
+ height: 10rpx;
+ border-radius: 50%;
+}
+
+.rightsPoint-bolck {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: calc(100% - 40rpx);
+}
+
+.pointMore {
+ text-align: center;
+ width: 100%;
+ background: #fff8e5;
+ height: 80rpx;
+ line-height: 82rpx;
+ position: relative;
+ margin-top: 10rpx;
+}
+
+.pointMore::after {
+ position: absolute;
+ content: '';
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 2rpx;
+ background: #ecd390;
+}
+
+.pointMore text {
+ font-size: 28rpx;
+ color: #c38e00;
+ animation: dong 1.8s infinite;
+ display: inline-block;
+}
+
+.pointMore image {
+ width: 30rpx;
+ height: 30rpx;
+ margin-left: 4rpx;
+ vertical-align: -4rpx;
+ animation: dong 1.8s infinite;
+}
+
+@keyframes dong {
+ 0% {
+ transform: translate(0px, 0px);
+ }
+
+ 50% {
+ transform: translate(0px, -6rpx);
+ }
+
+ 100% {
+ transform: translate(0px, 0px);
+ }
+}
+
+.rightsCont-btn {
+ display:inline-block;
+ text-align: center;
+ background-image: linear-gradient(to right, #eaaaa8, #f4e5c2, #eaaaa8);
+ box-shadow: 0 0 10rpx rgba(233, 166, 166, .9);
+ border-radius: 30px;
+ padding: 5rpx;
+ line-height: 40rpx;
+}
+
+.rightsCont-btn text {
+ border-radius: 30px;
+ width: 100%;
+ height: 100%;
+ display: block;
+ padding: 10rpx 20rpx;
+ box-sizing: border-box;
+ background: linear-gradient(#fefcfa, #f9f0db, #f7ebcf);
+ font-size: 30rpx;
+}
+
+.webBack {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ z-index: 9999;
+ background-color: #fff;
+ text-align: center;
+ display: none;
+}
+
+.webBack.active {
+ display: block;
+}
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
new file mode 100644
index 0000000..042a07e
--- /dev/null
+++ b/project.config.json
@@ -0,0 +1,135 @@
+{
+ "description": "项目配置文件",
+ "packOptions": {
+ "ignore": []
+ },
+ "setting": {
+ "urlCheck": false,
+ "es6": true,
+ "enhance": false,
+ "postcss": true,
+ "preloadBackgroundData": false,
+ "minified": true,
+ "newFeature": false,
+ "coverView": true,
+ "nodeModules": false,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "uglifyFileName": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "compileHotReLoad": false,
+ "useMultiFrameRuntime": true,
+ "useApiHook": true,
+ "useApiHostProcess": false,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "enableEngineNative": false,
+ "bundle": false,
+ "useIsolateContext": true,
+ "useCompilerModule": true,
+ "userConfirmedUseCompilerModuleSwitch": false,
+ "userConfirmedBundleSwitch": false,
+ "packNpmManually": false,
+ "packNpmRelationList": [],
+ "minifyWXSS": true
+ },
+ "compileType": "miniprogram",
+ "libVersion": "2.12.1",
+ "appid": "wxb2e3e8091d9feac3",
+ "projectname": "%E4%BA%BF%E6%97%B6%E4%BB%A3",
+ "debugOptions": {
+ "hidedInDevtools": []
+ },
+ "scripts": {},
+ "isGameTourist": false,
+ "simulatorType": "wechat",
+ "simulatorPluginLibVersion": {},
+ "condition": {
+ "plugin": {
+ "list": []
+ },
+ "game": {
+ "list": []
+ },
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "id": 0,
+ "name": "pages/user/user",
+ "pathName": "pages/user/user",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 1,
+ "name": "pages/activityInfo/activityInfo",
+ "pathName": "pages/activityInfo/activityInfo",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/activityOrder/activityOrder",
+ "pathName": "pages/activityOrder/activityOrder",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 3,
+ "name": "pages/activate/activate",
+ "pathName": "pages/activate/activate",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/index/index",
+ "pathName": "pages/index/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 5,
+ "name": "pages/login/login",
+ "pathName": "pages/login/login",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/coupon/coupon",
+ "pathName": "pages/coupon/coupon",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/frozen/frozen",
+ "pathName": "pages/frozen/frozen",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/account/account",
+ "pathName": "pages/account/account",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/packet/packet",
+ "pathName": "pages/packet/packet",
+ "query": "",
+ "scene": null
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
new file mode 100644
index 0000000..2acbc37
--- /dev/null
+++ b/project.private.config.json
@@ -0,0 +1,103 @@
+{
+ "setting": {},
+ "condition": {
+ "plugin": {
+ "list": []
+ },
+ "game": {
+ "list": []
+ },
+ "gamePlugin": {
+ "list": []
+ },
+ "miniprogram": {
+ "list": [
+ {
+ "id": 0,
+ "name": "pages/user/user",
+ "pathName": "pages/user/user",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 1,
+ "name": "pages/activityInfo/activityInfo",
+ "pathName": "pages/activityInfo/activityInfo",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/activityOrder/activityOrder",
+ "pathName": "pages/activityOrder/activityOrder",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 3,
+ "name": "pages/activate/activate",
+ "pathName": "pages/activate/activate",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/index/index",
+ "pathName": "pages/index/index",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": 5,
+ "name": "pages/login/login",
+ "pathName": "pages/login/login",
+ "query": "",
+ "scene": null
+ },
+ {
+ "id": -1,
+ "name": "pages/coupon/coupon",
+ "pathName": "pages/coupon/coupon",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/frozen/frozen",
+ "pathName": "pages/frozen/frozen",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/account/account",
+ "pathName": "pages/account/account",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/packet/packet",
+ "pathName": "pages/packet/packet",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/welfare/welfare",
+ "pathName": "pages/welfare/welfare",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/classify/classify",
+ "pathName": "pages/classify/classify",
+ "query": "",
+ "scene": null
+ },
+ {
+ "name": "pages/order/order",
+ "pathName": "pages/order/order",
+ "query": "",
+ "scene": null
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/sitemap.json b/sitemap.json
new file mode 100644
index 0000000..ca02add
--- /dev/null
+++ b/sitemap.json
@@ -0,0 +1,7 @@
+{
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+ "rules": [{
+ "action": "allow",
+ "page": "*"
+ }]
+}
\ No newline at end of file
diff --git a/static/icon/Check.png b/static/icon/Check.png
new file mode 100644
index 0000000..414ff3b
Binary files /dev/null and b/static/icon/Check.png differ
diff --git a/static/icon/Point_icon.png b/static/icon/Point_icon.png
new file mode 100644
index 0000000..7eee5a3
Binary files /dev/null and b/static/icon/Point_icon.png differ
diff --git a/static/icon/activity_icon.png b/static/icon/activity_icon.png
new file mode 100644
index 0000000..6d54870
Binary files /dev/null and b/static/icon/activity_icon.png differ
diff --git a/static/icon/add.png b/static/icon/add.png
new file mode 100644
index 0000000..ad2ed18
Binary files /dev/null and b/static/icon/add.png differ
diff --git a/static/icon/address_icon.png b/static/icon/address_icon.png
new file mode 100644
index 0000000..70ca205
Binary files /dev/null and b/static/icon/address_icon.png differ
diff --git a/static/icon/arrow_down.png b/static/icon/arrow_down.png
new file mode 100644
index 0000000..8731b7a
Binary files /dev/null and b/static/icon/arrow_down.png differ
diff --git a/static/icon/arrow_left.png b/static/icon/arrow_left.png
new file mode 100644
index 0000000..94a76ab
Binary files /dev/null and b/static/icon/arrow_left.png differ
diff --git a/static/icon/arrow_right.png b/static/icon/arrow_right.png
new file mode 100644
index 0000000..d965a47
Binary files /dev/null and b/static/icon/arrow_right.png differ
diff --git a/static/icon/arrow_right_black.png b/static/icon/arrow_right_black.png
new file mode 100644
index 0000000..ca0d51d
Binary files /dev/null and b/static/icon/arrow_right_black.png differ
diff --git a/static/icon/arrow_tips.png b/static/icon/arrow_tips.png
new file mode 100644
index 0000000..d42d882
Binary files /dev/null and b/static/icon/arrow_tips.png differ
diff --git a/static/icon/choice.png b/static/icon/choice.png
new file mode 100644
index 0000000..18d62fa
Binary files /dev/null and b/static/icon/choice.png differ
diff --git a/static/icon/indexSite.png b/static/icon/indexSite.png
new file mode 100644
index 0000000..11d5a8b
Binary files /dev/null and b/static/icon/indexSite.png differ
diff --git a/static/icon/integra_icon00.png b/static/icon/integra_icon00.png
new file mode 100644
index 0000000..969f039
Binary files /dev/null and b/static/icon/integra_icon00.png differ
diff --git a/static/icon/integra_icon01.png b/static/icon/integra_icon01.png
new file mode 100644
index 0000000..18f25e8
Binary files /dev/null and b/static/icon/integra_icon01.png differ
diff --git a/static/icon/location.png b/static/icon/location.png
new file mode 100644
index 0000000..186b0e4
Binary files /dev/null and b/static/icon/location.png differ
diff --git a/static/icon/news_icon.png b/static/icon/news_icon.png
new file mode 100644
index 0000000..2e4c687
Binary files /dev/null and b/static/icon/news_icon.png differ
diff --git a/static/icon/notice_icon.png b/static/icon/notice_icon.png
new file mode 100644
index 0000000..0975820
Binary files /dev/null and b/static/icon/notice_icon.png differ
diff --git a/static/icon/order_icon_00.png b/static/icon/order_icon_00.png
new file mode 100644
index 0000000..b1e0d85
Binary files /dev/null and b/static/icon/order_icon_00.png differ
diff --git a/static/icon/order_icon_01.png b/static/icon/order_icon_01.png
new file mode 100644
index 0000000..70b7f9b
Binary files /dev/null and b/static/icon/order_icon_01.png differ
diff --git a/static/icon/order_icon_02.png b/static/icon/order_icon_02.png
new file mode 100644
index 0000000..b70aedd
Binary files /dev/null and b/static/icon/order_icon_02.png differ
diff --git a/static/icon/refresh_loding.gif b/static/icon/refresh_loding.gif
new file mode 100644
index 0000000..5bb90fd
Binary files /dev/null and b/static/icon/refresh_loding.gif differ
diff --git a/static/icon/rightsArrow.png b/static/icon/rightsArrow.png
new file mode 100644
index 0000000..80006e1
Binary files /dev/null and b/static/icon/rightsArrow.png differ
diff --git a/static/icon/secrch_icon.png b/static/icon/secrch_icon.png
new file mode 100644
index 0000000..edd6bd6
Binary files /dev/null and b/static/icon/secrch_icon.png differ
diff --git a/static/icon/select.png b/static/icon/select.png
new file mode 100644
index 0000000..96b56f1
Binary files /dev/null and b/static/icon/select.png differ
diff --git a/static/icon/select_avtive.png b/static/icon/select_avtive.png
new file mode 100644
index 0000000..dc76782
Binary files /dev/null and b/static/icon/select_avtive.png differ
diff --git a/static/icon/site_icon.png b/static/icon/site_icon.png
new file mode 100644
index 0000000..94eb9a4
Binary files /dev/null and b/static/icon/site_icon.png differ
diff --git a/static/icon/storeArrow.png b/static/icon/storeArrow.png
new file mode 100644
index 0000000..4afb92b
Binary files /dev/null and b/static/icon/storeArrow.png differ
diff --git a/static/icon/switch.png b/static/icon/switch.png
new file mode 100644
index 0000000..1d8d0ea
Binary files /dev/null and b/static/icon/switch.png differ
diff --git a/static/icon/tel.png b/static/icon/tel.png
new file mode 100644
index 0000000..744f34e
Binary files /dev/null and b/static/icon/tel.png differ
diff --git a/static/icon/time_icon.png b/static/icon/time_icon.png
new file mode 100644
index 0000000..8e1f37f
Binary files /dev/null and b/static/icon/time_icon.png differ
diff --git a/static/img/activate-back.jpg b/static/img/activate-back.jpg
new file mode 100644
index 0000000..90deb1d
Binary files /dev/null and b/static/img/activate-back.jpg differ
diff --git a/static/img/activity_coupon.png b/static/img/activity_coupon.png
new file mode 100644
index 0000000..415fa79
Binary files /dev/null and b/static/img/activity_coupon.png differ
diff --git a/static/img/address_back.png b/static/img/address_back.png
new file mode 100644
index 0000000..9f10b85
Binary files /dev/null and b/static/img/address_back.png differ
diff --git a/static/img/arrow.png b/static/img/arrow.png
new file mode 100644
index 0000000..b34fba0
Binary files /dev/null and b/static/img/arrow.png differ
diff --git a/static/img/card_img.png b/static/img/card_img.png
new file mode 100644
index 0000000..d47c28c
Binary files /dev/null and b/static/img/card_img.png differ
diff --git a/static/img/card_top.png b/static/img/card_top.png
new file mode 100644
index 0000000..fa0fd23
Binary files /dev/null and b/static/img/card_top.png differ
diff --git a/static/img/class_back_01.png b/static/img/class_back_01.png
new file mode 100644
index 0000000..c2b492b
Binary files /dev/null and b/static/img/class_back_01.png differ
diff --git a/static/img/coupon_icon_00.png b/static/img/coupon_icon_00.png
new file mode 100644
index 0000000..0b9e8a6
Binary files /dev/null and b/static/img/coupon_icon_00.png differ
diff --git a/static/img/coupon_icon_01.png b/static/img/coupon_icon_01.png
new file mode 100644
index 0000000..ac023d8
Binary files /dev/null and b/static/img/coupon_icon_01.png differ
diff --git a/static/img/coupon_img.png b/static/img/coupon_img.png
new file mode 100644
index 0000000..0b00e8f
Binary files /dev/null and b/static/img/coupon_img.png differ
diff --git a/static/img/coupon_tips.png b/static/img/coupon_tips.png
new file mode 100644
index 0000000..76794c2
Binary files /dev/null and b/static/img/coupon_tips.png differ
diff --git a/static/img/coupon_tips_00.png b/static/img/coupon_tips_00.png
new file mode 100644
index 0000000..96fc51e
Binary files /dev/null and b/static/img/coupon_tips_00.png differ
diff --git a/static/img/coupon_tips_01.png b/static/img/coupon_tips_01.png
new file mode 100644
index 0000000..f526638
Binary files /dev/null and b/static/img/coupon_tips_01.png differ
diff --git a/static/img/default_cover.png b/static/img/default_cover.png
new file mode 100644
index 0000000..30800b7
Binary files /dev/null and b/static/img/default_cover.png differ
diff --git a/static/img/frozen_time.png b/static/img/frozen_time.png
new file mode 100644
index 0000000..a96fedc
Binary files /dev/null and b/static/img/frozen_time.png differ
diff --git a/static/img/gift_box.png b/static/img/gift_box.png
new file mode 100644
index 0000000..eed5968
Binary files /dev/null and b/static/img/gift_box.png differ
diff --git a/static/img/grant_icon.png b/static/img/grant_icon.png
new file mode 100644
index 0000000..72c945d
Binary files /dev/null and b/static/img/grant_icon.png differ
diff --git a/static/img/legal_tips.png b/static/img/legal_tips.png
new file mode 100644
index 0000000..7bb436f
Binary files /dev/null and b/static/img/legal_tips.png differ
diff --git a/static/img/location_img.jpg b/static/img/location_img.jpg
new file mode 100644
index 0000000..6d34eab
Binary files /dev/null and b/static/img/location_img.jpg differ
diff --git a/static/img/login_img.png b/static/img/login_img.png
new file mode 100644
index 0000000..365bddc
Binary files /dev/null and b/static/img/login_img.png differ
diff --git a/static/img/null_icon.png b/static/img/null_icon.png
new file mode 100644
index 0000000..de104c3
Binary files /dev/null and b/static/img/null_icon.png differ
diff --git a/static/img/packet.png b/static/img/packet.png
new file mode 100644
index 0000000..6d00000
Binary files /dev/null and b/static/img/packet.png differ
diff --git a/static/img/packetText_icon.png b/static/img/packetText_icon.png
new file mode 100644
index 0000000..893418f
Binary files /dev/null and b/static/img/packetText_icon.png differ
diff --git a/static/img/packetText_top.png b/static/img/packetText_top.png
new file mode 100644
index 0000000..8b1c42e
Binary files /dev/null and b/static/img/packetText_top.png differ
diff --git a/static/img/packet_arr.png b/static/img/packet_arr.png
new file mode 100644
index 0000000..4134220
Binary files /dev/null and b/static/img/packet_arr.png differ
diff --git a/static/img/packet_title.png b/static/img/packet_title.png
new file mode 100644
index 0000000..5d3acef
Binary files /dev/null and b/static/img/packet_title.png differ
diff --git a/static/img/pointMore-up.png b/static/img/pointMore-up.png
new file mode 100644
index 0000000..646061d
Binary files /dev/null and b/static/img/pointMore-up.png differ
diff --git a/static/img/pointMore.png b/static/img/pointMore.png
new file mode 100644
index 0000000..4c9b807
Binary files /dev/null and b/static/img/pointMore.png differ
diff --git a/static/img/receive.png b/static/img/receive.png
new file mode 100644
index 0000000..9a15bdb
Binary files /dev/null and b/static/img/receive.png differ
diff --git a/static/img/refresh_loding.gif b/static/img/refresh_loding.gif
new file mode 100644
index 0000000..5bb90fd
Binary files /dev/null and b/static/img/refresh_loding.gif differ
diff --git a/static/img/rights_back_02.png b/static/img/rights_back_02.png
new file mode 100644
index 0000000..c6d7960
Binary files /dev/null and b/static/img/rights_back_02.png differ
diff --git a/static/img/rights_top.png b/static/img/rights_top.png
new file mode 100644
index 0000000..6f0467c
Binary files /dev/null and b/static/img/rights_top.png differ
diff --git a/static/img/staff_null.png b/static/img/staff_null.png
new file mode 100644
index 0000000..350081b
Binary files /dev/null and b/static/img/staff_null.png differ
diff --git a/static/img/tel_img.png b/static/img/tel_img.png
new file mode 100644
index 0000000..f97d934
Binary files /dev/null and b/static/img/tel_img.png differ
diff --git a/static/img/userCoupon.png b/static/img/userCoupon.png
new file mode 100644
index 0000000..ce5220b
Binary files /dev/null and b/static/img/userCoupon.png differ
diff --git a/static/img/userOrder_00.png b/static/img/userOrder_00.png
new file mode 100644
index 0000000..c24b234
Binary files /dev/null and b/static/img/userOrder_00.png differ
diff --git a/static/img/userOrder_01.png b/static/img/userOrder_01.png
new file mode 100644
index 0000000..e20bf9d
Binary files /dev/null and b/static/img/userOrder_01.png differ
diff --git a/static/img/userOrder_02.png b/static/img/userOrder_02.png
new file mode 100644
index 0000000..4d0d78e
Binary files /dev/null and b/static/img/userOrder_02.png differ
diff --git a/static/img/userOrder_03.png b/static/img/userOrder_03.png
new file mode 100644
index 0000000..41ea591
Binary files /dev/null and b/static/img/userOrder_03.png differ
diff --git a/static/img/userOrder_04.png b/static/img/userOrder_04.png
new file mode 100644
index 0000000..c1f6a53
Binary files /dev/null and b/static/img/userOrder_04.png differ
diff --git a/static/img/userOrder_05.png b/static/img/userOrder_05.png
new file mode 100644
index 0000000..b7dfcd3
Binary files /dev/null and b/static/img/userOrder_05.png differ
diff --git a/static/img/userOrder_06.png b/static/img/userOrder_06.png
new file mode 100644
index 0000000..349c143
Binary files /dev/null and b/static/img/userOrder_06.png differ
diff --git a/static/img/userSite.png b/static/img/userSite.png
new file mode 100644
index 0000000..fa79790
Binary files /dev/null and b/static/img/userSite.png differ
diff --git a/static/img/user_card_00.png b/static/img/user_card_00.png
new file mode 100644
index 0000000..f8ba00a
Binary files /dev/null and b/static/img/user_card_00.png differ
diff --git a/static/img/user_card_01.png b/static/img/user_card_01.png
new file mode 100644
index 0000000..4921fcb
Binary files /dev/null and b/static/img/user_card_01.png differ
diff --git a/static/img/user_card_02.png b/static/img/user_card_02.png
new file mode 100644
index 0000000..d6682c1
Binary files /dev/null and b/static/img/user_card_02.png differ
diff --git a/static/img/welfare_back.png b/static/img/welfare_back.png
new file mode 100644
index 0000000..8921b38
Binary files /dev/null and b/static/img/welfare_back.png differ
diff --git a/static/img/wqb.jpg b/static/img/wqb.jpg
new file mode 100644
index 0000000..6c92cef
Binary files /dev/null and b/static/img/wqb.jpg differ
diff --git a/static/img/wx.jpg b/static/img/wx.jpg
new file mode 100644
index 0000000..fcb00a1
Binary files /dev/null and b/static/img/wx.jpg differ
diff --git a/static/tabBarIcon/00.png b/static/tabBarIcon/00.png
new file mode 100644
index 0000000..ab1675c
Binary files /dev/null and b/static/tabBarIcon/00.png differ
diff --git a/static/tabBarIcon/00_active.png b/static/tabBarIcon/00_active.png
new file mode 100644
index 0000000..0519763
Binary files /dev/null and b/static/tabBarIcon/00_active.png differ
diff --git a/static/tabBarIcon/01.png b/static/tabBarIcon/01.png
new file mode 100644
index 0000000..2f8d049
Binary files /dev/null and b/static/tabBarIcon/01.png differ
diff --git a/static/tabBarIcon/01_active.png b/static/tabBarIcon/01_active.png
new file mode 100644
index 0000000..d4ec6b3
Binary files /dev/null and b/static/tabBarIcon/01_active.png differ
diff --git a/utils/qqmap-wx-jssdk.min.js b/utils/qqmap-wx-jssdk.min.js
new file mode 100644
index 0000000..8fa1477
--- /dev/null
+++ b/utils/qqmap-wx-jssdk.min.js
@@ -0,0 +1 @@
+var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: 'key格式错误', PARAM_ERR: 310, PARAM_ERR_MSG: '请求参数信息有误', SYSTEM_ERR: 600, SYSTEM_ERR_MSG: '系统错误', WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; var URL_CITY_LIST = BASE_URL + 'district/v1/list'; var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; var URL_DISTANCE = BASE_URL + 'distance/v1/'; var URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, location2query(data) { if (typeof data == 'string') { return data } var query = ''; for (var i = 0; i < data.length; i++) { var d = data[i]; if (!!query) { query += ';' } if (d.location) { query = query + d.location.lat + ',' + d.location.lng } if (d.latitude && d.longitude) { query = query + d.latitude + ',' + d.longitude } } return query }, rad(d) { return d * Math.PI / 180.0 }, getEndLocation(location) { var to = location.split(';'); var endLocation = []; for (var i = 0; i < to.length; i++) { endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }) } return endLocation }, getDistance(latFrom, lngFrom, latTo, lngTo) { var radLatFrom = this.rad(latFrom); var radLatTo = this.rad(latTo); var a = radLatFrom - radLatTo; var b = this.rad(lngFrom) - this.rad(lngTo); var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); distance = distance * EARTH_RADIUS; distance = Math.round(distance * 10000) / 10000; return parseFloat(distance.toFixed(0)) }, getWXLocation(success, fail, complete) { wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) }, getLocationParam(location) { if (typeof location == 'string') { var locationArr = location.split(','); if (locationArr.length === 2) { location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } } else { location = {} } } return location }, polyfillParam(param) { param.success = param.success || function () { }; param.fail = param.fail || function () { }; param.complete = param.complete || function () { } }, checkParamKeyEmpty(param, key) { if (!param[key]) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); param.fail(errconf); param.complete(errconf); return true } return false }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, checkLocation(param) { var location = this.getLocationParam(param.location); if (!location || !location.latitude || !location.longitude) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); param.fail(errconf); param.complete(errconf); return false } return true }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, handleData(param, data, feature) { if (feature == 'search') { var searchResult = data.data; var searchSimplify = []; for (var i = 0; i < searchResult.length; i++) { searchSimplify.push({ id: searchResult[i].id || null, title: searchResult[i].title || null, latitude: searchResult[i].location && searchResult[i].location.lat || null, longitude: searchResult[i].location && searchResult[i].location.lng || null, address: searchResult[i].address || null, category: searchResult[i].category || null, tel: searchResult[i].tel || null, adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, province: searchResult[i].ad_info && searchResult[i].ad_info.province || null }) } param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) } else if (feature == 'suggest') { var suggestResult = data.data; var suggestSimplify = []; for (var i = 0; i < suggestResult.length; i++) { suggestSimplify.push({ adcode: suggestResult[i].adcode || null, address: suggestResult[i].address || null, category: suggestResult[i].category || null, city: suggestResult[i].city || null, district: suggestResult[i].district || null, id: suggestResult[i].id || null, latitude: suggestResult[i].location && suggestResult[i].location.lat || null, longitude: suggestResult[i].location && suggestResult[i].location.lng || null, province: suggestResult[i].province || null, title: suggestResult[i].title || null, type: suggestResult[i].type || null }) } param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) } else if (feature == 'reverseGeocoder') { var reverseGeocoderResult = data.result; var reverseGeocoderSimplify = { address: reverseGeocoderResult.address || null, latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null }; if (reverseGeocoderResult.pois) { var pois = reverseGeocoderResult.pois; var poisSimplify = []; for (var i = 0; i < pois.length; i++) { poisSimplify.push({ id: pois[i].id || null, title: pois[i].title || null, latitude: pois[i].location && pois[i].location.lat || null, longitude: pois[i].location && pois[i].location.lng || null, address: pois[i].address || null, category: pois[i].category || null, adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, city: pois[i].ad_info && pois[i].ad_info.city || null, district: pois[i].ad_info && pois[i].ad_info.district || null, province: pois[i].ad_info && pois[i].ad_info.province || null }) } param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify, pois: pois, poisSimplify: poisSimplify }) } else { param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify }) } } else if (feature == 'geocoder') { var geocoderResult = data.result; var geocoderSimplify = { title: geocoderResult.title || null, latitude: geocoderResult.location && geocoderResult.location.lat || null, longitude: geocoderResult.location && geocoderResult.location.lng || null, adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, province: geocoderResult.address_components && geocoderResult.address_components.province || null, city: geocoderResult.address_components && geocoderResult.address_components.city || null, district: geocoderResult.address_components && geocoderResult.address_components.district || null, street: geocoderResult.address_components && geocoderResult.address_components.street || null, street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, level: geocoderResult.level || null }; param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) } else if (feature == 'getCityList') { var provinceResult = data.result[0]; var cityResult = data.result[1]; var districtResult = data.result[2]; param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }) } else if (feature == 'getDistrictByCityId') { var districtByCity = data.result[0]; param.success(data, districtByCity) } else if (feature == 'calculateDistance') { var calculateDistanceResult = data.result.elements; var distance = []; for (var i = 0; i < calculateDistanceResult.length; i++) { distance.push(calculateDistanceResult[i].distance) } param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) } else if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, buildWxRequestConfig(param, options, feature) { var that = this; options.header = { "content-type": "application/json" }; options.method = 'GET'; options.success = function (res) { var data = res.data; if (data.status === 0) { that.handleData(param, data, feature) } else { param.fail(data) } }; options.fail = function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; options.complete = function (res) { var statusCode = +res.statusCode; switch (statusCode) { case ERROR_CONF.WX_ERR_CODE: { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); break } case ERROR_CONF.WX_OK_CODE: { var data = res.data; if (data.status === 0) { param.complete(data) } else { param.complete(that.buildErrorConfig(data.status, data.message)) } break } default: { param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } } }; return options }, locationProcess(param, locationsuccess, locationfail, locationcomplete) { var that = this; locationfail = locationfail || function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; locationcomplete = locationcomplete || function (res) { if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) } }; if (!param.location) { that.getWXLocation(locationsuccess, locationfail, locationcomplete) } else if (that.checkLocation(param)) { var location = Utils.getLocationParam(param.location); locationsuccess(location) } } }; class QQMapWX { constructor(options) { if (!options.key) { throw Error('key值不能为空') } this.key = options.key }; search(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, orderby: options.orderby || '_distance', page_size: options.page_size || 10, page_index: options.page_index || 1, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } var distance = options.distance || "1000"; var auto_extend = options.auto_extend || 1; var region = null; var rectangle = null; if (options.region) { region = options.region } if (options.rectangle) { rectangle = options.rectangle } var locationsuccess = function (result) { if (region && !rectangle) { requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; getSuggestion(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, region: options.region || '全国', region_fix: options.region_fix || 0, policy: options.policy || 0, page_size: options.page_size || 10, page_index: options.page_index || 1, get_subpois: options.get_subpois || 0, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } if (options.location) { var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { coord_type: options.coord_type || 5, get_poi: options.get_poi || 0, output: 'json', key: that.key }; if (options.poi_options) { requestParam.poi_options = options.poi_options } var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; geocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'address')) { return } var requestParam = { address: options.address, output: 'json', key: that.key }; if (options.region) { requestParam.region = options.region } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; getDistrictByCityId(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'id')) { return } var requestParam = { id: options.id || '', output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; calculateDistance(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { mode: options.mode || 'walking', to: Utils.location2query(options.to), output: 'json', key: that.key }; if (options.from) { options.location = options.from } if (requestParam.mode == 'straight') { var locationsuccess = function (result) { var locationTo = Utils.getEndLocation(requestParam.to); var data = { message: "query ok", result: { elements: [] }, status: 0 }; for (var i = 0; i < locationTo.length; i++) { data.result.elements.push({ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), duration: 0, from: { lat: result.latitude, lng: result.longitude }, to: { lat: locationTo[i].lat, lng: locationTo[i].lng } }) } var calculateResult = data.result.elements; var distanceResult = []; for (var i = 0; i < calculateResult.length; i++) { distanceResult.push(calculateResult[i].distance) } return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }) }; Utils.locationProcess(options, locationsuccess) } else { var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX;
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
new file mode 100644
index 0000000..dbadbb8
--- /dev/null
+++ b/utils/util.js
@@ -0,0 +1,19 @@
+const formatTime = date => {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+
+const formatNumber = n => {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+}
+
+module.exports = {
+ formatTime: formatTime
+}