diff --git a/app.json b/app.json
index bb6845f..fb2085c 100644
--- a/app.json
+++ b/app.json
@@ -46,9 +46,10 @@
"pages/distribution/list",
"pages/distribution/user",
"pages/distribution/detail",
- "pages/mchList/mchList",
"pages/chooseArea/chooseArea",
- "pages/login/register"
+ "pages/login/register",
+ "pages/shop/shop",
+ "pages/store/store"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/app.wxss b/app.wxss
index 08c3bc6..5036f66 100644
--- a/app.wxss
+++ b/app.wxss
@@ -11,7 +11,7 @@ page {
display: flex;
flex-direction: column;
box-sizing: border-box;
- font-family: '微软雅黑';
+ font-family: serif;
}
.df{
display: -webkit-box;
diff --git a/pages/group_buy/payfor.wxml b/pages/group_buy/payfor.wxml
index c4fbf73..6417062 100644
--- a/pages/group_buy/payfor.wxml
+++ b/pages/group_buy/payfor.wxml
@@ -64,7 +64,7 @@
-
+
钱包余额
@@ -76,7 +76,7 @@
包邮
{{freight}}元
-
+
选择支付方式
diff --git a/pages/group_buy/payfor.wxss b/pages/group_buy/payfor.wxss
index 98579ce..659d756 100644
--- a/pages/group_buy/payfor.wxss
+++ b/pages/group_buy/payfor.wxss
@@ -70,11 +70,11 @@
margin-bottom:10px;
}
.x_right{
- width:16px;
- height: 18px;
- display:inline-block;
- vertical-align: middle;
- float: right;
+ width:16px;
+ height: 18px;
+ /* display: inline-block; */
+ /* vertical-align: middle; */
+ float: right;
}
.zhifu{
background: #fff;
@@ -133,9 +133,9 @@ height:52px;
text-align:center;
line-height:52px;
}
-.left {
+/* .left {
-}
+} */
.right {
color: #333;
diff --git a/pages/index/index.js b/pages/index/index.js
index dccaa5c..192d2dc 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -234,9 +234,9 @@ Page({
// url:"/pages/detail/detail?id="+goodsId.id
})
},
- navToMchList: function (e) {
+ navToShopList: function (e) {
wx.navigateTo({
- url:"../mchList/mchList"
+ url:"/pages/shop/shop"
})
},
onHide: function () {
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index e45e6f6..f106b49 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -154,13 +154,13 @@
优选店铺
-
+
更多
-
+
{{item.name}}
{{item.distance}}km
diff --git a/pages/mchList/mchList.json b/pages/mchList/mchList.json
deleted file mode 100644
index 6549430..0000000
--- a/pages/mchList/mchList.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "usingComponents": {},
- "navigationBarTitleText": "优选店铺",
- "navigationBarBackgroundColor": "#FA5151",
- "navigationBarTextStyle": "white"
-}
\ No newline at end of file
diff --git a/pages/mchList/mchList.wxml b/pages/mchList/mchList.wxml
deleted file mode 100644
index 7bd6f2b..0000000
--- a/pages/mchList/mchList.wxml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-pages/mchList/mchList.wxml
diff --git a/pages/mchList/mchList.wxss b/pages/mchList/mchList.wxss
deleted file mode 100644
index 75c2d95..0000000
--- a/pages/mchList/mchList.wxss
+++ /dev/null
@@ -1 +0,0 @@
-/* pages/mchList/mchList.wxss */
\ No newline at end of file
diff --git a/pages/new/new.js b/pages/new/new.js
index 5c51f85..9c95654 100644
--- a/pages/new/new.js
+++ b/pages/new/new.js
@@ -255,15 +255,6 @@ Page({
});
},
onShow: function () {
- var cont = this.data.cont;
- var that = this;
- if (cont > 1) {
- that.onLoad();
- } else {
- that.setData({
- cont: cont + 1
- })
- }
},
onLoad: function (options) {
diff --git a/pages/order/pay.js b/pages/order/pay.js
index 7c993d4..9e2b4f8 100644
--- a/pages/order/pay.js
+++ b/pages/order/pay.js
@@ -73,13 +73,13 @@ Page({
onLoad: function (options) {
console.log(app.globalData)
- console.log('options')
+ console.log(options)
var that = this;
that.get_plug();
- wx.setNavigationBarColor({
- frontColor: app.d.frontColor, //
- backgroundColor: app.d.bgcolor //设置页面参数
- })
+ // wx.setNavigationBarColor({
+ // frontColor: app.d.frontColor, //
+ // backgroundColor: app.d.bgcolor //设置页面参数
+ // })
var uid = app.globalData.userInfo.openid; // 微信id
var plug_ins = app.globalData.userInfo.plug_ins; // 插件
@@ -95,7 +95,7 @@ Page({
coupon: coupon, // 优惠券状态
wallet: wallet, // 钱包状态
});
- this.Settlement();
+ this.Settlement(options);
},
@@ -145,103 +145,73 @@ Page({
onShow: function () {
var that = this;
- console.log(that.data.dz_stu)
- if (that.data.dz_stu) {
- that.setData({
- dz_stu: false,
- });
- // util.getUesrBgplus(that, app, false)
- wx.navigateTo({
- url: '../order/pay?cartId=' + that.data.cartId,
- })
- }
+ // console.log(that.data.dz_stu)
+ // if (that.data.dz_stu) {
+ // that.setData({
+ // dz_stu: false,
+ // });
+ // // util.getUesrBgplus(that, app, false)
+ // wx.navigateTo({
+ // url: '../order/pay?cartId=' + that.data.cartId,
+ // })
+ // }
- if (that.data.pages_sx) {
- setTimeout(function () {
- that.Settlement();
- }, 500);
- }
+ // if (that.data.pages_sx) {
+ // setTimeout(function () {
+ // that.Settlement();
+ // }, 500);
+ // }
},
// 进入结算页面
- Settlement: function () {
+ Settlement: function (options) {
var that = this;
- wx.request({
- url: app.d.ceshiUrl + '&action=product&m=Settlement',
- method: 'post',
- data: {
- cart_id: that.data.cartId, // 购物车id
- uid: that.data.userId, // 微信id
- num1: that.data.num1, //数量
- type: that.data.type, //(1.直接结算 0购物车结算)
- },
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- success: function (res) {
- var status = res.data.status;
- if (status == 1) {
- if (that.data.allow) {
- res.data.arr.coupon_money = Number(res.data.arr.coupon_money) - Number(that.data.allow);
- }
- if (that.data.d_yuan) {
- res.data.arr.coupon_money = Number(res.data.arr.coupon_money) - Number(that.data.user_money);
- }
- console.log(res.data.arr);
- that.setData({
- addemt: res.data.arr.addemt, // 是否有收货地址
- address: res.data.arr.adds, // 收货地址
- addrId: res.data.arr.adds.id ? res.data.arr.adds.id : '', // 收货地址id
- productData: res.data.arr.pro, // 商品信息
- total: res.data.arr.price, // 总价
- money: res.data.arr.money, // 优惠券金额
- coupon_money: Number(parseFloat(res.data.arr.coupon_money).toFixed(3).slice(0, -1)), // 优惠后金额
- user_money: res.data.arr.user_money, // 用户余额
- coupon_id: res.data.arr.coupon_id, // 优惠券id
- discount: res.data.arr.discount, //控制优惠方式
- scorebuy: res.data.arr.scorebuy, //积分消费规则
- zhekou: res.data.arr.zhekou ? res.data.arr.zhekou : '', //会员折扣
- freight: res.data.arr.yunfei ? res.data.arr.yunfei : 0, //运费
- });
-
- that.setData({
- remind: false
- });
- } else {
- that.setData({
- remind: true
- });
- wx.showToast({
- title: res.data.err,
- icon: 'none',
- duration: 2000,
- });
- if (status == 0) {
- setTimeout(function () {
- // util.getUesrBgplus(that, app, false)
- wx.navigateBack({
- delta: 1
- })
- }, 2000);
-
- } else {
- setTimeout(function () {
- // util.getUesrBgplus(that, app, false)
- wx.navigateBack({
- delta: 1
- })
- }, 2000);
- }
+ WXAPI.settlement({
+ accessId: app.globalData.accessId,
+ storeId: 239,
+ cart_id: '',
+ coupon_id: 0,
+ vipSource: 0,
+ canshu: true,
+ product: options.product,
+ }).then(res => {
+ if (res.code == 200) {
+ //设置购物车刷新
+ app.d.purchase = 1;
+ var data = res.data;
+ if (that.data.allow) {
+ data.coupon_money = Number(data.coupon_money) - Number(that.data.allow);
}
- },
- error: function (e) {
+ if (that.data.d_yuan) {
+ data.coupon_money = Number(data.coupon_money) - Number(that.data.user_money);
+ }
+ that.setData({
+ addemt: data.addemt, // 是否有收货地址
+ address: data.address, // 收货地址
+ addrId: data.address.id ? data.address.id : '', // 收货地址id
+ productData: data.products, // 商品信息
+ total: data.total, // 总价
+ money: data.reduce_money, // 优惠券金额
+ coupon_money: Number(parseFloat(data.coupon_money).toFixed(3).slice(0, -1)), // 优惠后金额
+ user_money: data.user_money, // 用户余额
+ coupon_id: data.coupon_id, // 优惠券id
+ discount: data.discount, //控制优惠方式
+ scorebuy: data.grade_rate_amount, //积分消费规则
+ zhekou: data.preferential_amount ? data.preferential_amount : '', //会员折扣
+ freight: data.freight ? data.freight : 0, //运费
+ remind: false
+ });
+ } else {
+ that.setData({
+ remind: true
+ });
wx.showToast({
- title: '网络异常!',
- duration: 2000
+ title: res.message,
+ icon: 'none',
+ duration: 2000,
});
}
});
-
},
// 点击优惠券
tapMainMenu: function (e) { // 获取当前显示的一级菜单标识
diff --git a/pages/order/pay.wxml b/pages/order/pay.wxml
index e7a346b..64e74c0 100644
--- a/pages/order/pay.wxml
+++ b/pages/order/pay.wxml
@@ -25,8 +25,7 @@
-
diff --git a/pages/order/pay.wxss b/pages/order/pay.wxss
index edb2862..3d7d4e8 100644
--- a/pages/order/pay.wxss
+++ b/pages/order/pay.wxss
@@ -11,10 +11,15 @@ page{
background:#eee;
}
.item .cp_photo{
- width: 60px;
- height: 60px;
- overflow: hidden;
- border-radius: 3px;
+ overflow: hidden;
+ border-radius: 3px;
+ display:flex;
+ align-items:center;
+ padding-right: 20rpx;
+}
+.cp_photo image{
+ width: 70px;
+ height: 70px;
}
.wx_pay_submit{
margin-top: 10px;
@@ -83,8 +88,8 @@ page{
.x_right{
width:16px;
height: 18px;
- display:inline-block;
- vertical-align: middle;
+ /* display:inline-block;
+ vertical-align: middle; */
float: right;
}
.zhifu{
@@ -729,6 +734,25 @@ left:-13px;
.p_all {
border-bottom:1px solid #eee;
}
+.shop-view {
+ display:flex;
+ height: 60rpx;
+ align-items: center;
+}
+.shop-view image {
+ width: 40rpx;
+ height: 40rpx;
+ margin-left: 25rpx;
+}
+.shop-view text{
+ margin-left: 12rpx;
+ font-size: 28rpx;
+}
+.shop-view .jiantou-img {
+ width: 25rpx;
+ height: 25rpx;
+ margin-left: 20rpx;
+}
.drawer_screen {
width: 100%;
height: 100%;
@@ -755,28 +779,30 @@ left:-13px;
}
.sp_text{
display:flex;
- line-height: 20px;
+ line-height: 23px;
width: 100%;
text-align: left;
padding-left:8px;
}
.sp_tit{
- width: 100%;
- overflow: hidden;
- font-size: 13px;
- -webkit-line-clamp:2;
+ flex-wrap: wrap;
+ width: 100%;
+ /* overflow: hidden; */
+ font-size: 13px;
+ -webkit-line-clamp:2;
}
.sp_jg{
- width: 30%;
- overflow: hidden;
- font-size: 13px;
- color: #fc0628;
+ width: 30%;
+ overflow: hidden;
+ font-size: 13px;
+ color: #fc0628;
}
.guige{
- font-size:13px;
- color:#808080;
- text-align:right;
- padding-right:10px;
+ margin-top: 90rpx;
+ font-size:13px;
+ color:#808080;
+ text-align:right;
+ padding-right:10px;
}
diff --git a/pages/product/detail.js b/pages/product/detail.js
index dbb41f7..d334d7c 100644
--- a/pages/product/detail.js
+++ b/pages/product/detail.js
@@ -13,6 +13,7 @@ Page({
winHeight: 0,
currentTab: 0, //tab切换
productId: 0,
+ attributeId: 0,
itemData: {},
wsc: 'bxs',
sc: 'bxs',
@@ -44,29 +45,29 @@ Page({
duration: 1500,
});
- app.request.wxRequest({
- url: '&action=getcode&m=product_share',
- data: {
- product_img_path: that.data.itemData.photo_d,
- product_title: that.data.title,
- price: that.data.itemData.price_yh,
- yprice: that.data.itemData.price,
- scene: 'productId=' + that.data.productId + '&referee_openid=' + app.globalData.userInfo.user_id,
- path: 'pages/product/detail',
- id: app.globalData.userInfo.user_id,
- pid: that.data.productId,
- head: app.globalData.userInfo.avatarUrl,
- name: app.globalData.userInfo.nickName,
- type: 3
- },
- method: 'post',
- success: function (res) {
- that.setData({
- maskHidden: true,
- imagePath: res.url,
- });
- }
- })
+ // app.request.wxRequest({
+ // url: '&action=getcode&m=product_share',
+ // data: {
+ // product_img_path: that.data.itemData.photo_d,
+ // product_title: that.data.title,
+ // price: that.data.itemData.price_yh,
+ // yprice: that.data.itemData.price,
+ // scene: 'productId=' + that.data.productId + '&referee_openid=' + app.globalData.userInfo.user_id,
+ // path: 'pages/product/detail',
+ // id: app.globalData.userInfo.user_id,
+ // pid: that.data.productId,
+ // head: app.globalData.userInfo.avatarUrl,
+ // name: app.globalData.userInfo.nickName,
+ // type: 3
+ // },
+ // method: 'post',
+ // success: function (res) {
+ // that.setData({
+ // maskHidden: true,
+ // imagePath: res.url,
+ // });
+ // }
+ // })
var animation = wx.createAnimation({
duration: 200,
@@ -127,23 +128,22 @@ Page({
// 属性选择
onShow: function () {
var that = this;
-
+ that.getUserId();
},
- //接受formid
- getUserformid: function (e) {
- var formid = e.detail.formId;
- this.sendFormid(formid, 'kt1');
- this.setModalStatus(e);
- },
- //接受formid
- sendFormid: function (fromid, page) {
- var that = this
- app.request.wxRequest({
- url: '&action=draw&m=getFormid',
- data: { from_id: fromid, userid: app.globalData.userInfo.openid, page: page },
- method: 'post',
- success: function () {
-
+ getUserId() {
+ WXAPI.userIndex({
+ accessId: app.globalData.accessId,
+ storeId: 239,
+ storeType: 1,
+ mobile:'',
+ }).then(res => {
+ if (res.code == 200) {
+ var data = res.data;
+ if (!data.data) {
+ wx.removeStorageSync('accessId')
+ wx.removeStorageSync('isLogin');
+ wx.removeStorageSync('userInfo');
+ }
}
})
},
@@ -152,7 +152,7 @@ Page({
var that = this;
var choujiangid = that.data.choujiangid;
var openid = app.globalData.userInfo.openid;
- console.log(app.globalData.userInfo, 'openid')
+ // console.log(app.globalData.userInfo, 'openid')
// if (openid) {
var bgcolor = app.d.bgcolor;
// wx.setNavigationBarColor({
@@ -521,62 +521,45 @@ Page({
/* 点击确定 */
submit: function (e) {
var that = this;
- var sizeid = that.data.sizeid;
-
- if (sizeid == '' || sizeid.length < 1) {
- wx.showToast({
- title: '请完善属性',
- icon: 'loading',
- duration: 1000
- })
+ var type = e.currentTarget.dataset.type;
+ if (type == 'buynow') {
+ that.buyNow(e)
} else {
- var type = e.target.dataset.type;
- var sizeid = sizeid;
- that.addShopCart(e, sizeid)
+ that.addShopCart(e)
}
},
//购物车直接结算
- Settlement: function () {
+ settlement: function () {
console.log('-Settlement-')
wx.switchTab({
url: '../cart/cart'
})
return;
},
- addShopCart: function (e, sizeid) {
+ //加入购物车
+ addShopCart: function (e) {
//添加到购物车
var that = this;
- var pro_type = e.target.dataset.type;
- var ptype = e.currentTarget.dataset.type;
- // console.log(ptype, '--jnkmjkl')
WXAPI.productAddCart({
- uid: app.globalData.userInfo.openid,
- pid: that.data.productId,
+ accessId: app.globalData.accessId,
+ storeId: 239,
+ storeType: 1,
+ pro_id: that.data.productId,
+ attribute_id: that.data.sizeid,
num: that.data.buynum,
- sizeid: sizeid,
- pro_type: pro_type,
+ type: 'addcart',
}).then(res => {
if (res.code == 200) {
//设置购物车刷新
app.d.purchase = 1;
- var data = res.data;
- var ptype = e.currentTarget.dataset.type;
- if (ptype == 'buynow') {
- wx.redirectTo({
- url: '../order/pay?cartId=' + data.cart_id + '&pid=' + that.data.productId + '&num=' + that.data.buynum + '&type=1',
- });
- return;
- } else {
- wx.showToast({
- title: '加入购物车成功',
- icon: 'success',
- duration: 2000
- });
- // util.getUesrBgplus(that, app, true)
- that.setData({
- showModalStatus: false
- });
- }
+ wx.showToast({
+ title: '加入购物车成功',
+ icon: 'success',
+ duration: 2000
+ });
+ that.setData({
+ showModalStatus: false
+ });
} else {
wx.showToast({
icon: 'loading',
@@ -586,6 +569,26 @@ Page({
}
});
},
+ //立即购买
+ buyNow: function (e) {
+ var isLogin = wx.getStorageSync('isLogin')
+ if (!isLogin) {
+ wx.navigateTo({
+ url: '/pages/login/login'
+ })
+ }
+ //添加到购物车
+ var that = this;
+ var productArr = []
+ productArr.push({pid: that.data.productId})
+ productArr.push({cid: that.data.sizeid})
+ productArr.push({num: that.data.buynum})
+ // productArr.push({})
+ let jsonstr = JSON.stringify(productArr)
+ wx.navigateTo({
+ url: '../order/pay?product=' + jsonstr + '&cart_id=' + that.data.cart_id,
+ });
+ },
bindChange: function (e) {//滑动切换tab
var that = this;
that.setData({ currentTab: e.detail.current });
@@ -617,7 +620,6 @@ Page({
}
},
-
onShareAppMessage: function (res) {
var that = this;
var id = that.data.productId;
@@ -739,23 +741,17 @@ Page({
preventTouchMove: function (e) {
},
- add_fromid: function (e) {
- var isLogin = wx.getStorageSync('isLogin')
- if (!isLogin) {
- wx.navigateTo({
- url: '/pages/login/login'
- })
- }
-
+ showAttribute: function (e) {
+ // console.log(e)
var that = this;
- var formId = e.detail.formId;
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
});
//定义点击的类型
- var type = e.detail.target.dataset.type ? e.detail.target.dataset.type : false;
+
+ var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : false;
//控制两种不同显示方式
if (type) {
this.setData({
@@ -773,7 +769,7 @@ Page({
paytype: type,
animationData: animation.export()
})
- if (e.detail.target.dataset.status == 1) {
+ if (e.currentTarget.dataset.status == 1) {
this.setData({
showModalStatus: true
});
@@ -783,24 +779,12 @@ Page({
this.setData({
animationData: animation
})
- if (e.detail.target.dataset.status == 0) {
+ if (e.currentTarget.dataset.status == 0) {
this.setData({
showModalStatus: false
});
}
}.bind(this), 200);
- if (formId != 'the formId is a mock one') {
- var page = 'pages/product/detail'
- app.request.wxRequest({
- url: '&action=product&m=save_formid',
- data: { from_id: formId, userid: app.globalData.userInfo.openid },
- method: 'post',
- success: function (res) {
-
- }
- })
- }
-
},
// 弹窗
set_share: function (e) {
diff --git a/pages/product/detail.wxml b/pages/product/detail.wxml
index 633d965..bddc45d 100644
--- a/pages/product/detail.wxml
+++ b/pages/product/detail.wxml
@@ -26,7 +26,7 @@
-
+
{{index+1}}/{{bannerItem.length}}
@@ -90,18 +90,16 @@
-
+
@@ -159,16 +157,16 @@
-
+
-
-
-
-
+
+
+
+
@@ -190,7 +188,7 @@
-
+
@@ -292,13 +290,13 @@
单独买 ¥ {{itemData.price_yh}}
-
@@ -330,15 +328,8 @@
-
-
+
+
diff --git a/pages/product/detail.wxss b/pages/product/detail.wxss
index 5cde800..32d94f6 100644
--- a/pages/product/detail.wxss
+++ b/pages/product/detail.wxss
@@ -221,18 +221,18 @@ margin-left: 0;
}
.footfixed {
-display:block;
-position:fixed;
-bottom:0;
-left:0;
-background:#fff;
-z-index:100;
-width:100%;
-font-size:14px;
-line-height:50px;
-/*background: #dd2727;*/
-color: snow
-
+ display:block;
+ position:fixed;
+ bottom:0;
+ left:0;
+ background:#fff;
+ z-index:100;
+ width:100%;
+ font-size:14px;
+ line-height:50px;
+ /*background: #dd2727;*/
+ color: snow;
+ padding-bottom: env(safe-area-inset-bottom);
}
.footc{
display:block;
@@ -248,6 +248,8 @@ color: snow
font-weight:700;
color:snow;
text-align: center;
+ background:#FF6347;
+ padding-bottom: env(safe-area-inset-bottom);
}
.xgfootc1{
display:block;
diff --git a/pages/shop/shop.js b/pages/shop/shop.js
new file mode 100644
index 0000000..2532bc6
--- /dev/null
+++ b/pages/shop/shop.js
@@ -0,0 +1,139 @@
+// pages/shop/shop.js
+var app = getApp();
+var WXAPI = require('../../utils/server.js');
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page: 1,
+ list: [],
+ mch_arr:[], //店铺分类列表
+ mch_data:[], //店铺分类总数据
+ i_showFl:0,//选择的分类
+ latitude: 28.227965,
+ longitude: 112.951227,
+ index: 0,
+ cid: ''
+ },
+ fl_cid(e) {
+ console.log(e)
+ // 显示当前点击的分类店铺
+ var index = e.currentTarget.dataset.index
+ if(index > 0){
+ var cid = this.data.mch_data[index-1].id
+ this.setData({
+ i_showFl: index,
+ cid: cid
+ })
+ } else {
+ this.setData({
+ i_showFl: index,
+ cid: ''
+ })
+ }
+ this.getShopList();
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.getMchClass();
+ this.getShopList();
+ },
+ getMchClass() {
+ var that = this
+ WXAPI.mchClass({
+ accessId: app.globalData.accessId,
+ storeId: 239,
+ storeType: 1,
+ }).then(res => {
+ if (res.code == 200) {
+ var data = res.data
+ //分类的名称存入数组
+ var mch_arr = []
+ data.list.forEach((item,index)=>{
+ mch_arr.push(item.name)
+ })
+ //返回的分类列表
+ that.setData({
+ mch_data: data.list,
+ mch_arr: mch_arr
+ })
+ }
+ });
+ },
+ getShopList() {
+ var that = this
+ WXAPI.shopList({
+ accessId: app.globalData.accessId,
+ storeId: 239,
+ storeType: 1,
+ latitude: that.data.latitude,
+ longitude: that.data.longitude,
+ cid: that.data.cid,
+ }).then(res => {
+ if (res.code == 200) {
+ var data = res.data
+ that.setData({
+ list: data.list,
+ })
+ }
+ });
+ },
+ navToStore: function (e) {
+ var info = e.currentTarget.dataset.info
+ wx.navigateTo({
+ url: '/pagesA/store/store?shop_id=' + info.shop_id,
+ })
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/shop/shop.json b/pages/shop/shop.json
new file mode 100644
index 0000000..ca4f4f5
--- /dev/null
+++ b/pages/shop/shop.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {},
+ "navigationBarBackgroundColor": "#FA5151",
+ "navigationBarTextStyle": "white",
+ "navigationBarTitleText": "优选店铺"
+}
\ No newline at end of file
diff --git a/pages/shop/shop.wxml b/pages/shop/shop.wxml
new file mode 100644
index 0000000..8326d46
--- /dev/null
+++ b/pages/shop/shop.wxml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ 全部
+
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 已关闭
+
+
+
+ {{item.name}}
+ 进店
+
+
+
+ {{item.quantity_on_sale}}
+ 在售商品
+
+
+ {{item.quantity_sold}}
+ 已售
+
+
+ {{item.collection_num}}
+ 收藏人数
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/shop/shop.wxss b/pages/shop/shop.wxss
new file mode 100644
index 0000000..3f8782b
--- /dev/null
+++ b/pages/shop/shop.wxss
@@ -0,0 +1,118 @@
+/* pages/shop/shop.wxss */
+.container{
+ background-color: #F4F5F6;
+}
+.fenlei{
+ position: fixed;
+ z-index: 999;
+ color: white;
+ background-color: #FA5151;
+ border-radius: 0 0 24rpx 24rpx;
+ padding: 20rpx 0;
+ width: 100%;
+ overflow-x: auto;
+}
+.fenlei .fl_scroll{
+ border-right: 1px solid #A1CECE;
+}
+.fl_scroll .fl_view{
+ display: flex;
+}
+.fl_view view{
+ min-width: 80rpx;
+ height: 60rpx;
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-direction: column;
+}
+.fl_view .xian{
+ width: 80rpx;
+ height: 4rpx;
+ background: #fff;
+ border-radius: 4rpx;
+ margin-top: 8rpx;
+}
+.content{
+ padding: 10rpx 30rpx 30rpx 30rpx;
+}
+.content .list{
+ display: flex;
+ height: 168rpx;
+ background: #FFFFFF;
+ box-shadow: 0rpx 4rpx 15rpx 0rpx #E6E6E6;
+ border-radius: 6rpx;
+ padding: 24rpx;
+ box-sizing: border-box;
+ margin-bottom: 30rpx;
+}
+.list_left{
+ position: relative;
+ width: 120rpx;
+ height: 120rpx;
+ margin-right: 25rpx;
+}
+.list_left image{
+ width: 100%;
+ height: 100%;
+}
+.list_left view{
+ font-size: 24rpx;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ border-radius: 50%;
+ background-color: rgba(0,0,0,0.5);
+ color: #FFFFFF;
+}
+.list_right{
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+.list_right_top{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.list_right_top_title{
+ font-size: 30rpx;
+ color: #000000;
+}
+.list_right_top_btn{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 26rpx;
+ line-height: 40rpx;
+ width: 90rpx;
+ height: 40rpx;
+ border: 1px solid #fa5151;
+ border-radius: 30rpx;
+ color:#fa5151;
+ box-sizing: border-box;
+}
+.list_right_bottom{
+ display: flex;
+ justify-content: space-between;
+ padding-right: 30rpx;
+}
+.bottom_item{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ margin-top: 24rpx;
+}
+.bottom_item view{
+ font-size: 26rpx;
+ line-height: 22rpx;
+ color: #fa5151;
+}
+.bottom_item text{
+ font-size: 24rpx;
+ color: #888888;
+ margin-top: 14rpx;
+}
\ No newline at end of file
diff --git a/pages/mchList/mchList.js b/pages/store/store.js
similarity index 96%
rename from pages/mchList/mchList.js
rename to pages/store/store.js
index 1e62c00..81113f2 100644
--- a/pages/mchList/mchList.js
+++ b/pages/store/store.js
@@ -1,4 +1,4 @@
-// pages/mchList/mchList.js
+// pages/store/store.js
Page({
/**
diff --git a/pages/store/store.json b/pages/store/store.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/store/store.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/store/store.wxml b/pages/store/store.wxml
new file mode 100644
index 0000000..58e6066
--- /dev/null
+++ b/pages/store/store.wxml
@@ -0,0 +1,2 @@
+
+pages/store/store.wxml
diff --git a/pages/store/store.wxss b/pages/store/store.wxss
new file mode 100644
index 0000000..210a2ab
--- /dev/null
+++ b/pages/store/store.wxss
@@ -0,0 +1 @@
+/* pages/store/store.wxss */
\ No newline at end of file
diff --git a/pages/user/user.js b/pages/user/user.js
index c57da29..bdd353b 100644
--- a/pages/user/user.js
+++ b/pages/user/user.js
@@ -99,9 +99,9 @@ Page({
requestMyData: function () {
var that = this;
- WXAPI.appIndex({
+ // WXAPI.appIndex({
- })
+ // })
WXAPI.userIndex({
accessId: app.globalData.accessId,
@@ -126,6 +126,11 @@ Page({
// tjr: data.data.tjr,
// support: data.data.support
});
+ }
+ else {
+ wx.removeStorageSync('accessId')
+ wx.removeStorageSync('isLogin');
+ wx.removeStorageSync('userInfo');
}
} else {
wx.showToast({
diff --git a/utils/server.js b/utils/server.js
index e3aa9b6..eb94a99 100644
--- a/utils/server.js
+++ b/utils/server.js
@@ -56,7 +56,7 @@ Promise.prototype.finally = function(callback) {
module.exports = {
requestServer,
appIndex: (data) => { //获取用户会话密钥
- return requestServer('&action=app&m=index', 'post', data)
+ return requestServer('&action=app&app=index', 'post', data)
},
/* 首页 */
homeIndex: (data) => { //首页
@@ -77,7 +77,7 @@ module.exports = {
},
/* 购物车 */
appCart: (data) => { //
- return requestServer('&action=app&m=cart', 'post', data)
+ return requestServer('&action=app&app=cart', 'post', data)
},
cartIndex: (data) => { //购物车
return requestServer('&action=cart&app=index', 'post', data)
@@ -90,11 +90,25 @@ module.exports = {
login: (data) => { //登录
return requestServer('&action=login&app=login', 'post', data)
},
+ mchClass: (data) => { //店铺分类
+ return requestServer('&action=index&app=mchClass', 'post', data)
+ },
+ shopList: (data) => { //店铺分类
+ return requestServer('&action=index&app=recommend_stores', 'post', data)
+ },
+ settlement: (data) => { //确认订单信息
+ return requestServer('&action=order&app=Settlement', 'post', data)
+ },
+ productAddCart: (data) => { //加入购物车
+ return requestServer('&action=product&app=add_cart', 'post', data)
+ },
+
+
productSaveFormid: (data) => {
return requestServer('&action=product&m=save_formid', 'post', data)
},
userMaterial: (data) => { //
- return requestServer('&action=user&m=material', 'post', data)
+ return requestServer('&action=user&app=material', 'post', data)
},
indexGetMore: (data) => { //更多
return requestServer('&action=index&app=get_more', 'post', data)
@@ -175,10 +189,6 @@ module.exports = {
userPerfect: (data) => { //
return requestServer('&action=user&m=perfect', 'post', data)
},
-
- productAddCart: (data) => { //
- return requestServer('&action=product&m=add_cart', 'post', data)
- },
addFavoritesIndex: (data) => { //
return requestServer('&action=addFavorites&m=index', 'post', data)
},
diff --git a/wxParse/wxParse.wxml b/wxParse/wxParse.wxml
index ae9ded0..9666f56 100644
--- a/wxParse/wxParse.wxml
+++ b/wxParse/wxParse.wxml
@@ -37,7 +37,7 @@
-
+