xuhaolan 3 years ago
parent
commit
dd104bdbaa
70 changed files with 6437 additions and 2873 deletions
  1. 66 0
      api/functionalUnit.js
  2. 8 0
      api/order.js
  3. 1 0
      api/set.js
  4. 44 31
      api/user.js
  5. 8 0
      api/wallet.js
  6. 411 366
      pages.json
  7. 535 535
      pages/cart/cart.vue
  8. 91 0
      pages/index/fugou.vue
  9. 116 104
      pages/index/index.vue
  10. 3 10
      pages/money/pay.vue
  11. 4 3
      pages/money/recharge.vue
  12. 9 11
      pages/money/wallet.vue
  13. 18 18
      pages/order/createOrder.vue
  14. 13 15
      pages/order/order.vue
  15. 185 214
      pages/product/common/productBottom.vue
  16. 414 0
      pages/product/list.vue
  17. 1154 769
      pages/product/product.vue
  18. 278 0
      pages/product/reply.vue
  19. 452 0
      pages/product/search.vue
  20. 17 4
      pages/public/login.vue
  21. 121 40
      pages/public/register.vue
  22. 122 0
      pages/redirect/redirect.vue
  23. 21 18
      pages/set/userinfo.vue
  24. 1 9
      pages/story/story.vue
  25. 361 0
      pages/user/award.vue
  26. 0 261
      pages/user/balance.vue
  27. 458 0
      pages/user/extension.vue
  28. 202 144
      pages/user/integral.vue
  29. 301 248
      pages/user/jiedian.vue
  30. 269 0
      pages/user/registerList.vue
  31. 123 0
      pages/user/shareQrCode.vue
  32. 49 17
      pages/user/transfer.vue
  33. 234 20
      pages/user/user.vue
  34. 312 0
      pages/user/withdrawal.vue
  35. BIN
      static/icon/code.png
  36. BIN
      static/icon/dw.png
  37. BIN
      static/icon/i8.png
  38. BIN
      static/icon/jf.png
  39. BIN
      static/icon/jft.png
  40. BIN
      static/icon/noselect.png
  41. BIN
      static/icon/paytype.png
  42. BIN
      static/icon/phone.png
  43. BIN
      static/icon/pread.png
  44. BIN
      static/icon/psw.png
  45. BIN
      static/icon/select.png
  46. BIN
      static/image/jifen.png
  47. BIN
      static/image/sanchaji.png
  48. BIN
      static/img/img009.png
  49. BIN
      static/img/img010.png
  50. BIN
      static/img/jiedian.png
  51. BIN
      static/img/logo.png
  52. BIN
      static/img/qbbg.png
  53. BIN
      static/img/weixin.png
  54. BIN
      static/img/x.png
  55. BIN
      static/img/yong.png
  56. BIN
      static/img/yue.png
  57. BIN
      static/tabBar/dingdan.png
  58. BIN
      static/tabBar/home.png
  59. BIN
      static/tabBar/tab-cart-current.png
  60. BIN
      static/tabBar/tab-cart.png
  61. BIN
      static/tabBar/tab-cate-current.png
  62. BIN
      static/tabBar/tab-cate.png
  63. BIN
      static/tabBar/tab-home-current.png
  64. BIN
      static/tabBar/tab-home.png
  65. BIN
      static/tabBar/tab-my-current.png
  66. BIN
      static/tabBar/tab-my.png
  67. BIN
      static/tabBar/tab-store-current.png
  68. BIN
      static/tabBar/tab-store.png
  69. 35 36
      store/index.js
  70. 1 0
      utils/uni-copy.js

+ 66 - 0
api/functionalUnit.js

@@ -0,0 +1,66 @@
+import request from '@/utils/request'
+
+//获取优惠券列表
+export function getCouponsList(data,types) {
+	//优惠券状态 0全部 1未使用 2已使用
+	return request({
+		url: '/api/coupons/user/'+types,
+		method: 'get',
+		data
+	});
+}
+
+//领取优惠券
+export function setCoupons(data) {
+	return request({
+		url: '/api/coupon/receive',
+		method: 'post',
+		data
+	});
+}
+
+//获取可使用优惠券
+export function couponsOrder(data,price) {
+	return request({
+		url: '/api/coupons/order/'+price,
+		method: 'get',
+		data
+	});
+}
+
+
+//	积分列表
+export function integrallist(data) {
+	return request({
+		url: '/api/integral/list',
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取签到列表
+export function signList(data) {
+	return request({
+		url: '/api/sign/list',
+		method: 'get',
+		data
+	});
+}
+// 点击签到
+export function integral(data) {
+	return request({
+		url: '/api/sign/integral',
+		method: 'post',
+		data
+	});
+}
+
+// 签到信息
+export function signUser(data) {
+	return request({
+		url: '/api/sign/user',
+		method: 'post',
+		data
+	});
+}

+ 8 - 0
api/order.js

@@ -144,3 +144,11 @@ export function computedOrderkey(data) {
 	});
 }
 
+//复购
+export function fugou(data) {
+	return request({
+		url: '/api/rebuy',
+		method: 'post',
+		data
+	});
+}

+ 1 - 0
api/set.js

@@ -69,3 +69,4 @@ export function getAddressDetail(data,id) {
 		data
 	});
 }
+

+ 44 - 31
api/user.js

@@ -1,5 +1,7 @@
 import request from '@/utils/request'
-import { upFilse } from '@/utils/request';
+import {
+	upFilse
+} from '@/utils/request';
 
 // 订单统计信息
 export function orderData(data) {
@@ -103,10 +105,10 @@ export function delcollect(data) {
 }
 
 //上传图片
-export function upload(data){
+export function upload(data) {
 	return upFilse({
-		url:'/api/upload/image',
-		method:'post',
+		url: '/api/upload/image',
+		method: 'post',
 		data
 	})
 }
@@ -121,54 +123,65 @@ export function edit(data) {
 }
 
 // 推广的人数
-export function getSpreadPeople(data){
-	return request({
-		url:'/api/spread/people',
-		method:'post',
-		data
-	})
-}
-//我的会员
-export function getMyTvillage(data){
+export function getSpreadPeople(data) {
 	return request({
-		url:'/api/mytvillage',
-		method:'get',
+		url: '/api/spread/people',
+		method: 'post',
 		data
 	})
 }
 
 //推广佣金/提现总和 
 //3=佣金,4=提现
-export function getSpreadCount(data,type) {
+export function getSpreadCount(data, type) {
 	return request({
-		url:'/api/spread/count/'+type,
-		method:'get',
+		url: '/api/spread/count/' + type,
+		method: 'get',
 		data
 	})
 }
-//我的实体店
-export function getMyStore(data) {
+
+//接点人信息
+export function getjiedian(data, uid) {
 	return request({
-		url:'/api/mystore',
-		method:'get',
+		url: '/api/children/parent/' + uid,
+		method: 'get',
 		data
 	})
 }
 
-//申请会员 店长
-export function enter(data) {
+//佣金转账
+export function trade(data) {
+	return request({
+		url: '/api/trade',
+		method: 'post',
+		data
+	})
+}
+
+//报单列表
+export function getRegisterList(data) {
 	return request({
-		url:'/api/enter',
-		method:'post',
+		url: '/api/register/list',
+		method: 'get',
 		data
 	})
 }
-
-//编辑门店
-export function editStore(data) {
+
+//取消报单register/cancel/14
+export function cancelRegister(data,id) {
 	return request({
-		url:'/api/store_edit',
-		method:'post',
+		url: '/api/register/cancel/' + id,
+		method: 'post',
+		data
+	})
+}
+
+//支付报单register/pay/15
+export function payRegister(data,id) {
+	return request({
+		url: '/api/register/pay/' + id,
+		method: 'post',
 		data
 	})
 }

+ 8 - 0
api/wallet.js

@@ -98,5 +98,13 @@ export function balance(data) {
 	});
 }
 
+//积分明细
+export function integral(data) {
+	return request({
+		url: '/api/integral/list',
+		method: 'get',
+		data
+	});
+}
 
 

+ 411 - 366
pages.json

@@ -1,394 +1,439 @@
 {
-		"pages": [{
-				"path": "pages/index/index",
-				"style": {
-					"enablePullDownRefresh": true,
-					// #ifdef MP
-					"navigationStyle": "custom",
-					// #endif
-					// #ifndef MP
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent",
-							"searchInput": {
-								"backgroundColor": "rgba(231, 231, 231,.7)",
-								"borderRadius": "16px",
-								"placeholder": "请输入关键字",
-								"disabled": true,
-								"placeholderColor": "#606266",
-								"align": "left"
-							}
-						}
-					},
-					// #endif
-					"navigationBarTitleText": "商城首页"
-				}
-			},
-			{
-				"path": "pages/category/category",
-				"style": {
-					// #ifdef APP-PLUS
-					"navigationStyle": "custom",
-					// #endif
-					// #ifndef MP
-					"app-plus": {
-						"bounce": "none",
-						"titleNView": {
-							"searchInput": {
-								"backgroundColor": "rgba(231, 231, 231,.7)",
-								"borderRadius": "16px",
-								"placeholder": "商品搜索",
-								"disabled": true,
-								"placeholderColor": "#606266",
-								"align": "left"
-							}
-						}
-					},
-					// #endif
-					"navigationBarTitleText": "分类",
-					"navigationBarBackgroundColor": "#FFFFFF"
-				}
-			},
-			{
-				"path": "pages/product/product",
-				"style": {
-					"navigationBarTitleText": "详情展示",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
-						}
+	"pages": [{
+			"path": "pages/index/index",
+			"style": {
+				"enablePullDownRefresh": true,
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "商城首页"
+			}
+		},
+		{
+			"path": "pages/public/register",
+			"style": {
+				"navigationBarTitleText": "注册",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
 					}
 				}
-			},
-			{
-				"path": "pages/cart/cart",
-				"style": {
-					"navigationBarTitleText": "购物车",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
-
-				}
-			},
-			{
-				"path": "pages/user/user",
-				"style": {
-					"navigationBarTitleText": "个人中心",
-					"navigationStyle": "custom"
-				}
-			},
-			{
-				"path": "pages/user/accounts",
-				"style": {
-						"navigationBarTextStyle": "black",
-						"navigationBarBackgroundColor": "transparent",
-						"app-plus": {
-								"titleNView": {
-										"type": "float",
-										"titleText": "我的佣金"
-									}
-							}
+			}
+		}, {
+			"path": "pages/public/login",
+			"style": {
+				"navigationBarTitleText": "登录",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
 					}
-				},
-				{
-					"path": "pages/user/balance",
-					"style": {
-							"navigationBarTextStyle": "black",
-							"navigationBarBackgroundColor": "transparent",
-							"app-plus": {
-									"titleNView": {
-											"type": "float",
-											"titleText": "我的钱包"
-										}
-								}
-						}
-					},
-					{
-						"path": "pages/user/integral",
-						"style": {
-								"navigationBarTextStyle": "black",
-								"navigationBarBackgroundColor": "transparent",
-								"app-plus": {
-										"titleNView": {
-												"type": "float",
-												"titleText": "我的积分"
-											}
-									}
-							}
-						},
-						{
-							"path": "pages/user/extend",
-							"style": {
-									"navigationBarTextStyle": "black",
-									"navigationBarBackgroundColor": "transparent",
-									"app-plus": {
-											"titleNView": {
-													"type": "float",
-													"titleText": "我的推广"
-												}
-										}
-								}
-							},
-			{
-				"path": "pages/user/transfer",
-				"style": {
-					"navigationBarTitleText": "佣金转账",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
-			
-				}
-			},
-			{
-				"path": "pages/user/submit",
-				"style": {
-					"navigationBarTitleText": "提交成功",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
-			
-				}
-			},
-			{
-				"path": "pages/user/jiedian",
-				"style": {
-					"navigationBarTitleText": "我的接点"
-				}
-			},
-			{
-				"path": "pages/user/withdraw",
-				"style": {
-					"navigationBarTitleText": "提现",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
-			
-				}
-			},
-			{
-				"path": "pages/user/refer",
-				"style": {
-					"navigationBarTitleText": "提交申请",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
 				}
-			},
-			{
-				"path": "pages/user/shezhi",
-				"style": {
-					"navigationBarTitleText": "设置",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
-				}
-			},
-			{
-				"path": "pages/story/story",
-				"style": {
-					"navigationBarTitleText": "品牌故事",
-					"navigationBarBackgroundColor": "#fff",
-					"navigationBarTextStyle": "black"
-			
-				}
-			},
-			{
-				"path": "pages/story/storyDetail",
-				"style": {
-					// "navigationBarTitleText": "品牌故事",
-					"navigationStyle": "custom"
-				}
-			},
-			{
-				"path": "pages/order/order",
-				"style": {
-					"navigationBarTextStyle": "black",
-					"navigationBarBackgroundColor": "transparent",
-					"app-plus": {
-						"titleNView": {
-								"type": "float",
-								"titleText": "我的订单"
-							}
+			}
+		},
+		{
+			"path": "pages/public/wxLogin",
+			"style": {
+				"navigationBarTitleText": "微信登录",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
 					}
 				}
-			},
-			{
-				"path": "pages/order/expressInfo",
-				"style": {
-					"navigationBarTitleText": "快递详情"
-				}
-			},
-			{
-				"path": "pages/order/orderDetail",
-				"style": {
-					"navigationBarTitleText": "订单详情",
-					"app-plus": {
-						"bounce": "none"
+			}
+		},
+		{
+			"path": "pages/public/forget",
+			"style": {
+				"navigationBarTitleText": "忘记密码",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
 					}
 				}
-			},
-			{
-				"path": "pages/order/evaluate",
-				"style": {
-					"navigationBarTitleText": "评论"
-				}
-			},
-			{
-				"path": "pages/order/orderRefund",
-				"style": {
-					"navigationBarTitleText": "申请退款"
-				}
-			},
-			{
-				"path": "pages/order/createOrder",
-				"style": {
-					"navigationBarTitleText": "创建订单"
-				}
-			},
-			{
-				"path": "pages/set/address",
-				"style": {
-					"navigationBarTitleText": "收货地址"
-				}
-			},
-			{
-				"path": "pages/set/addressManage",
-				"style": {
-					"navigationBarTitleText": ""
-				}
-			},
-			{
-				"path": "pages/set/phone",
-				"style": {
-					"navigationBarTitleText": "实名认证"
+			}
+		},
+		{
+			"path": "pages/product/reply",
+			"style": {
+				"navigationBarTitleText": "商品评价",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
 				}
-			},
-			{
-				"path": "pages/set/password",
-				"style": {
-					"navigationBarTitleText": "修改密码"
+			}
+		},
+		{
+			"path": "pages/product/product",
+			"style": {
+				"navigationBarTitleText": "详情展示",
+				"app-plus": {
+					"titleNView": {
+						"type": "transparent"
+					}
 				}
-			},
-			{
+			}
+		},
+		{
+			"path": "pages/product/list",
+			"style": {
+				"enablePullDownRefresh": true,
+				"navigationBarTitleText": "商品列表"
+			}
+		},
+		{
+			"path": "pages/product/search",
+			"style": {
+				"enablePullDownRefresh": true,
+				// #ifdef APP-PLUS
+				"navigationStyle": "custom",
+				// #endif
+				// #ifndef MP || APP-PLUS
+				"app-plus": {
+					"titleNView": {
+						"searchInput": {
+							"backgroundColor": "rgba(231, 231, 231,.7)",
+							"borderRadius": "16px",
+							"placeholder": "请输入关键字",
+							"disabled": false,
+							"placeholderColor": "#606266",
+							"align": "left"
+						},
+						"buttons": [{
+							"text": "搜索",
+							"fontSize": "14",
+							"color": "#303133",
+							"background": "rgba(0,0,0,0)",
+							"width": "40px"
+						}]
+					}
+				},
+				// #endif
+				"navigationBarTitleText": "搜索"
+			}
+		},
+		{
+			"path": "pages/set/set",
+			"style": {
+				"navigationBarTitleText": "设置"
+			}
+		},
+		{
+			"path": "pages/set/address",
+			"style": {
+				"navigationBarTitleText": "收货地址"
+			}
+		},
+		{
+			"path": "pages/set/addressManage",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		},
+		{
+			"path": "pages/set/phone",
+			"style": {
+				"navigationBarTitleText": "实名认证"
+			}
+		},
+		{
+			"path": "pages/set/password",
+			"style": {
+				"navigationBarTitleText": "修改密码"
+			}
+		},
+		{
 				"path": "pages/set/userinfo",
 				"style": {
 					"navigationBarTitleText": "修改资料"
 				}
-			},
-			{
-				"path": "pages/money/pay",
-				"style": {
-					"navigationBarTitleText": "支付"
-				}
-			},
-			{
-				"path": "pages/money/paySuccess",
-				"style": {
-					"navigationBarTitleText": "支付成功"
-				}
-			},
-			{
-				"path": "pages/money/wallet",
-				"style": {
-					"navigationBarTitleText": "我的钱包",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
-						}
+		},
+		{
+			"path": "pages/cart/cart",
+			"style": {
+				"navigationBarTitleText": "购物车"
+			}
+		},
+
+		{
+			"path": "pages/user/user",
+			"style": {
+				// #ifndef MP-WEIXIN
+				"navigationStyle": "custom",
+				// #endif
+				"navigationBarTitleText": "个人中心"
+			}
+		},
+		{
+			"path": "pages/user/award",
+			"style": {
+				"navigationBarTitleText": "奖励明细",
+				"navigationBarBackgroundColor":"#D7EEB6",
+				"navigationBarTextStyle":"black"
+			}
+		},
+		{
+			"path": "pages/user/withdrawal",
+			"style": {
+				"navigationBarTitleText": "奖励提现"
+			}
+		},
+		// {
+		// 	"path": "pages/user/notice",
+		// 	"style": {
+		// 		"navigationBarTitleText": "通知"
+		// 	}
+		// },
+		// {
+		// 	"path": "pages/user/scoreAccumulate",
+		// 	"style": {
+		// 		"navigationBarTitleText": "积分明细"
+		// 	}
+		// },
+		{
+			"path": "pages/user/extension",
+			"style": {
+				"navigationBarTextStyle": "black",
+				"navigationBarBackgroundColor": "transparent",
+				"app-plus": {
+					"titleNView": {
+						"type": "float",
+						"titleText": "我的推广"
 					}
 				}
-			},
-			{
-				"path": "pages/money/account",
-				"style": {
-					"navigationBarTitleText": "提现账号"
-				}
-			},
-			{
-				"path": "pages/money/withdrawal",
-				"style": {
-					"navigationBarTitleText": "提现"
-				}
-			},
-			{
-				"path": "pages/money/recharge",
-				"style": {
-					"navigationBarTitleText": "充值"
+			}
+		},
+		// {
+		// 	"path": "pages/user/applyMember",
+		// 	"style": {
+		// 		"navigationStyle": "custom",
+		// 		"navigationBarTitleText": "申请会员"
+		// 	}
+		// },
+		// {
+		// 	"path": "pages/user/minMember",
+		// 	"style": {
+		// 		"navigationStyle": "custom",
+		// 		"navigationBarTitleText": "我的会员"
+		// 	}
+		// },
+		{
+			"path": "pages/order/order",
+			"style": {
+				"navigationBarTitleText": "我的订单",
+				"app-plus": {
+					"bounce": "none"
 				}
-			},
-			{
-				"path": "pages/public/register",
-				"style": {
-					"navigationBarTitleText": "注册",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
-						}
-					}
+			}
+		},
+		{
+			"path": "pages/order/expressInfo",
+			"style": {
+				"navigationBarTitleText": "快递详情"
+			}
+		},
+		{
+			"path": "pages/order/orderDetail",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"app-plus": {
+					"bounce": "none"
 				}
-			}, {
-				"path": "pages/public/login",
-				"style": {
-					"navigationBarTitleText": "登录",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
+			}
+		},
+		{
+			"path": "pages/order/evaluate",
+			"style": {
+				"navigationBarTitleText": "评论"
+			}
+		},
+		{
+			"path": "pages/order/orderRefund",
+			"style": {
+				"navigationBarTitleText": "申请退款"
+			}
+		},
+		{
+			"path": "pages/order/createOrder",
+			"style": {
+				"navigationBarTitleText": "创建订单"
+			}
+		},
+		{
+			"path": "pages/index/fugou",
+			"style": {
+				"navigationBarTitleText": "复购"
+			}
+		},
+		{
+			"path": "pages/money/pay",
+			"style": {
+				"navigationBarTitleText": "支付"
+			}
+		},
+		{
+			"path": "pages/money/paySuccess",
+			"style": {
+				"navigationBarTitleText": "支付成功"
+			}
+		},
+		{
+			"path": "pages/money/wallet",
+			"style": {
+				"navigationBarTitleText": "我的钱包",
+				"navigationBarBackgroundColor":"#D7EEB6",
+				"navigationBarTextStyle":"black"
+				
+			}
+		},
+		{
+			"path": "pages/money/account",
+			"style": {
+				"navigationBarTitleText": "提现账号"
+			}
+		},
+		{
+			"path": "pages/money/withdrawal",
+			"style": {
+				"navigationBarTitleText": "提现"
+			}
+		},
+		{
+			"path": "pages/money/recharge",
+			"style": {
+				"navigationBarTitleText": "充值"
+			}
+		},
+		{
+			"path": "pages/category/category",
+			"style": {
+				// #ifdef APP-PLUS
+				"navigationStyle": "custom",
+				// #endif
+				// #ifndef MP
+				"app-plus": {
+					"bounce": "none",
+					"titleNView": {
+						"searchInput": {
+							"backgroundColor": "rgba(231, 231, 231,.7)",
+							"borderRadius": "16px",
+							"placeholder": "输入关键词搜索",
+							"disabled": true,
+							"placeholderColor": "#606266",
+							"align": "left"
 						}
 					}
+				},
+				// #endif
+				"navigationBarTitleText": "分类"
+			}
+		},
+		{
+			"path": "pages/redirect/redirect",
+			"style": {
+				"navigationBarTitleText": "微信登录跳转页面",
+				"app-plus": {
+					"titleNView": false
 				}
-			},
-			{
-				"path": "pages/public/wxLogin",
-				"style": {
-					"navigationBarTitleText": "微信登录",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
-						}
+			}
+		},
+		{
+			"path": "pages/user/shareQrCode",
+			"style": {
+				"navigationBarTitleText": "邀请好友"
+			}
+		},
+		{
+			"path": "pages/story/story",
+			"style": {
+				"navigationBarTitleText": "品牌故事"
+			}
+		},
+		{
+			"path": "pages/story/storyDetail",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/user/jiedian",
+			"style": {
+				"navigationBarBackgroundColor": "transparent",
+				"app-plus": {
+					"titleNView": {
+						"type": "float",
+						"titleText": "我的接点"
 					}
 				}
-			},
-			{
-				"path": "pages/public/forget",
-				"style": {
-					"navigationBarTitleText": "忘记密码",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
-						}
+			}
+		},
+		{
+			"path": "pages/user/integral",
+			"style": {
+				"navigationBarTextStyle": "black",
+				"navigationBarBackgroundColor": "transparent",
+				"app-plus": {
+					"titleNView": {
+						"type": "float",
+						"titleText": "我的积分"
 					}
 				}
 			}
-		],
-		"tabBar": {
-			"color": "#C0C4CC",
-			"selectedColor": "#3F7C1F",
-			"borderStyle": "black",
-			"backgroundColor": "#ffffff",
-			"list": [{
-					"pagePath": "pages/index/index",
-					"iconPath": "static/tabBar/tab-home.png",
-					"selectedIconPath": "static/tabBar/tab-home-current.png",
-					"text": "首页"
-				},
-				{
-					"pagePath": "pages/category/category",
-					"iconPath": "static/tabBar/tab-cate.png",
-					"selectedIconPath": "static/tabBar/tab-cate-current.png",
-					"text": "分类"
-				},
-				{
-					"pagePath": "pages/story/story",
-					"iconPath": "static/tabBar/tab-cart.png",
-					"selectedIconPath": "static/tabBar/tab-cart-current.png",
-					"text": "品牌故事"
-				},
-				{
-					"pagePath": "pages/cart/cart",
-					"iconPath": "static/tabBar/tab-cart.png",
-					"selectedIconPath": "static/tabBar/tab-cart-current.png",
-					"text": "购物车"
-				},
-				{
-					"pagePath": "pages/user/user",
-					"iconPath": "static/tabBar/tab-my.png",
-					"selectedIconPath": "static/tabBar/tab-my-current.png",
-					"text": "我的"
-				}
-			]
+		},
+		{
+			"path": "pages/user/transfer",
+			"style": {
+				"navigationBarTitleText": "佣金转账"
+				
+			}
+		},
+		{
+			"path": "pages/user/registerList",
+			"style": {
+				"navigationBarTitleText": "报单列表"
+				
+			}
 		}
-		}
+	],
+	"globalStyle": {
+		"navigationBarTextStyle": "black",
+		"navigationBarTitleText": "uni-app",
+		"navigationBarBackgroundColor": "#FFFFFF",
+		"backgroundColor": "#f8f8f8"
+	},
+	"tabBar": {
+		"color": "#C0C4CC",
+		"selectedColor": "#3F7C1F",
+		"borderStyle": "black",
+		"backgroundColor": "#ffffff",
+		"list": [{
+				"pagePath": "pages/index/index",
+				"iconPath": "static/tabBar/tab-home.png",
+				"selectedIconPath": "static/tabBar/tab-home-current.png",
+				"text": "首页"
+			},
+			{
+				"pagePath": "pages/category/category",
+				"iconPath": "static/tabBar/tab-cate.png",
+				"selectedIconPath": "static/tabBar/tab-cate-current.png",
+				"text": "分类"
+			},
+			{
+				"pagePath": "pages/story/story",
+				"iconPath": "static/tabBar/tab-store.png",
+				"selectedIconPath": "static/tabBar/tab-store-current.png",
+				"text": "品牌故事"
+			},
+			{
+				"pagePath": "pages/cart/cart",
+				"iconPath": "static/tabBar/tab-cart.png",
+				"selectedIconPath": "static/tabBar/tab-cart-current.png",
+				"text": "购物车"
+			},
+			{
+				"pagePath": "pages/user/user",
+				"iconPath": "static/tabBar/tab-my.png",
+				"selectedIconPath": "static/tabBar/tab-my-current.png",
+				"text": "我的"
+			}
+		]
+	}
+}

+ 535 - 535
pages/cart/cart.vue

@@ -1,535 +1,535 @@
-<template>
-	<view class="container">
-		<!-- 空白页 -->
-		<view v-if="!hasLogin || empty === true" class="empty">
-			<image src="/static/error/emptyCart.png" class="emptyImg" mode="aspectFit"></image>
-			<view v-if="hasLogin" class="empty-tips">
-				空空如也
-				<navigator class="navigator" v-if="hasLogin" url="../index/index" open-type="switchTab">随便逛逛></navigator>
-			</view>
-			<view v-else class="empty-tips">
-				空空如也
-				<view class="navigator" @click="navToLogin">去登陆></view>
-			</view>
-		</view>
-		<view v-else>
-			<!-- 购物车头部 -->
-			<view class="cart-hand flex">
-				<view class="hand-tit">
-					购物车共 <text>{{ ' '+cartList.length}} 件</text>商品
-				</view>
-				<view class="hand-btn" @click="clearCart()">
-					清空购物车
-				</view>
-			</view>
-			<!-- 列表 -->
-			<view class="cart-list">
-				<block v-for="(item, index) in cartList" :key="item.id">
-					<view class="cart-item" :class="{ 'b-b': index !== cartList.length - 1 }">
-						<view class="image-wrapper">
-							<image
-								:src="item.productInfo.image"
-								:class="[item.loaded]"
-								mode="aspectFill"
-								lazy-load
-								@load="onImageLoad('cartList', index)"
-								@error="onImageError('cartList', index)"
-							></image>
-							<view class="iconfont iconroundcheckfill checkbox" :class="{ checked: item.checked }" @click="check('item', index)"></view>
-						</view>
-						<view class="item-right">
-							<text class="clamp title">{{ item.productInfo.store_name }}</text>
-							<text class="attr">{{ item.productInfo.attrInfo.suk }}</text>
-							<text class="price">¥{{ item.productInfo.price }}</text>
-							<view class="munbox flex" >
-								<image src="../../static/img/reduce.png" mode="" @click="reduce(item,index)"></image>
-								<input type="number" :value="item.cart_num" disabled/>
-								<image src="../../static/img/add.png" mode="" @click="add(item)"></image>
-							</view>
-						</view>
-					</view>
-				</block>
-			</view>
-			<!-- 底部菜单栏 -->
-			<view class="action-section">
-				<view class="checkbox">
-					<view class="iconfont iconroundcheckfill icon-checked-box" @click="check('all')" :class="{ 'icon-checked': allChecked }"></view>
-				</view>
-				<view class="total-box">
-					<text class="price">¥{{ total }}</text>
-					
-				</view>
-				<button type="primary" class="no-border confirm-btn" @click="createOrder">去结算</button>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-// import { getCartList, getCartNum, cartDel } from '@/api/user.js';
-import { mapState } from 'vuex';
-import uniNumberBox from '@/components/uni-number-box.vue';
-import { saveUrl, interceptor } from '@/utils/loginUtils.js';
-export default {
-	components: {
-		uniNumberBox
-	},
-	data() {
-		return {
-			total: 0, //总价格
-			allChecked: false, //全选状态  true|false
-			empty: false, //空白页现实  true|false
-			cartList: []
-		};
-	},
-	onShow() {
-		// 只有登录时才加载数据
-		if (this.hasLogin) {
-			this.loadData();
-		}
-	},
-	watch: {
-		//显示空白页
-		cartList(e) {
-			let empty = e.length === 0 ? true : false;
-			if (this.empty !== empty) {
-				this.empty = empty;
-			}
-		}
-	},
-	computed: {
-		...mapState('user', ['hasLogin'])
-	},
-	methods: {
-		reduce(item,index) {
-			if(item.cart_num == 1) {
-				uni.showModal({
-					content: '删除该商品?',
-					success: e => {
-						if (e.confirm) {
-							this.deleteCartItem(index)
-						}
-					}
-				});
-				
-			}else {
-				item.cart_num--
-				this.newNumberChange(item)
-			}
-		},
-		add(item) {
-			console.log(item)
-			if(item.productInfo.stock > item.cart_num) {
-				item.cart_num++
-				this.newNumberChange(item)
-			}else {
-				return 
-			}
-		},
-		//请求数据
-		async loadData() {
-			let obj = this;
-			getCartList({})
-				.then(function(e) {
-					// 获取当前购物车物品增加数量
-					let nub = obj.cartList.length;
-					// 获取之前对象数组
-					let aArray = obj.cartList.reverse();
-					// 获取返回数据对象数组
-					let bArray = e.data.valid.reverse();
-					obj.cartList = bArray
-						.map((item, ind) => {
-							// 设置返回数据默认为勾选状态
-							item.checked = true;
-							// 获取相同数组之前对象的数据
-							let carlist = aArray[ind];
-							// 判断之前是否已经加载完毕
-							if (carlist && carlist.loaded == 'loaded') {
-								item.loaded = 'loaded';
-							}
-							return item;
-						})
-						.reverse();
-					obj.calcTotal(); //计算总价
-				})
-				.catch(function(e) {
-					console.log(e);
-				});
-		},
-		//监听image加载完成
-		onImageLoad(key, index) {
-			// 修改载入完成后图片class样式
-			this.$set(this[key][index], 'loaded', 'loaded');
-		},
-		//监听image加载失败
-		onImageError(key, index) {
-			this[key][index].image = '/static/error/errorImage.jpg';
-		},
-		// 跳转到登录页
-		navToLogin() {
-			// 保存地址
-			saveUrl();
-			// 登录拦截
-			interceptor();
-		},
-		//选中状态处理
-		check(type, index) {
-			if (type === 'item') {
-				this.cartList[index].checked = !this.cartList[index].checked;
-			} else {
-				const checked = !this.allChecked;
-				const list = this.cartList;
-				list.forEach(item => {
-					item.checked = checked;
-				});
-				this.allChecked = checked;
-			}
-			this.calcTotal(type);
-		},
-		//数量
-		numberChange(data) {
-			let arr = this.cartList[data.index];
-			arr.cart_num = data.number;
-			getCartNum({ id: arr.id, number: data.number })
-				.then(e => {
-					console.log(e);
-				})
-				.catch(function(e) {
-					console.log(e);
-				});
-			this.calcTotal();
-		},
-		newNumberChange(item) {
-			getCartNum({ id: item.id, number: item.cart_num })
-				.then(e => {
-					console.log(e);
-				})
-				.catch(function(e) {
-					console.log(e);
-				});
-			this.calcTotal();
-		},
-		//删除
-		deleteCartItem(index) {
-			let list = this.cartList;
-			let row = list[index];
-			let id = row.id;
-			cartDel({
-				ids: id
-			});
-			this.cartList.splice(index, 1);
-			uni.hideLoading();
-			this.calcTotal();
-		},
-		//清空
-		clearCart() {
-			uni.showModal({
-				content: '清空购物车?',
-				success: e => {
-					if (e.confirm) {
-						let st = this.cartList.map(e => {
-							return e.id;
-						});
-						cartDel({
-							ids: st.join(',')
-						}).then(e => {
-							console.log(e);
-						});
-						this.cartList = [];
-					}
-				}
-			});
-		},
-		//计算总价
-		calcTotal() {
-			let list = this.cartList;
-			if (list.length === 0) {
-				this.empty = true;
-				return;
-			}
-			let total = 0;
-			let checked = true;
-			list.forEach(item => {
-				if (item.checked === true) {
-					total += item.productInfo.price * item.cart_num;
-				} else if (checked === true) {
-					checked = false;
-				}
-			});
-			this.allChecked = checked;
-			this.total = Number(total.toFixed(2));
-		},
-		//创建订单
-		createOrder() {
-			let list = this.cartList;
-			let goodsData = [];
-			list.forEach(item => {
-				if (item.checked) {
-					goodsData.push(item.id);
-				}
-			});
-
-			uni.navigateTo({
-				url: '/pages/order/createOrder?id=' + goodsData.join(',')
-			});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-.container {
-	padding-bottom: 134rpx;
-	background-color: $page-color-base;
-	/* 空白页 */
-	.empty {
-		position: fixed;
-		left: 0;
-		top: 0;
-		width: 100%;
-		height: 100vh;
-		padding-bottom: 100rpx;
-		display: flex;
-		justify-content: center;
-		flex-direction: column;
-		align-items: center;
-		background: #fff;
-		.emptyImg {
-			width: 300rpx;
-			height: 250rpx;
-			margin-bottom: 30rpx;
-		}
-		.empty-tips {
-			display: flex;
-			font-size: $font-sm + 2rpx;
-			color: $font-color-disabled;
-			.navigator {
-				color: $uni-color-primary;
-				margin-left: 16rpx;
-			}
-		}
-	}
-}
-/* 购物车列表项 */
-.cart-item {
-	width: 710rpx;
-	height: 210rpx;
-	background: #FFFFFF;
-	box-shadow: 0px 0px 10rpx 0rpx rgba(0, 0, 0, 0.1);
-	border-radius: 10rpx;
-	margin: 20rpx auto;
-	
-	display: flex;
-	position: relative;
-	padding: 30rpx 26rpx 30rpx 80rpx;
-	.image-wrapper {
-		width: 150rpx;
-		height: 150rpx;
-		flex-shrink: 0;
-		position: relative;
-		image {
-			border-radius: 8rpx;
-		}
-	}
-	.checkbox {
-		position: absolute;
-		top: 0;
-		bottom: 0;
-		left: -65rpx;
-		margin: auto 0;
-		height: 50rpx;
-		z-index: 8;
-		font-size: 44rpx;
-		line-height: 1;
-		padding: 4rpx;
-		color: $font-color-disabled;
-		background: #fff;
-		border-radius: 50px;
-	}
-	.item-right {
-		display: flex;
-		flex-direction: column;
-		flex: 1;
-		overflow: hidden;
-		position: relative;
-		padding-left: 30rpx;
-		.munbox {
-			width: 144rpx;
-			height: 44rpx;
-			position: absolute;
-			bottom: 0;
-			right: 0;
-			input {
-				display: inline-block;
-				text-align: center;
-			}
-			image {
-				flex-shrink: 0;
-				width: 44rpx;
-				height: 44rpx;
-			}
-		}
-		.title,
-		.price {
-			font-size: $font-base + 2rpx;
-			color: $font-color-dark;
-			height: 40rpx;
-			line-height: 40rpx;
-		}
-		.attr {
-			font-size: $font-sm + 2rpx;
-			color: $font-color-light;
-			height: 50rpx;
-			line-height: 50rpx;
-			
-			font-size: 26rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #999999;
-		}
-		.price {
-			// height: 50rpx;
-			// line-height: 50rpx;
-			padding-top: 20rpx;
-			font-size: 34rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #FF4C4C;
-		}
-		.step {
-			margin-top: 20rpx;
-		}
-		.title {
-			font-size: 34rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-		}
-	}
-	.del-btn {
-		padding: 4rpx 10rpx;
-		font-size: 34rpx;
-		height: 50rpx;
-		color: $font-color-light;
-	}
-}
-/* 底部栏 */
-.action-section {
-	/* #ifdef H5 */
-	margin-bottom: 100rpx;
-	/* #endif */
-	position: fixed;
-	left: 30rpx;
-	bottom: 30rpx;
-	z-index: 95;
-	display: flex;
-	align-items: center;
-	width: 690rpx;
-	height: 100rpx;
-	padding: 0 30rpx;
-	background: rgba(255, 255, 255, 0.9);
-	box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
-	border-radius: 16rpx;
-	.checkbox {
-		height: 52rpx;
-		position: relative;
-		.icon-checked-box {
-			border-radius: 50rpx;
-			background-color: #ffffff;
-			width: 52rpx;
-			height: 100%;
-			position: relative;
-			z-index: 5;
-			font-size: 53rpx;
-			line-height: 1;
-			color: $font-color-light;
-		}
-		.icon-checked {
-			color: $base-color;
-		}
-	}
-	.clear-btn {
-		position: absolute;
-		left: 26rpx;
-		top: 0;
-		z-index: 4;
-		width: 0;
-		height: 52rpx;
-		line-height: 52rpx;
-		padding-left: 38rpx;
-		font-size: $font-base;
-		color: #fff;
-		background: $font-color-disabled;
-		border-radius: 0 50px 50px 0;
-		opacity: 0;
-		transition: 0.2s;
-		&.show {
-			opacity: 1;
-			width: 120rpx;
-		}
-	}
-	.total-box {
-		flex: 1;
-		display: flex;
-		flex-direction: column;
-		text-align: right;
-		padding-right: 40rpx;
-		
-		.price {
-			font-size: $font-lg;
-			color: $font-color-dark;
-		}
-		.coupon {
-			font-size: $font-sm;
-			color: $font-color-light;
-			text {
-				color: $font-color-dark;
-			}
-		}
-	}
-	.confirm-btn {
-		padding: 0 38rpx;
-		margin: 0;
-		border-radius: 100px;
-		height: 76rpx;
-		line-height: 76rpx;
-		font-size: $font-base + 2rpx;
-		background: $base-color;
-	}
-}
-/* 复选框选中状态 */
-.action-section .checkbox.checked,
-.cart-item .checkbox.checked {
-	color: $base-color;
-}
-.cart-hand {
-	width: 750rpx;
-	height: 88rpx;
-	background: #FFFFFF;
-	font-size: 30rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #333333;
-	line-height: 88rpx;
-	padding-left: 28rpx;
-	padding-right: 26rpx;
-	.hand-tit {
-		text {
-			color: #FF4C4C;
-		}
-	
-	}
-	.hand-btn {
-		width: 164rpx;
-		height: 62rpx;
-		border: 2rpx solid #FF4C4C;
-		border-radius: 31rpx;
-		font-size: 26rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #FF4C4C;
-		line-height: 62rpx;
-		text-align: center;
-	}
-}
-</style>
+<template>
+	<view class="container">
+		<!-- 空白页 -->
+		<view v-if="!hasLogin || empty === true" class="empty">
+			<image src="/static/error/emptyCart.png" class="emptyImg" mode="aspectFit"></image>
+			<view v-if="hasLogin" class="empty-tips">
+				空空如也
+				<navigator class="navigator" v-if="hasLogin" url="../index/index" open-type="switchTab">随便逛逛></navigator>
+			</view>
+			<view v-else class="empty-tips">
+				空空如也
+				<view class="navigator" @click="navToLogin">去登陆></view>
+			</view>
+		</view>
+		<view v-else>
+			<!-- 购物车头部 -->
+			<view class="cart-hand flex">
+				<view class="hand-tit">
+					购物车共 <text>{{ ' '+cartList.length}} 件</text>商品
+				</view>
+				<view class="hand-btn" @click="clearCart()">
+					清空购物车
+				</view>
+			</view>
+			<!-- 列表 -->
+			<view class="cart-list">
+				<block v-for="(item, index) in cartList" :key="item.id">
+					<view class="cart-item" :class="{ 'b-b': index !== cartList.length - 1 }">
+						<view class="image-wrapper">
+							<image
+								:src="item.productInfo.image"
+								:class="[item.loaded]"
+								mode="aspectFill"
+								lazy-load
+								@load="onImageLoad('cartList', index)"
+								@error="onImageError('cartList', index)"
+							></image>
+							<view class="iconfont iconroundcheckfill checkbox" :class="{ checked: item.checked }" @click="check('item', index)"></view>
+						</view>
+						<view class="item-right">
+							<text class="clamp title">{{ item.productInfo.store_name }}</text>
+							<text class="attr">{{ item.productInfo.attrInfo.suk }}</text>
+							<text class="price">¥{{ item.productInfo.price }}</text>
+							<view class="munbox flex" >
+								<image src="../../static/img/reduce.png" mode="" @click="reduce(item,index)"></image>
+								<input type="number" :value="item.cart_num" disabled/>
+								<image src="../../static/img/add.png" mode="" @click="add(item)"></image>
+							</view>
+						</view>
+					</view>
+				</block>
+			</view>
+			<!-- 底部菜单栏 -->
+			<view class="action-section">
+				<view class="checkbox">
+					<view class="iconfont iconroundcheckfill icon-checked-box" @click="check('all')" :class="{ 'icon-checked': allChecked }"></view>
+				</view>
+				<view class="total-box">
+					<text class="price">¥{{ total }}</text>
+					
+				</view>
+				<button type="primary" class="no-border confirm-btn" @click="createOrder">去结算</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import { getCartList, getCartNum, cartDel } from '@/api/user.js';
+import { mapState } from 'vuex';
+import uniNumberBox from '@/components/uni-number-box.vue';
+import { saveUrl, interceptor } from '@/utils/loginUtils.js';
+export default {
+	components: {
+		uniNumberBox
+	},
+	data() {
+		return {
+			total: 0, //总价格
+			allChecked: false, //全选状态  true|false
+			empty: false, //空白页现实  true|false
+			cartList: []
+		};
+	},
+	onShow() {
+		// 只有登录时才加载数据
+		if (this.hasLogin) {
+			this.loadData();
+		}
+	},
+	watch: {
+		//显示空白页
+		cartList(e) {
+			let empty = e.length === 0 ? true : false;
+			if (this.empty !== empty) {
+				this.empty = empty;
+			}
+		}
+	},
+	computed: {
+		...mapState('user', ['hasLogin'])
+	},
+	methods: {
+		reduce(item,index) {
+			if(item.cart_num == 1) {
+				uni.showModal({
+					content: '删除该商品?',
+					success: e => {
+						if (e.confirm) {
+							this.deleteCartItem(index)
+						}
+					}
+				});
+				
+			}else {
+				item.cart_num--
+				this.newNumberChange(item)
+			}
+		},
+		add(item) {
+			console.log(item)
+			if(item.productInfo.stock > item.cart_num) {
+				item.cart_num++
+				this.newNumberChange(item)
+			}else {
+				return 
+			}
+		},
+		//请求数据
+		async loadData() {
+			let obj = this;
+			getCartList({})
+				.then(function(e) {
+					// 获取当前购物车物品增加数量
+					let nub = obj.cartList.length;
+					// 获取之前对象数组
+					let aArray = obj.cartList.reverse();
+					// 获取返回数据对象数组
+					let bArray = e.data.valid.reverse();
+					obj.cartList = bArray
+						.map((item, ind) => {
+							// 设置返回数据默认为勾选状态
+							item.checked = true;
+							// 获取相同数组之前对象的数据
+							let carlist = aArray[ind];
+							// 判断之前是否已经加载完毕
+							if (carlist && carlist.loaded == 'loaded') {
+								item.loaded = 'loaded';
+							}
+							return item;
+						})
+						.reverse();
+					obj.calcTotal(); //计算总价
+				})
+				.catch(function(e) {
+					console.log(e);
+				});
+		},
+		//监听image加载完成
+		onImageLoad(key, index) {
+			// 修改载入完成后图片class样式
+			this.$set(this[key][index], 'loaded', 'loaded');
+		},
+		//监听image加载失败
+		onImageError(key, index) {
+			this[key][index].image = '/static/error/errorImage.jpg';
+		},
+		// 跳转到登录页
+		navToLogin() {
+			// 保存地址
+			saveUrl();
+			// 登录拦截
+			interceptor();
+		},
+		//选中状态处理
+		check(type, index) {
+			if (type === 'item') {
+				this.cartList[index].checked = !this.cartList[index].checked;
+			} else {
+				const checked = !this.allChecked;
+				const list = this.cartList;
+				list.forEach(item => {
+					item.checked = checked;
+				});
+				this.allChecked = checked;
+			}
+			this.calcTotal(type);
+		},
+		//数量
+		numberChange(data) {
+			let arr = this.cartList[data.index];
+			arr.cart_num = data.number;
+			getCartNum({ id: arr.id, number: data.number })
+				.then(e => {
+					console.log(e);
+				})
+				.catch(function(e) {
+					console.log(e);
+				});
+			this.calcTotal();
+		},
+		newNumberChange(item) {
+			getCartNum({ id: item.id, number: item.cart_num })
+				.then(e => {
+					console.log(e);
+				})
+				.catch(function(e) {
+					console.log(e);
+				});
+			this.calcTotal();
+		},
+		//删除
+		deleteCartItem(index) {
+			let list = this.cartList;
+			let row = list[index];
+			let id = row.id;
+			cartDel({
+				ids: id
+			});
+			this.cartList.splice(index, 1);
+			uni.hideLoading();
+			this.calcTotal();
+		},
+		//清空
+		clearCart() {
+			uni.showModal({
+				content: '清空购物车?',
+				success: e => {
+					if (e.confirm) {
+						let st = this.cartList.map(e => {
+							return e.id;
+						});
+						cartDel({
+							ids: st.join(',')
+						}).then(e => {
+							console.log(e);
+						});
+						this.cartList = [];
+					}
+				}
+			});
+		},
+		//计算总价
+		calcTotal() {
+			let list = this.cartList;
+			if (list.length === 0) {
+				this.empty = true;
+				return;
+			}
+			let total = 0;
+			let checked = true;
+			list.forEach(item => {
+				if (item.checked === true) {
+					total += item.productInfo.price * item.cart_num;
+				} else if (checked === true) {
+					checked = false;
+				}
+			});
+			this.allChecked = checked;
+			this.total = Number(total.toFixed(2));
+		},
+		//创建订单
+		createOrder() {
+			let list = this.cartList;
+			let goodsData = [];
+			list.forEach(item => {
+				if (item.checked) {
+					goodsData.push(item.id);
+				}
+			});
+
+			uni.navigateTo({
+				url: '/pages/order/createOrder?id=' + goodsData.join(',')
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.container {
+	padding-bottom: 134rpx;
+	background-color: $page-color-base;
+	/* 空白页 */
+	.empty {
+		position: fixed;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100vh;
+		padding-bottom: 100rpx;
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+		background: #fff;
+		.emptyImg {
+			width: 300rpx;
+			height: 250rpx;
+			margin-bottom: 30rpx;
+		}
+		.empty-tips {
+			display: flex;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-disabled;
+			.navigator {
+				color: $uni-color-primary;
+				margin-left: 16rpx;
+			}
+		}
+	}
+}
+/* 购物车列表项 */
+.cart-item {
+	width: 710rpx;
+	height: 210rpx;
+	background: #FFFFFF;
+	box-shadow: 0px 0px 10rpx 0rpx rgba(0, 0, 0, 0.1);
+	border-radius: 10rpx;
+	margin: 20rpx auto;
+	
+	display: flex;
+	position: relative;
+	padding: 30rpx 26rpx 30rpx 80rpx;
+	.image-wrapper {
+		width: 150rpx;
+		height: 150rpx;
+		flex-shrink: 0;
+		position: relative;
+		image {
+			border-radius: 8rpx;
+		}
+	}
+	.checkbox {
+		position: absolute;
+		top: 0;
+		bottom: 0;
+		left: -65rpx;
+		margin: auto 0;
+		height: 50rpx;
+		z-index: 8;
+		font-size: 44rpx;
+		line-height: 1;
+		padding: 4rpx;
+		color: $font-color-disabled;
+		background: #fff;
+		border-radius: 50px;
+	}
+	.item-right {
+		display: flex;
+		flex-direction: column;
+		flex: 1;
+		overflow: hidden;
+		position: relative;
+		padding-left: 30rpx;
+		.munbox {
+			width: 144rpx;
+			height: 44rpx;
+			position: absolute;
+			bottom: 0;
+			right: 0;
+			input {
+				display: inline-block;
+				text-align: center;
+			}
+			image {
+				flex-shrink: 0;
+				width: 44rpx;
+				height: 44rpx;
+			}
+		}
+		.title,
+		.price {
+			font-size: $font-base + 2rpx;
+			color: $font-color-dark;
+			height: 40rpx;
+			line-height: 40rpx;
+		}
+		.attr {
+			font-size: $font-sm + 2rpx;
+			color: $font-color-light;
+			height: 50rpx;
+			line-height: 50rpx;
+			
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #999999;
+		}
+		.price {
+			// height: 50rpx;
+			// line-height: 50rpx;
+			padding-top: 20rpx;
+			font-size: 34rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #FF4C4C;
+		}
+		.step {
+			margin-top: 20rpx;
+		}
+		.title {
+			font-size: 34rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+		}
+	}
+	.del-btn {
+		padding: 4rpx 10rpx;
+		font-size: 34rpx;
+		height: 50rpx;
+		color: $font-color-light;
+	}
+}
+/* 底部栏 */
+.action-section {
+	/* #ifdef H5 */
+	margin-bottom: 100rpx;
+	/* #endif */
+	position: fixed;
+	left: 30rpx;
+	bottom: 30rpx;
+	z-index: 95;
+	display: flex;
+	align-items: center;
+	width: 690rpx;
+	height: 100rpx;
+	padding: 0 30rpx;
+	background: rgba(255, 255, 255, 0.9);
+	box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
+	border-radius: 16rpx;
+	.checkbox {
+		height: 52rpx;
+		position: relative;
+		.icon-checked-box {
+			border-radius: 50rpx;
+			background-color: #ffffff;
+			width: 52rpx;
+			height: 100%;
+			position: relative;
+			z-index: 5;
+			font-size: 53rpx;
+			line-height: 1;
+			color: $font-color-light;
+		}
+		.icon-checked {
+			color: $base-color;
+		}
+	}
+	.clear-btn {
+		position: absolute;
+		left: 26rpx;
+		top: 0;
+		z-index: 4;
+		width: 0;
+		height: 52rpx;
+		line-height: 52rpx;
+		padding-left: 38rpx;
+		font-size: $font-base;
+		color: #fff;
+		background: $font-color-disabled;
+		border-radius: 0 50px 50px 0;
+		opacity: 0;
+		transition: 0.2s;
+		&.show {
+			opacity: 1;
+			width: 120rpx;
+		}
+	}
+	.total-box {
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		text-align: right;
+		padding-right: 40rpx;
+		
+		.price {
+			font-size: $font-lg;
+			color: $font-color-dark;
+		}
+		.coupon {
+			font-size: $font-sm;
+			color: $font-color-light;
+			text {
+				color: $font-color-dark;
+			}
+		}
+	}
+	.confirm-btn {
+		padding: 0 38rpx;
+		margin: 0;
+		border-radius: 100px;
+		height: 76rpx;
+		line-height: 76rpx;
+		font-size: $font-base + 2rpx;
+		background: $base-color;
+	}
+}
+/* 复选框选中状态 */
+.action-section .checkbox.checked,
+.cart-item .checkbox.checked {
+	color: $base-color;
+}
+.cart-hand {
+	width: 750rpx;
+	height: 88rpx;
+	background: #FFFFFF;
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #333333;
+	line-height: 88rpx;
+	padding-left: 28rpx;
+	padding-right: 26rpx;
+	.hand-tit {
+		text {
+			color: #FF4C4C;
+		}
+	
+	}
+	.hand-btn {
+		width: 164rpx;
+		height: 62rpx;
+		border: 2rpx solid #FF4C4C;
+		border-radius: 31rpx;
+		font-size: 26rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #FF4C4C;
+		line-height: 62rpx;
+		text-align: center;
+	}
+}
+</style>

File diff suppressed because it is too large
+ 91 - 0
pages/index/fugou.vue


+ 116 - 104
pages/index/index.vue

@@ -12,11 +12,12 @@
 					<view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
 				</view>
 			</view>
+			<!-- 轮播图 -->
 			<swiper class="carousel" autoplay="true" :interval="5000" :duration="400">
-				<swiper-item @click="carouselList" class="carousel-item" v-for="(item,index) in carouselList"
+				<swiper-item @click="swiperClick" class="carousel-item" v-for="(item,index) in carouselList"
 					:key="index">
 					<image :src="item.pic"></image>
-				</swiper-item <!-- 自定义swiper指示器 -->
+				</swiper-item>
 				<view class="swiper-dots">
 				</view>
 			</swiper>
@@ -29,15 +30,15 @@
 				</view>
 				<view class="box">
 					<view class="customs-img">
-						<image src="../../static/img/reduce.png" mode=""></image>
+						<image :src="fugou.image" mode=""></image>
 					</view>
 					<view class="customstext">
 						<view class="customstext1">
-							<view class="customstext-title">
-								竹胎酵素健康饮
+							<view class="customstext-title clamp">
+								{{fugou.store_name}}
 							</view>
-							<view class="customstext-product">
-								健康生态饮品纯植物无香精
+							<view class="customstext-product clamp">
+								{{fugou.store_info}}
 							</view>
 						</view>
 						<view class="customsprice">
@@ -45,64 +46,51 @@
 								健康价:¥
 							</view>
 							<view class="customsprice-between">
-								199
+								{{price}}
 							</view>
-							<view class="customsprice-right">
+							<view class="customsprice-right" @click="navTo('/pages/index/fugou')">
 								立即复购
 							</view>
 						</view>
 					</view>
 				</view>
-				
+
 			</view>
-			
+
 			<view class="customs">
 				<image src="../../static/image/jifen.png" mode=""></image>
 			</view>
 			<view class="jifen-content">
-				
-				
-				
-				<view class="jifen-box">
+				<view class="jifen-box" v-for="(item,index) in bastList" :key="index" @click="navTo('/pages/product/product?id=' + item.id)">
 					<view class="img">
-						<image src="../../static/image/jifen1.png" mode=""></image>
+						<image :src="item.image" mode=""></image>
 					</view>
 					<view class="jifen-list">
 						<view class="box-title">
-							<view class="top">
-								竹胎酵素健康饮
-							</view>
-							<view class="button">
-								健康生态饮品纯植物
+							<view class="top clamp2">
+								{{item.store_name}}
 							</view>
 						</view>
 						<view class="box-price">
-							<view class="pricebox">
-								<image src="../../static/image/search.png" mode=""></image>
-							</view>
 							<view class="price-left">
-								2690
+								¥{{item.price}}
 							</view>
 							<view class="price-right">
-								¥360
+								¥{{item.ot_price}}
 							</view>
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
+	<!-- 	
 		<view class="fiexd">
 			<image src="../../static/image/background03.png" mode=""></image>
-		</view>
+		</view> -->
 	</view>
 </template>
 <script>
-	// import seckill from '../../components/seckill/seckill.vue';
-	// import { loadIndexs } from '@/api/index.js';
-	// import { getUserInfo } from '@/api/user.js';
-	// import { setCoupons } from '@/api/functionalUnit.js';
-	// import { getBargainList } from '@/api/product.js';
-	// import { interceptor } from '@/utils/loginUtils';
+	import { loadIndexs } from '@/api/index.js';
 	import {
 		mapState
 	} from 'vuex';
@@ -129,41 +117,58 @@
 				}
 			},
 			// 初次加载页面高度时修改页面高度
-			bastList(newValue, oldValue) {
-				let obj = this;
-				let bHeight = Math.ceil(newValue.length / 2);
-				obj.$nextTick(function() {
-					uni.createSelectorQuery()
-						.select('#list-box')
-						.fields({
-								size: true
-							},
-							function(data) {
-								obj.pageProportion = data.width / 750;
-								obj.swiperHeight = Math.ceil(obj.pageProportion * 520 * bHeight);
-							}
-						)
-						.exec();
-				});
-			}
+			
 		},
 		data() {
 			return {
-				carouselList: [{
-						pic: '../../static/image/background02.png'
-					},
-					{
-						pic: '../../static/image/baodan.png'
-					}
-				], //轮播列表
-				page: 1,
-				limit: 5,
-
-			};
+				carouselList: [], //轮播列表
+				couponArray: '',
+				bastList: [],//精品推荐
+				fugou:'',//复购商品
+				price:'',//复购价格
+			}
+		},
+		onLoad() {
+			this.loadData()
 		},
 		methods: {
-			carouselList(item) {
-
+			// 请求载入数据
+			async loadData() {
+				loadIndexs({})
+					.then(({ data }) => {
+						console.log(data,'dddd')
+						this.fugou = data.register_order;
+						this.price = data.register_price;
+						let goods = data.info;
+						this.carouselList = data.banner;
+						this.swiperLength = this.carouselList.length;
+						this.menusList = data.menus;
+						this.goodsList = goods.firstList; //最新商品
+						this.bastList = goods.bastList; //精品推荐
+						console.log(this.bastList, 'this.bastList6666666666666666666666');
+						this.bastBanner = data.benefit; //促销单品
+						this.$set(this, 'couponArray', data.couponList); //保存卡包券
+			
+						uni.stopPullDownRefresh();
+					})
+					.catch(e => {
+						uni.stopPullDownRefresh();
+					});
+			},
+			swiperClick() {
+				
+			},
+			// 点击搜索框
+			clickSearch() {
+				console.log('点击')
+				uni.navigateTo({
+					url: '/pages/product/search'
+				});
+			},
+			navTo(url) {
+				uni.navigateTo({
+					url
+				})
 			}
 		}
 
@@ -172,10 +177,7 @@
 
 <style lang="scss" scoped>
 	page {
-		margin: 0;
-		padding: 0;
-		height: 100%;
-
+		height: auto;
 		background-color: #D4FDF9;
 	}
 
@@ -197,17 +199,17 @@
 		}
 	}
 
-	.fiexd {
-		position: fiexd;
-		bottom: 0;
-		width: 750rpx;
-		height: 750rpx;
+	// .fiexd {
+	// 	position: fiexd;
+	// 	bottom: 0;
+	// 	width: 750rpx;
+	// 	height: 750rpx;
 
-		image {
-			width: 100%;
-			height: 100%;
-		}
-	}
+	// 	image {
+	// 		width: 100%;
+	// 		height: 100%;
+	// 	}
+	// }
 
 	.content {
 		flex-direction: column;
@@ -294,40 +296,45 @@
 				.customstext {
 					margin-left: 14rpx;
 					height: 200rpx;
-					display: flex;
-					flex-direction: column;
-					justify-content: space-around;
-
+					// display: flex;
+					// flex-direction: column;
+					// justify-content: space-around;
+					position: relative;
 					.customstext1 {
 						.customstext-title {
+							width: 350rpx;
 							font-size: 34rpx;
 							font-family: PingFang SC;
 							font-weight: bold;
 							color: #3F7C1F;
-							line-height: 20rpx;
+							
 						}
 
 						.customstext-product {
-							margin-top: 25rpx;
+							// margin-top: 25rpx;
+							width: 400rpx;
+							padding-top: 10rpx;
 							font-size: 26rpx;
 							font-family: PingFang SC;
 							font-weight: bold;
 							color: #ABD56F;
-							line-height: 20rpx;
 						}
 					}
 
 					.customsprice {
+						position: absolute;
+						bottom: 0;
+						left: 0;
 						display: flex;
 						align-items: center;
-						justify-content: space-between;
-
+						justify-content: flex-start;
+						width: 100%;
 						.customsprice-left {
 							font-size: 28rpx;
 							font-family: PingFang SC;
 							font-weight: 500;
 							color: #FF0000;
-							line-height: 20rpx;
+							flex-shrink: 0;
 						}
 
 						.customsprice-between {
@@ -335,22 +342,23 @@
 							font-family: PingFang SC;
 							font-weight: 500;
 							color: #FF0000;
-							line-height: 20rpx;
+							flex-shrink: 0;
 						}
 
 						.customsprice-right {
-							margin-left: 80rpx;
-							display: flex;
-							justify-content: center;
-							align-items: center;
+							text-align: center;
 							width: 137rpx;
 							height: 52rpx;
+							line-height: 52rpx;
 							background: #3F7C1F;
 							border-radius: 26rpx;
 							font-size: 26rpx;
 							font-family: PingFang SC;
 							font-weight: 400;
 							color: #FFFFFF;
+							position: absolute;
+							right: 0;
+							bottom: 0;
 						}
 					}
 				}
@@ -358,44 +366,47 @@
 		}
 
 		.jifen-content {
-			
 			width: 700rpx;
+			padding-bottom: 20rpx;
 			display: flex;
-
 			flex-wrap: wrap;
-			justify-content: space-around;
-
-
+			justify-content: space-between;
 			.jifen-box {
 				margin: 20rpx 0;
 				display: flex;
 				flex-direction: column;
 				align-items: center;
-				width: 336rpx;
+				width: 342rpx;
 				height: 512rpx;
+				padding-top: 20rpx;
 				background: #E6FCFA;
 				box-shadow: 0px 7px 10px 1px #8BAFAB;
 				.img {
-					margin-top: 20rpx;
+					flex-shrink: 0;
+					// margin-top: 20rpx;
 					height: 312rpx;
 					width: 312rpx;
+					background-color: #eee;
 					image {
 						height: 100%;
 						width: 100%;
 					}
 				}
 				.jifen-list {
-					margin-left: -80rpx;
+					// margin-left: -80rpx;
+					width: 312rpx;
+					height: 100%;
+					position: relative;
 					.box-title {
 						.top {
-							padding: 20rpx 0 10rpx 0;
+							margin: 20rpx 0 10rpx 0;
+							// padding: 20rpx 0 10rpx 0;
 							font-size: 30rpx;
 							font-family: PingFang SC;
 							font-weight: bold;
 							color: #3F7C1F;
 							line-height: 35rpx;
 						}
-
 						.button {
 							padding-bottom: 20rpx;
 							font-size: 26rpx;
@@ -409,15 +420,17 @@
 					.box-price {
 						display: flex;
 						align-items: center;
+						position: absolute;
+						bottom: 20rpx;
 						.pricebox {
 							height: 25rpx;
 							width: 25rpx;
+
 							image {
 								height: 100%;
 								width: 100%;
 							}
 						}
-
 						.price-left {
 							font-size: 36rpx;
 							font-family: PingFang SC;
@@ -425,7 +438,6 @@
 							color: #FF0000;
 							line-height: 35rpx;
 						}
-
 						.price-right {
 							font-size: 26rpx;
 							font-family: PingFang SC;

+ 3 - 10
pages/money/pay.vue

@@ -61,7 +61,7 @@ export default {
 			payType: 3,
 			payName: 'yue',
 			// #endif
-			orderInfo: {},
+			// orderInfo: {},
 			money: 0.0, //订单金额
 			now_money: 0.0, //余额
 			orderKey: '',
@@ -74,7 +74,6 @@ export default {
 			pinkid: '', //保存拼团商品id
 			checkedAuto: 0, //判断是否为自动拼团
 			topify: '',
-			is_drop: '',
 		};
 	},
 	computed: {
@@ -84,9 +83,6 @@ export default {
 		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 	},
 	onLoad(options) {
-		if(options.isdrop) {
-			this.is_drop = options.isdrop
-		}
  		this.checkedAuto = options.checked || 0;
 		this.topify = options.topify || 0;
 		if (options.type == 1) {
@@ -100,8 +96,7 @@ export default {
 				orderkey: this.orderKey,
 				couponId: prepage.couponChecked.id, //优惠券编号
 				addressId: prepage.addressData.id, //地址编号
-				useIntegral: prepage.checkedPoints ? 1 : 0,
-				is_drop: this.is_drop
+				useIntegral: prepage.checkedPoints ? 1 : 0
 			}).then(({ data }) => {
 				// 获取支付金额
 				this.money = data.result.pay_price;
@@ -154,7 +149,6 @@ export default {
 				from: 'app', //来源
 				// #endif
 				paytype: obj.payName ,//支付类型  weixin-微信 yue-余额
-				is_drop: obj.is_drop
 			})
 				.then(e => {
 					console.log(e,'zhifu+++++++++')
@@ -284,8 +278,7 @@ export default {
 				// #endif
 				shipping_type: 1, //提货方式 1 快递 2自提
 				automatic: obj.checkedAuto,
-				topify: this.topify,
-				is_drop: obj.is_drop
+				topify: this.topify
 			};
 			// 判断是否拼团商品
 			if (obj.pinkid) {

+ 4 - 3
pages/money/recharge.vue

@@ -32,7 +32,7 @@
 							<view class="title"><text>微信充值</text></view>
 							
 						</view>
-						<view class="right"><radio value="weixin" color="#FF4343" :checked="type == 'weixin'" /></view>
+						<view class="right"><radio value="weixin" color="#6EAB4E" :checked="type == 'weixin'" /></view>
 					</view>
 				</label>
 				<!-- #endif -->
@@ -255,7 +255,7 @@ page {
 		color: $base-color;
 	}
 	&.up {
-		background: linear-gradient(-35deg, #FF4343, #FF4343);
+		background: #6EAB4E;
 		color: #fff;
 	}
 	display: flex;
@@ -391,6 +391,7 @@ page {
 	}
 }
 .current {
-	background: linear-gradient(-35deg, #F8DD4F, #FBEB77) !important;
+	background: #6EAB4E !important;
+	color: #fff !important;
 }
 </style>

+ 9 - 11
pages/money/wallet.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="content-money">
 			<view class="money-box">
-				<image src="../../static/img/qbbg.png" mode=""></image>
+				<image src="../../static/img/img33.png" mode=""></image>
 				<view class="money"><text class="money-icon">¥</text>{{ userInfo.now_money | getMoneyStyle }}</view>
 			</view>
 		</view>
@@ -139,14 +139,12 @@ export default {
 				state
 			)
 				.then(({ data }) => {
-					console.log(data);
-					// if (data.count > 0) {
-					// 	navItem.orderList = navItem.orderList.concat(data.list);
-					// 	console.log(navItem.orderList);
-					// 	navItem.page++;
-					// }
 					if (data.length > 0) {
-						navItem.orderList = navItem.orderList.concat(data[0].list);
+						data.forEach(e =>{
+							console.log(e);
+							navItem.orderList = navItem.orderList.concat(e.list);
+						})
+						
 						console.log(navItem.orderList);
 						navItem.page++;
 					}
@@ -258,12 +256,12 @@ page {
 		// margin: auto 0;
 		font-size: 56rpx;
 		font-weight: bold;
-		color: #FF4C4C;
+		color: #3F7C1F;
 		position: relative;
 		.money-icon {
 			font-size: 38rpx;
 			font-weight: bold;
-			color: #FF4C4C;
+			color: #3F7C1F;
 		}
 	}
 }
@@ -349,7 +347,7 @@ page {
 	right: 39rpx;
 	width: 674rpx;
 	height: 88rpx;
-	background: $base-color;
+	background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
 	border-radius: 44rpx;
 	color: #fff;
 	text-align: center;

+ 18 - 18
pages/order/createOrder.vue

@@ -46,10 +46,10 @@
 			</view>
 
 			<image class="a-bg" :src="addressImg"></image>
-		</navigator> -->
+		</navigator> -->
 		<!-- 选择安装位置 -->
-	<!-- 	<view class="">
-			选择安装地址
+	<!-- 	<view class="">
+			选择安装地址
 		</view> -->
 		<view class="goods-section" v-for="(ls, ind) in shopList" :key="ind">
 			<!-- <view class="g-header b-b">
@@ -96,10 +96,10 @@
 				<text class="cell-tit clamp">优惠金额</text>
 				<text class="cell-tip red">-¥35</text>
 			</view> -->
-			<!-- <view class="yt-list-cell b-b">
+			<view class="yt-list-cell b-b">
 				<text class="cell-tit clamp">积分抵扣{{ '(当前积分:' + integralAll + ')' }}</text>
 				<view class="cell-tip"><radio @click="checkedPoints = !checkedPoints" color=" #5dbc7c" :checked="checkedPoints" /></view>
-			</view> -->
+			</view>
 			
 			<view class="yt-list-cell b-b">
 				<text class="cell-tit clamp">备注</text>
@@ -110,15 +110,15 @@
 			<view class="yt-list-cell b-b">
 				<text class="cell-tit clamp">商品总价</text>
 				<text class="cell-tip">¥{{ payAllMoney }}</text>
+			</view>
+			<view class="yt-list-cell b-b">
+				<text class="cell-tit clamp">运费</text>
+				<text class="cell-tip">{{ Postage }}</text>
 			</view>
-			<view class="yt-list-cell b-b">
-				<text class="cell-tit clamp">运费</text>
-				<text class="cell-tip">{{ Postage }}</text>
-			</view>
-			<!-- <view class="yt-list-cell b-b" v-if="checkedPoints && integralShow">
+			<view class="yt-list-cell b-b" v-if="checkedPoints && integralShow">
 				<text class="cell-tit clamp">积分抵扣</text>
 				<text class="cell-tip">-¥{{ integralMoney }}</text>
-			</view> -->
+			</view>
 			<view class="yt-list-cell b-b" v-if="moneyAll.vipPrice > 0">
 				<text class="cell-tit clamp">会员折扣</text>
 				<text class="cell-tip">-¥{{ moneyAll.vipPrice }}</text>
@@ -216,7 +216,7 @@ export default {
 			integralMoney: 0, //积分抵扣金额
 			integralShow: false, //是否显示积分抵扣金额
 			payType: true, //是否可支付
-			pinkid: '', //保存拼团商品id
+			pinkid: '', //保存拼团商品id
 			isdrop: 0,
 		};
 	},
@@ -229,10 +229,10 @@ export default {
 			// 保存当前商品在购物车中的id
 			this.cartId = option.id;
 			this.loadData();
-		}
-		if(option.isdrop) {
-			this.isdrop = option.isdrop*1
-			console.log(this.isdrop,)
+		}
+		if(option.isdrop) {
+			this.isdrop = option.isdrop*1
+			console.log(this.isdrop,)
 		}
 		this.userinfo();
 	},
@@ -289,7 +289,7 @@ export default {
 				orderkey: this.orderKey,
 				useIntegral: this.checkedPoints ? 1 : 0, //是否积分抵扣
 				couponId: this.couponChecked.id, //优惠券编号
-				addressId: this.addressData.id ,//地址编号
+				addressId: this.addressData.id ,//地址编号
 				is_drop: this.isdrop
 			})
 				.then(({ data }) => {
@@ -367,7 +367,7 @@ export default {
 			if (!this.addressData.real_name) {
 				this.$api.msg('请选择收货地址');
 				return false;
-			}
+			}
 			console.log(this.isdrop,'dddddddddddddddddddddddddd')
 			let url =  '/pages/money/pay?key='+ this.orderKey + '&isdrop=' + this.isdrop
 			if(this.pinkid){

+ 13 - 15
pages/order/order.vue

@@ -48,9 +48,9 @@
 							<text class="num">{{ item.cartInfo.length }}</text>
 							件商品 合计
-							<text class="price">{{ moneyNum(item.pay_price)}}</text>
-							(含邮费
-							<text class="price">{{ moneyNum(item.pay_postage)}}</text>
+							<text class="price">{{ moneyNum(item.pay_price)}}</text>
+							(含邮费
+							<text class="price">{{ moneyNum(item.pay_postage)}}</text>
 						</view>
 						<view class="action-box b-t" v-if="item.status != 5">
@@ -84,7 +84,7 @@ export default {
 			navList: [
 				{
 					state: 0,
-					text: '全部',
+					text: '待付款',
 					loadingType: 'more',
 					orderList: [],
 					page: 1, //当前页数
@@ -92,7 +92,7 @@ export default {
 				},
 				{
 					state: 1,
-					text: '待付款',
+					text: '待发货',
 					loadingType: 'more',
 					orderList: [],
 					page: 1, //当前页数
@@ -100,7 +100,7 @@ export default {
 				},
 				{
 					state: 2,
-					text: '待货',
+					text: '待货',
 					loadingType: 'more',
 					orderList: [],
 					page: 1, //当前页数
@@ -108,7 +108,7 @@ export default {
 				},
 				{
 					state: 3,
-					text: '待收货',
+					text: '待评价',
 					loadingType: 'more',
 					orderList: [],
 					page: 1, //当前页数
@@ -301,16 +301,16 @@ export default {
 				stateTipColor = '#fa436a';
 			switch (+state) {
 				case 0:
-					stateTip = '全部';
+					stateTip = '待付款';
 					break;
 				case 1:
-					stateTip = '待付款';
+					stateTip = '待发货';
 					break;
 				case 2:
-					stateTip = '待货';
+					stateTip = '待货';
 					break;
 				case 3:
-					stateTip = '待收货';
+					stateTip = '待评价';
 					break;
 				case 4:
 					stateTip = '已完成';
@@ -346,6 +346,7 @@ page,
 .navbar {
 	display: flex;
 	height: 40px;
+	padding: 0 5px;
 	background: #fff;
 	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
 	position: relative;
@@ -358,10 +359,7 @@ page,
 		height: 100%;
 		font-size: 15px;
 		color: $font-color-dark;
-		position: relative;
-		margin-top: 80rpx;
-		background-color: #fff;
-		border-top: 1rpx solid #F8F6F6;
+		position: relative;
 		&.current {
 			color: $base-color;
 			&:after {

+ 185 - 214
pages/product/common/productBottom.vue

@@ -1,216 +1,187 @@
-<template>
-	<view class="page-bottom">
-		<!-- 	<navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
-			<text class="iconfont iconhome"></text>
-			<text>首页</text>
-		</navigator>
-		<view class="p-b-btn" :class="{ active: goodsObjact.userCollect }" @click="toFavorite(goodsObjact)">
-			<text class="iconfont " :class="{ iconlike: !goodsObjact.userCollect, iconlikefill: goodsObjact.userCollect }"></text>
-			<text>收藏</text>
-		</view> -->
-		<!-- <view class="action-btn-group">
-			<button type="primary" class=" action-btn no-border add-cart-btn" @click="buy(2)">加入购物车</button>
-			<button type="primary" class=" action-btn no-border buy-now-btn" @click="buy(1)">立即购买</button>
-		</view> -->
-		<view class="btm-btn">
-			<view class="add-btn" @click="buy(2)" v-if="showAdd">加入购物车</view>
-			<view class="buy-btn" @click="buy(1)" :class="{'quck':!showAdd }">立即购买</view>
-		</view>
-	</view>
-</template>
-
-<script>
-import { collectAdd, collectDel } from '@/api/product.js';
-export default {
-	props: {
-		many: {
-			default: 9
-		},
-		goodsObjact: {
-			default: function() {
-				return {};
-			}
-		},
-		goodsid: {
-			default: ''
-		},
-		showAdd: {
-			default: true
-		}
-	},
-	data() {
-		return {};
-	},
-	methods: {
-		buy(type) {
-			this.$emit('specOPne', type);
-		},
-		//收藏
-		toFavorite(item) {
-			let obj = this;
-			item.userCollect = !item.userCollect;
-			if (!item.userCollect) {
-				collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
-					uni.showToast({
-						title: '成功取消收藏',
-						type: 'top',
-						duration: 1500
-					});
-				});
-			} else {
-				collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
-					uni.showToast({
-						title: '成功加入收藏',
-						type: 'top',
-						duration: 1500
-					});
-				});
-			}
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-/* 底部操作菜单 */
-.page-bottom {
-	position: fixed;
-	bottom: 0rpx;
-	z-index: 95;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	width: 750rpx;
-	height: 120rpx;
-	background-color: #ffffff;
+<template>
+	<view class="page-bottom">
+		<view class="btm-btn">
+			<view class="add-btn" @click="buy(2)" v-if="showAdd">加入购物车</view>
+			<view class="buy-btn" @click="buy(1)" :class="{'quck':!showAdd }">{{showAdd? '立即购买': '立即兑换'}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import { collectAdd, collectDel } from '@/api/product.js';
+export default {
+	props: {
+		many: {
+			default: 9
+		},
+		goodsObjact: {
+			default: function() {
+				return {};
+			}
+		},
+		goodsid: {
+			default: ''
+		},
+		showAdd: {
+			type: Boolean,
+			default: true
+		}
+	},
+	data() {
+		return {};
+	},
+	methods: {
+		buy(type) {
+			this.$emit('specOPne', type);
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+/* 底部操作菜单 */
+.page-bottom {
+	position: fixed;
+	bottom: 0rpx;
+	z-index: 95;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	width: 750rpx;
+	height: 97rpx;
+	background-color: #ffffff;
 	/* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
-	border-radius: 16rpx; */
-	.p-b-btn {
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-		font-size: $font-sm;
-		color: $font-color-base;
-		width: 96rpx;
-		height: 80rpx;
-		.iconfont {
-			font-size: 40rpx;
-			line-height: 48rpx;
-			color: $font-color-light;
-		}
-		&.active,
-		&.active .iconfont {
-			color: $uni-color-primary;
-		}
-		.iconlikefill {
-			font-size: 46rpx;
-		}
-		image {
-			width: 56rpx;
-			height: 58rpx;
-		}
-	}
-	.action-btn-group {
-		display: flex;
-		height: 76rpx;
-		border-radius: 100px;
-		overflow: hidden;
-		margin-left: 20rpx;
-		position: relative;
-		&:after {
-			content: '';
-			position: absolute;
-			top: 50%;
-			right: 50%;
-			transform: translateY(-50%);
-			height: 28rpx;
-			width: 0;
-			border-right: 1px solid rgba(255, 255, 255, 0.5);
-		}
-		.action-btn {
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			// width: 270rpx;
-			// height: 100%;
-			font-size: $font-base;
-			padding: 0;
-			border-radius: 0;
-			background: transparent;
-			width: 339rpx;
-			height: 90rpx;
-			&.buy-now-btn {
-				background-color: #303e49;
-			}
-			&.add-cart-btn {
-				background-color: #fff;
-				color: #ff4c4c;
-				border: #ff4c4c 1px solid;
-			}
-		}
-	}
-}
-.p-b-btn {
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	justify-content: center;
-	font-size: $font-sm;
-	color: $font-color-base;
-	width: 96rpx;
-	height: 80rpx;
-	.iconfont {
-		font-size: 40rpx;
-		line-height: 48rpx;
-		color: $font-color-light;
-	}
-	&.active,
-	&.active .iconfont {
-		color: $uni-color-primary;
-	}
-	.icon-fenxiang2 {
-		font-size: 42rpx;
-		transform: translateY(-2rpx);
-	}
-	.iconlikefill {
-		font-size: 46rpx;
-	}
-}
-.btm-btn {
-	z-index: 2;
-	width: 750rpx;
-	height: 97rpx;
-	display: flex;
-	// justify-content: space-between;
-	position: fixed;
-	bottom: 0;
-	background-color: #fff;
-	text-align: center;
-	.add-btn {
-		text-align: center;
-		width: 375rpx;
-		height: 97rpx;
-		background: #FFB238;
-		font-size: 36rpx;
-		font-weight: 500;
-		color: #fff;
-		line-height: 97rpx;
-	}
-	.buy-btn {
-		text-align: center;
-		border: none;
-		width: 375rpx;
-		height: 97rpx;
-		background: #6EAB4E;
-		font-size: 36rpx;
-		font-weight: 500;
-		color: #fff;
-		line-height: 97rpx;
-		color: #fff;
-	}
-	.quck {
-		width: 691px;
-	}
-}
+	border-radius: 16rpx; */
+	.p-b-btn {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		font-size: $font-sm;
+		color: $font-color-base;
+		width: 96rpx;
+		height: 80rpx;
+		.iconfont {
+			font-size: 40rpx;
+			line-height: 48rpx;
+			color: $font-color-light;
+		}
+		&.active,
+		&.active .iconfont {
+			color: $uni-color-primary;
+		}
+		.iconlikefill {
+			font-size: 46rpx;
+		}
+		image {
+			width: 56rpx;
+			height: 58rpx;
+		}
+	}
+	.action-btn-group {
+		display: flex;
+		height: 76rpx;
+		border-radius: 100px;
+		overflow: hidden;
+		margin-left: 20rpx;
+		position: relative;
+		&:after {
+			content: '';
+			position: absolute;
+			top: 50%;
+			right: 50%;
+			transform: translateY(-50%);
+			height: 28rpx;
+			width: 0;
+			border-right: 1px solid rgba(255, 255, 255, 0.5);
+		}
+		.action-btn {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			// width: 270rpx;
+			// height: 100%;
+			font-size: $font-base;
+			padding: 0;
+			border-radius: 0;
+			background: transparent;
+			width: 339rpx;
+			height: 90rpx;
+			&.buy-now-btn {
+				background-color: #303e49;
+			}
+			&.add-cart-btn {
+				background-color: #fff;
+				color: #ff4c4c;
+				border: #ff4c4c 1px solid;
+			}
+		}
+	}
+}
+.p-b-btn {
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+	font-size: $font-sm;
+	color: $font-color-base;
+	width: 96rpx;
+	height: 80rpx;
+	.iconfont {
+		font-size: 40rpx;
+		line-height: 48rpx;
+		color: $font-color-light;
+	}
+	&.active,
+	&.active .iconfont {
+		color: $uni-color-primary;
+	}
+	.icon-fenxiang2 {
+		font-size: 42rpx;
+		transform: translateY(-2rpx);
+	}
+	.iconlikefill {
+		font-size: 46rpx;
+	}
+}
+.btm-btn {
+	z-index: 2;
+	width: 750rpx;
+	height: 97rpx;
+	display: flex;
+	// justify-content: space-between;
+	position: fixed;
+	bottom: 0;
+	background-color: #fff;
+	text-align: center;
+	.add-btn {
+		text-align: center;
+		width: 375rpx;
+		height: 97rpx;
+		background: #FFB238;
+		font-size: 36rpx;
+		font-weight: 500;
+		color: #fff;
+		line-height: 97rpx;
+	}
+	.buy-btn {
+		text-align: center;
+		border: none;
+		width: 375rpx;
+		height: 97rpx;
+		background: #6EAB4E;
+		font-size: 36rpx;
+		font-weight: 500;
+		color: #fff;
+		line-height: 97rpx;
+		color: #fff;
+	}
+	.quck {
+		width: 699rpx;
+		height: 90rpx;
+		background: #6EAB4E;
+		border-radius: 45rpx;
+		margin: auto;
+	}
+}
 </style>

+ 414 - 0
pages/product/list.vue

@@ -0,0 +1,414 @@
+<template>
+	<view class="content">
+		<view class="navbar" :style="{ position: headerPosition, top: headerTop }">
+			<view class="nav-item" :class="{ current: filterIndex === 0 }" @click="tabClick(0)">综合排序</view>
+			<view class="nav-item" :class="{ current: filterIndex === 1 }" @click="tabClick(1)">
+				<text>销量优先</text>
+				<view class="p-box">
+					<text :class="{ active: numberOrder === 1 && filterIndex === 1 }" class="iconfont iconfold"></text>
+					<text :class="{ active: numberOrder === 2 && filterIndex === 1 }" class="iconfont iconfold xia"></text>
+				</view>
+			</view>
+			<view class="nav-item" :class="{ current: filterIndex === 2 }" @click="tabClick(2)">
+				<text>价格</text>
+				<view class="p-box">
+					<text :class="{ active: priceOrder === 1 && filterIndex === 2 }" class="iconfont iconfold"></text>
+					<text :class="{ active: priceOrder === 2 && filterIndex === 2 }" class="iconfont iconfold xia"></text>
+				</view>
+			</view>
+			<text class="cate-item iconfont iconapps" @click="toggleCateMask('show')"></text>
+		</view>
+		<view class="goods-list">
+			<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
+				<view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
+				<text class="title clamp">{{ item.title }}</text>
+				<view class="price-box">
+					<text class="price">{{ item.price }}</text>
+					<text>已售 {{ item.sales }}</text>
+				</view>
+			</view>
+		</view>
+		<uni-load-more :status="loadingType"></uni-load-more>
+
+		<view class="cate-mask" :class="cateMaskState === 0 ? 'none' : cateMaskState === 1 ? 'show' : ''" @click="toggleCateMask">
+			<view class="cate-content" @click.stop.prevent="stopPrevent" @touchmove.stop.prevent="stopPrevent">
+				<scroll-view scroll-y class="cate-list">
+					<view v-for="item in cateList" :key="item.id">
+						<view class="cate-item b-b two">{{ item.cate_name }}</view>
+						<view v-for="tItem in item.children" :key="tItem.id" class="cate-item b-b" :class="{ active: tItem.id == cateId }" @click="changeCate(tItem)">
+							{{ tItem.cate_name }}
+						</view>
+					</view>
+				</scroll-view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import { getProducts } from '@/api/product.js';
+import { getCategoryList } from '@/api/product.js';
+export default {
+	components: {
+		uniLoadMore
+	},
+	data() {
+		return {
+			cateMaskState: 0, //分类面板展开状态
+			headerPosition: 'fixed',
+			headerTop: '0px',
+			loadingType: 'more', //加载更多状态
+			filterIndex: 0, //查询类型
+			numberOrder: 0, //1 销量从低到高 2销量从高到低
+			limit: 6, //每次加载数据条数
+			page: 0, //当前页数
+			cateId: 0, //已选三级分类id
+			priceOrder: 0, //1 价格从低到高 2价格从高到低
+			cateList: [], //分类列表
+			goodsList: [] //商品列表
+		};
+	},
+
+	onLoad(options) {
+		// #ifdef H5
+		this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
+		// #endif
+		this.cateId = options.tid;
+		this.loadCateList(options.fid, options.sid);
+		this.loadData();
+	},
+	onPageScroll(e) {
+		//兼容iOS端下拉时顶部漂移
+		if (e.scrollTop >= 0) {
+			this.headerPosition = 'fixed';
+		} else {
+			this.headerPosition = 'absolute';
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		this.loadData('refresh');
+	},
+	//监听页面是否滚动到底部加载更多
+	onReachBottom() {
+		this.loadData();
+	},
+	methods: {
+		//加载分类
+		async loadCateList(fid, sid) {
+			let obj = this;
+			getCategoryList({}).then(function(e) {
+				console.log(e);
+				e.data.forEach(function(e) {
+					if (e.id == fid) {
+						obj.cateList = e.children;
+						return;
+					}
+				});
+				console.log(obj.cateList);
+			});
+		},
+		//加载商品 ,带下拉刷新和上滑加载
+		async loadData(type = 'add', loading) {
+			let obj = this;
+			let data = {
+				page: obj.page,
+				limit: obj.limit,
+				sid: obj.cateId //分类id
+			};
+			//没有更多直接返回
+			if (type === 'add') {
+				if (obj.loadingType === 'nomore') {
+					return;
+				}
+				obj.loadingType = 'loading';
+			} else {
+				obj.loadingType = 'more';
+			}
+			if (type === 'refresh') {
+				// 清空数组
+				obj.goodsList = [];
+				obj.page = 1
+			}
+			if (this.filterIndex == 1) {
+				console.log( obj.salesOrder);
+				data.salesOrder = obj.numberOrder == 1 ? 'asc' : 'desc';
+			}
+			if (this.filterIndex == 2) {
+				console.log( obj.priceOrder);
+				data.priceOrder = obj.priceOrder == 1 ? 'asc' : 'desc';
+			}
+			getProducts(data).then(function(e) {
+				console.log(e.data);
+				obj.goodsList = obj.goodsList.concat(e.data);
+				//判断是否还有下一页,有是more  没有是nomore
+				if (obj.limit==e.data.length) {
+					obj.page++
+					obj.loadingType='more'
+				} else{
+					obj.loadingType='nomore'
+				}
+				if (type === 'refresh') {
+					if (loading == 1) {
+						uni.hideLoading();
+					} else {
+						uni.stopPullDownRefresh();
+					}
+				}
+			});
+		},
+		//筛选点击
+		tabClick(index) {
+			// 防止重复点击综合排序
+			if (this.filterIndex === 0 && this.filterIndex === index) {
+				return;
+			}
+			this.filterIndex = index;
+			// 判断是否为销量优先
+			if (index === 1) {
+				this.numberOrder = this.numberOrder === 1 ? 2 : 1;
+			}
+			// 判断是否为价格优先
+			if (index === 2) {
+				this.priceOrder = this.priceOrder === 1 ? 2 : 1;
+			}
+			// 初始化页数
+			this.page = 1;
+			// 初始化数组
+			uni.pageScrollTo({
+				duration: 300,
+				scrollTop: 0
+			});
+			this.loadData('refresh', 1);
+			uni.showLoading({
+				title: '正在加载'
+			});
+		},
+		//显示分类面板
+		toggleCateMask(type) {
+			let timer = type === 'show' ? 10 : 300;
+			let state = type === 'show' ? 1 : 0;
+			this.cateMaskState = 2;
+			setTimeout(() => {
+				this.cateMaskState = state;
+			}, timer);
+		},
+		//分类点击
+		changeCate(item) {
+			this.cateId = item.id;
+			// 显示右侧分类
+			this.toggleCateMask();
+			// 滚轮返回顶部
+			uni.pageScrollTo({
+				duration: 300,
+				scrollTop: 0
+			});
+			// 初始化查询页数
+			this.page = 1
+			// 重新加载数据
+			this.loadData('refresh', 1);
+			uni.showLoading({
+				title: '正在加载'
+			});
+		},
+		//详情
+		navToDetailPage(item) {
+			let id = item.id;
+			uni.navigateTo({
+				url: `/pages/product/product?id=${id}`
+			});
+		},
+		stopPrevent() {}
+	}
+};
+</script>
+
+<style lang="scss">
+page,
+.content {
+	background: $page-color-base;
+}
+.content {
+	padding-top: 96rpx;
+}
+
+.navbar {
+	position: fixed;
+	left: 0;
+	top: var(--window-top);
+	display: flex;
+	width: 100%;
+	height: 80rpx;
+	background: #fff;
+	box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
+	z-index: 10;
+	.nav-item {
+		flex: 1;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		font-size: 30rpx;
+		color: $font-color-dark;
+		position: relative;
+		&.current {
+			color: $base-color;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 120rpx;
+				height: 0;
+				border-bottom: 4rpx solid $base-color;
+			}
+		}
+	}
+	.p-box {
+		display: flex;
+		flex-direction: column;
+		.iconfont {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 30rpx;
+			height: 14rpx;
+			line-height: 1;
+			margin-left: 4rpx;
+			font-size: 26rpx;
+			color: #888;
+			&.active {
+				color: $base-color;
+			}
+		}
+		.xia {
+			transform: scaleY(-1);
+		}
+	}
+	.cate-item {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		width: 80rpx;
+		position: relative;
+		font-size: 44rpx;
+		&:after {
+			content: '';
+			position: absolute;
+			left: 0;
+			top: 50%;
+			transform: translateY(-50%);
+			border-left: 1px solid #ddd;
+			width: 0;
+			height: 36rpx;
+		}
+	}
+}
+
+/* 分类 */
+.cate-mask {
+	position: fixed;
+	left: 0;
+	top: var(--window-top);
+	bottom: 0;
+	width: 100%;
+	background: rgba(0, 0, 0, 0);
+	z-index: 95;
+	transition: 0.3s;
+
+	.cate-content {
+		width: 630rpx;
+		height: 100%;
+		background: #fff;
+		float: right;
+		transform: translateX(100%);
+		transition: 0.3s;
+	}
+	&.none {
+		display: none;
+	}
+	&.show {
+		background: rgba(0, 0, 0, 0.4);
+
+		.cate-content {
+			transform: translateX(0);
+		}
+	}
+}
+.cate-list {
+	display: flex;
+	flex-direction: column;
+	height: 100%;
+	.cate-item {
+		display: flex;
+		align-items: center;
+		height: 90rpx;
+		padding-left: 30rpx;
+		font-size: 28rpx;
+		color: #555;
+		position: relative;
+	}
+	.two {
+		height: 64rpx;
+		color: #303133;
+		font-size: 30rpx;
+		background: #f8f8f8;
+	}
+	.active {
+		color: $base-color;
+	}
+}
+
+/* 商品列表 */
+.goods-list {
+	display: flex;
+	flex-wrap: wrap;
+	padding: 0 30rpx;
+	background: #fff;
+	.goods-item {
+		display: flex;
+		flex-direction: column;
+		width: 48%;
+		padding-bottom: 40rpx;
+		&:nth-child(2n + 1) {
+			margin-right: 4%;
+		}
+	}
+	.image-wrapper {
+		width: 100%;
+		height: 330rpx;
+		border-radius: 3px;
+		overflow: hidden;
+		image {
+			width: 100%;
+			height: 100%;
+			opacity: 1;
+		}
+	}
+	.title {
+		font-size: $font-lg;
+		color: $font-color-dark;
+		line-height: 80rpx;
+	}
+	.price-box {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding-right: 10rpx;
+		font-size: 24rpx;
+		color: $font-color-light;
+	}
+	.price {
+		font-size: $font-lg;
+		color: $uni-color-primary;
+		line-height: 1;
+		&:before {
+			content: '¥';
+			font-size: 26rpx;
+		}
+	}
+}
+</style>

+ 1154 - 769
pages/product/product.vue

@@ -1,770 +1,1155 @@
-<template>
-	<view class="container">
-		<!-- 轮播图 -->
-		<top-swiper :imgList="imgList"></top-swiper>
-		<!-- 标题 -->
-		<product-content :goodsObjact="goodsObjact" @callf="callf"></product-content>
-
-		<!-- 拼货时间及优惠 -->
-		<!-- <discounts @clickCoupon="Getcoupon" :Info="goodsObjact.store_info" :showCoupon="true"></discounts> -->
-		<!-- 猜你喜欢 -->
-		<!-- <guess-like @Addcar='Addcar' @clickNavTo='navToDetailPage' :goodList = 'good_list||[]'></guess-like> -->
-		<!-- 评价 -->
-		<estimate @navTo="navTo('/pages/product/reply?id=' + goodsid)" v-if="reply" :reply="reply" :list="list"></estimate>
-		<!-- 规格信息 -->
-		<fresh-detail :goodsObjact="goodsObjact"></fresh-detail>
-		<!-- 图文详情 -->
-		<content-text :description="description"></content-text>
-		<!-- 底部高度撑开 -->
-		<view class="contentBottomHeight"></view>
-		<!-- 底部操作菜单 -->
-		<product-bottom @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid" @specOPne="specOPne" :showAdd="showAdd"></product-bottom>
-		<!-- 规格-模态层弹窗 -->
-		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
-			<!-- 遮罩层 -->
-			<view class="mask"></view>
-			<view class="layer attr-content" @click.stop="stopPrevent">
-				<view class="a-t">
-					<image :src="actionImage"></image>
-					<view class="right">
-						<text class="name clamp">{{ goodsObjact.store_name }}</text>
-						<view class="price">
-							<text>¥</text>
-							{{ actionPrice * goodsNumber }}
-						</view>
-						<image src="../../static/icon/del.png" mode="" class="right-img" @click="close()"></image>
-					</view>
-				</view>
-				<view v-for="(item, index) in specList" :key="index" class="attr-list">
-					<text>选择{{ item.attr_name }}分类</text>
-					<view class="item-list">
-						<text
-							v-for="(childItem, childIndex) in item.attr_value"
-							:key="childIndex"
-							class="tit"
-							:class="{ selected: childItem.check }"
-							@click="selectSpec(childItem, item, index)"
-						>
-							{{ childItem.attr }}
-						</text>
-					</view>
-				</view>
-				<view class="mun-box">
-					<text>购买数量</text>
-					<view class="num">
-						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax" @eventChange="numberChange"></uni-number-box>
-					</view>
-				</view>
-				<button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
-				<button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
-			</view>
-		</view>
-		<view class="mask" v-if="show"><image @click="onTap" src="../../static/img/shareimg.png"></image></view>
-	</view>
-</template>
-
-<script>
-import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
-import { goodsDetail, cartAdd, seckillGoods } from '@/api/product.js';
-import { mapState } from 'vuex';
-import store from '@/store/index.js';
-import { saveUrl } from '@/utils/loginUtils.js';
-// #ifdef H5
-import { weixindata } from '@/utils/wxAuthorized';
-// #endif
-// 头部轮播图
-import topSwiper from './common/topSwiper.vue';
-// 标题
-import productContent from './common/productContent.vue';
-// 到货时间及优惠
-import discounts from './common/discounts.vue';
-// 规格信息
-import freshDetail from './common/freshDetail.vue';
-// 图文详情
-import contentText from './common/contentText.vue';
-// 底部按钮
-import productBottom from './common/productBottom.vue';
-// 猜你喜欢
-import guessLike from './common/guessLike.vue';
-// 评价
-import estimate from './common/estimate.vue';
-//增减数量
-import uniNumberBox from '@/components/uni-number-box.vue';
-export default {
-	components: {
-		guessLike,
-		topSwiper,
-		productContent,
-		discounts,
-		freshDetail,
-		contentText,
-		productBottom,
-		estimate,
-		uniNumberBox
-	},
-	data() {
-		return {
-			show: false,
-			showAdd: true,
-			isShare: false,
-			goodsStore: 0, //选中库存
-			specList: [],
-			buys_show: true,
-			buys_shows: false,
-			specSelected: [], //选中的分类
-			specClass: 'none', //显示隐藏弹窗
-			many: 1, //1是单规格  2是多规格
-			reply: '', //评论
-			list: '', //商品详情的数据
-			type: 1, //默认支付方式add为
-			goodsType: 0,
-			goodsNumber: 1, //购买数量
-			goodsid: '', //商品id
-			description: '', //商品描述
-			goodsObjact: {
-				percent: 1
-			}, //保存商品数据
-			//图片循环
-			imgList: [],
-			// 对比对象
-			actionPrice: 0, //默认选中商品价格
-			actionImage: '', //默认选中图片
-			good_list: '', //猜你喜欢列表
-			goodsNumberMax: 0, //最大可购买数量
-			// 倒计时数据保存
-			seckillObj: {
-				stopTime: 0, //结束时间
-				stop: false, //是否结束
-				stopTimeH: 0, //小时
-				stopTimeM: 0, //分钟
-				stopTimeS: 0, //秒钟
-				stopTimeD: 0, //天
-				upTime: 0 //更新组件内部组件用
-			},
-			// 拼团数据保存
-			pink: {
-				id: '', //拼团编号
-				uid: '', //用户编号
-				people: '', //拼团人数
-				price: '', //拼团价格
-				stop_time: '', //拼团结束时间
-				nickname: '', //团长昵称
-				avatar: '', //团长头像
-				count: '', //拼团剩余人数
-				h: '', //时
-				i: '', //分
-				s: '' //秒
-			},
-			userInfo: '',
-			is_drop: false, //是否上门安装
-			showDrop: false //商品是否具有安装属性
-		};
-	},
-	filters: {
-		parseIntTo(percent) {
-			percent = +percent * 100;
-			if (percent % 1 === 0) {
-				return percent;
-			} else {
-				percent = percent.toFixed(1);
-				return percent;
-			}
-		}
-	},
-	async onLoad(options) {
-		let obj = this;
-		obj.userInfo = uni.getStorageSync('userInfo');
-		//保存商品id
-		this.goodsid = options.id;
-		if (options.type) {
-			this.goodsType = options.type;
-		}
-		// 判断有无人邀请
-		if (options.spread) {
-			// 存储邀请人
-			uni.setStorageSync('spread', options.spread);
-		}
-		saveUrl();
-		this.goodsDetail();
-		// 注册邀请信息
-		// #ifdef H5
-		let bool = uni.getStorageSync('weichatBrowser') || '';
-		if (bool) {
-			weixindata();
-		}
-		// #endif
-	},
-	computed: {
-		...mapState(['weichatObj', 'baseURL', 'urlFile'])
-	},
-	// 分享
-	onShareAppMessage(options) {
-		// 设置菜单中的转发按钮触发转发事件时的转发内容
-		let pages = getCurrentPages(); //获取加载的页面
-		let currentPage = pages[pages.length - 1]; //获取当前页面的对象
-		let url = currentPage.route; //当前页面url
-		let item = currentPage.options; //如果要获取url中所带的参数可以查看options
-		let shareObj = {
-			title: this.goodsObjact.store_name + '   价格:' + this.goodsObjact.price, // 默认是小程序的名称(可以写slogan等)
-			path: url + '?id=' + item.id + '&spread=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
-			imageUrl: this.goodsObjact.image,
-			success: function(res) {
-				// 转发成功之后的回调
-				if (res.errMsg == 'shareAppMessage:ok') {
-				}
-			},
-			fail: function() {
-				// 转发失败之后的回调
-				if (res.errMsg == 'shareAppMessage:fail cancel') {
-					// 用户取消转发
-				} else if (res.errMsg == 'shareAppMessage:fail') {
-					// 转发失败,其中 detail message 为详细失败信息
-				}
-			}
-		};
-
-		return shareObj;
-	},
-	methods: {
-		//选择是否上门安装
-		dropClick(val) {
-			if (val == 1) {
-				this.is_drop = true;
-			} else {
-				this.is_drop = false;
-			}
-		},
-		//选择数量
-		numberChange(e) {
-			console.log(e);
-			this.goodsNumber = e.number;
-		},
-		close() {
-			this.specClass = 'none';
-		},
-		//选择规格
-		selectSpec(item, arr, ind) {
-			arr.attr_value.forEach(function(e) {
-				e.check = false;
-			});
-			item.check = true;
-			let obj = this;
-			obj.specSelected[ind] = item.attr;
-			let str = obj.specSelected.join(',');
-			// 获取当前选中的对象
-			if (obj.productValue[str]) {
-				obj.buys_show = true;
-				obj.buys_shows = false;
-				obj.actionPrice = obj.productValue[str].price;
-				obj.goodsNumberMax = obj.productValue[str].stock;
-				obj.actionImage = obj.productValue[str].image;
-				obj.uniqueId = obj.productValue[str].unique;
-				obj.goodsStore = obj.productValue[str].stock;
-			} else {
-				(obj.buys_show = false), (obj.buys_shows = true);
-			}
-			if (obj.goodsStore == 0) {
-				obj.buys_show = false;
-				obj.buys_shows = true;
-			}
-			obj.specSelected[ind] = item.attr;
-		},
-		// 打開彈窗
-		specOPne(type = 1) {
-			let obj = this;
-			obj.specClass = 'show';
-			obj.type = type;
-		},
-		//规格弹窗开关
-		toggleSpec(str) {
-			if (this.specClass === 'show') {
-				this.specClass = 'hide';
-				setTimeout(() => {
-					this.specClass = 'none';
-				}, 250);
-			} else if (this.specClass === 'none') {
-				this.specClass = 'show';
-			}
-			// 保存当前购买类型
-			this.type = str;
-		},
-		//领取优惠券
-		Getcoupon() {
-			uni.navigateTo({
-				url: '/pages/coupon/getcoupon'
-			});
-		},
-		//详情页
-		navToDetailPage(item) {
-			let id = item.id;
-			uni.navigateTo({
-				url: '/pages/product/product?id=' + id
-			});
-		},
-		// 跳转页面
-		navTo(url) {
-			uni.navigateTo({
-				url: '/pages/product/reply?id=' + this.goodsid
-			});
-		},
-		//加入购物车
-		Addcar(item) {
-			let obj = this;
-			cartAdd({
-				cartNum: '1', //商品数量
-				uniqueId: '', //商品标签
-				new: 0, //商品是否新增加到购物车1为不加入0为加入
-				mer_id: '',
-				productId: item.id //商品编号
-			})
-				.then(function(e) {
-					uni.showToast({
-						title: '成功加入购物车',
-						type: 'top',
-						duration: 500,
-						icon: 'none'
-					});
-
-					obj.goodsDetail();
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		},
-		goodsDetail() {
-			let obj = this;
-			// 获取普通商品信息
-			if (obj.goodsType == 0) {
-				goodsDetail({}, this.goodsid).then(function({ data }) {
-						obj.list = data;
-						console.log(obj.list, '普通商品数据');
-						obj.good_list = data.good_list; //保存猜你喜欢列表
-						obj.reply = data.reply; //保存评论列表
-						let goods = data.storeInfo;
-						if (goods.is_drop == 1) {
-							obj.showAdd = false;
-							obj.showDrop = true;
-							obj.is_drop = true;
-						}
-						obj.goodsObjact = goods;
-						if (obj.goodsObjact.description != null) {
-							obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
-						} //小程序商品详情图超出屏幕问题
-					obj.imgList = goods.slider_image; //保存轮播图
-					obj.specList = data.productAttr; //保存分类列表
-					if (Array.isArray(data.productValue) != true) {
-						console.log('开始处理数据');
-						obj.many = 2;
-						obj.specList = data.productAttr; //保存产品属性
-						obj.productValue = data.productValue; //保存属性值
-						obj.specSelected = []; //初始化默认选择对象
-						for (let i = 0; i < obj.specList.length; i++) {
-							console.log('数据处理');
-							// 设置默认数据
-							const ls = obj.specList[i].attr_value;
-							ls[0].check = true;
-							obj.specSelected.push(ls[0].attr);
-							// console.log('数据处理对象',ls);
-							// for (let s = 0; s < ls.length; s++) {
-							// 	console.log(s);
-							// 	console.log('数据处理对象2',ls[s]);
-							// 	if (ls[s].check) {
-							// 	}
-							// }
-						}
-						const str = obj.specSelected.join(','); //保存当前选中的默认对象
-						console.log(str, 'str');
-						// 设置默认值
-						obj.actionPrice = obj.productValue[str].price;
-						obj.goodsNumberMax = obj.productValue[str].stock;
-						obj.actionImage = obj.productValue[str].image;
-						obj.uniqueId = obj.productValue[str].unique;
-						obj.goodsStore = obj.productValue[str].stock;
-					} else {
-						obj.many = 1;
-						obj.productValue = data.productValue; //保存分类查询数据
-						obj.actionPrice = goods.price; //保存默认选中商品价格
-						obj.actionImage = goods.image_base; //保存默认选中商品图片
-						obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
-					}
-					obj.shopId = data.mer_id; //保存商店id
-					console.log('数据处理完毕');
-				});
-			}
-			// 获取秒杀商品信息
-			if (obj.goodsType == 1) {
-				obj.showAdd = false;
-				seckillGoods({}, this.goodsid).then(function({ data }) {
-					obj.list = data;
-					console.log(obj.list, '秒杀商品数据++++++++++');
-					obj.reply = data.reply; //保存评论列表
-					let goods = data.storeInfo;
-					if (goods.is_drop == 1) {
-						obj.showDrop = true;
-					}
-					obj.goodsNumberMax = goods.num;
-					console.log(obj.seckillObj, '数据');
-					obj.goodsObjact = goods;
-					if (obj.goodsObjact.description != null) {
-						obj.description = obj.goodsObjact.description.replace(/\<img/gi, '<img class="rich-img"');
-					} //小程序商品详情图超出屏幕问题
-					obj.imgList = goods.images; //保存轮播图
-					obj.specList = data.productAttr; //保存分类列表
-					if (Array.isArray(data.productValue) != true) {
-						console.log('多规格+++++++++++++');
-						obj.many = 2;
-						obj.specList = data.productAttr; //保存产品属性
-						obj.productValue = data.productValue; //保存属性值
-						obj.specSelected = []; //初始化默认选择对象
-						for (let i = 0; i < obj.specList.length; i++) {
-							// 设置默认数据
-							let attrValue = obj.specList[i].attr_value[0];
-							attrValue.check = true;
-							obj.specSelected.push(attrValue.attr);
-						}
-						let str = obj.specSelected.join(',');
-						console.log(str, 'str');
-						// 设置默认值
-						obj.actionPrice = obj.productValue[str].price;
-						// obj.goodsNumberMax = obj.productValue[str].quota;
-						// console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
-						obj.actionImage = obj.productValue[str].image;
-						obj.uniqueId = obj.productValue[str].unique;
-						obj.goodsStore = obj.productValue[str].stock;
-					} else {
-						console.log('单规格+++++++++++++');
-						obj.many = 1;
-						obj.productValue = data.productValue; //保存分类查询数据
-						obj.actionPrice = goods.price; //保存默认选中商品价格
-						obj.actionImage = goods.image_base; //保存默认选中商品图片
-						// obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
-						console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------');
-						obj.shopId = data.mer_id; //保存商店id
-					}
-				});
-			}
-		},
-		// 立即购买
-		buy() {
-			let obj = this;
-			// 创建传值对象
-			let data = {
-				cartNum: obj.goodsNumber, //商品数量
-				new: 1,
-				productId: obj.goodsid, //商品编号
-				uniqueId: obj.uniqueId,
-				is_drop: obj.is_drop ? 1 : 0
-			};
-
-			if (obj.type == 2) {
-				data.new = 0;
-			}
-			cartAdd(data)
-				.then(function(e) {
-					let da = e.data;
-					if (obj.type == 1) {
-						// 跳转到支付页
-						let a = obj.is_drop ? 1 : 0;
-						console.log(a);
-						uni.navigateTo({
-							url: '/pages/order/createOrder?id=' + da.cartId + '&isdrop=' + a
-						});
-					}
-					if (obj.type == 2) {
-						uni.showToast({
-							title: '成功加入购物车',
-							type: 'top',
-							duration: 2000,
-							icon: 'none'
-						});
-						obj.goodsDetail();
-					}
-					obj.toggleSpec();
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		},
-		// 阻止触发上级事件
-		stopPrevent() {},
-		callf() {
-			console.log('dianj');
-			this.show = true;
-		},
-		onTap() {
-			console.log(this.callf);
-
-			if (!this.callf) return;
-			this.closess();
-		},
-		closess() {
-			this.show = false;
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-/*  弹出层 */
-.popup {
-	position: fixed;
-	left: 0;
-	top: 0;
-	right: 0;
-	bottom: 0;
-	z-index: 99;
-	&.show {
-		display: block;
-
-		.mask {
-			animation: showPopup 0.2s linear both;
-		}
-
-		.layer {
-			animation: showLayer 0.2s linear both;
-		}
-	}
-
-	&.hide {
-		.mask {
-			animation: hidePopup 0.2s linear both;
-		}
-
-		.layer {
-			animation: hideLayer 0.2s linear both;
-		}
-	}
-
-	&.none {
-		display: none;
-	}
-
-	.mask {
-		position: fixed;
-		top: 0;
-		width: 100%;
-		height: 100%;
-		z-index: 1;
-		background-color: rgba(0, 0, 0, 0.4);
-	}
-
-	.layer {
-		position: fixed;
-		z-index: 99;
-		bottom: 0;
-		width: 100%;
-		min-height: 20vh;
-		border-radius: 10rpx 10rpx 0 0;
-		background-color: #fff;
-
-		.btn {
-			height: 66rpx;
-			line-height: 66rpx;
-			border-radius: 100rpx;
-			background: $uni-color-primary;
-			font-size: $font-base + 2rpx;
-			color: #fff;
-			margin: 30rpx auto 20rpx;
-		}
-	}
-
-	@keyframes showPopup {
-		0% {
-			opacity: 0;
-		}
-
-		100% {
-			opacity: 1;
-		}
-	}
-
-	@keyframes hidePopup {
-		0% {
-			opacity: 1;
-		}
-
-		100% {
-			opacity: 0;
-		}
-	}
-
-	@keyframes showLayer {
-		0% {
-			transform: translateY(120%);
-		}
-
-		100% {
-			transform: translateY(0%);
-		}
-	}
-
-	@keyframes hideLayer {
-		0% {
-			transform: translateY(0);
-		}
-
-		100% {
-			transform: translateY(120%);
-		}
-	}
-}
-/* 规格选择弹窗 */
-.attr-content {
-	padding: 25rpx 30rpx;
-
-	.a-t {
-		display: flex;
-
-		image {
-			width: 170rpx;
-			height: 170rpx;
-			flex-shrink: 0;
-			border-radius: 8rpx;
-		}
-
-		.right {
-			display: flex;
-			flex-direction: column;
-			padding-left: 24rpx;
-			font-size: $font-sm + 2rpx;
-			color: $font-color-base;
-			line-height: 42rpx;
-			width: 75%;
-			position: relative;
-			.right-img {
-				width: 37rpx;
-				height: 37rpx;
-				position: absolute;
-				right: 0;
-				top: 20rpx;
-				// background-color: red;
-			}
-			.price {
-				position: absolute;
-				bottom: 0;
-				font-size: $font-lg;
-				color: $uni-color-primary;
-				margin: 10rpx 0rpx;
-				font-size: 60rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #ef041f;
-				text {
-					font-size: 30rpx;
-				}
-			}
-
-			.name {
-				width: 350rpx;
-				font-size: 32rpx;
-				color: $font-color-dark;
-				height: 50rpx;
-				overflow: hidden;
-				text-overflow: ellipsis;
-				white-space: nowrap;
-				display: block;
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #1d2023;
-			}
-
-			.selected-text {
-				margin-right: 10rpx;
-			}
-		}
-	}
-
-	.attr-list {
-		display: flex;
-		flex-direction: column;
-		font-size: $font-base + 2rpx;
-		color: $font-color-base;
-		padding-top: 30rpx;
-		padding-left: 10rpx;
-	}
-
-	.item-list {
-		padding: 20rpx 0 0;
-		display: flex;
-		flex-wrap: wrap;
-
-		text {
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			background: #eee;
-			margin-right: 20rpx;
-			margin-bottom: 20rpx;
-			border-radius: 10rpx;
-			min-width: 60rpx;
-			height: 60rpx;
-			padding: 0 20rpx;
-			font-size: $font-base;
-			color: $font-color-dark;
-		}
-
-		.selected {
-			background: #fceff1;
-			color: #f35768;
-			border: 1px solid #f35768;
-		}
-	}
-}
-
-//默认商品底部高度
-.goodsBottom {
-	height: 160rpx;
-}
-page {
-	background: #f0f0f0;
-}
-//秒杀、拼团底部高度
-.contentBottomHeight {
-	background-color: #f8f8f8;
-	height: 130rpx;
-}
-//默认商品底部高度
-.goodsBottom {
-	height: 160rpx;
-}
-/deep/ .iconenter {
-	font-size: $font-base + 2rpx;
-	color: #888;
-}
-/deep/ .con_image {
-	width: 130rpx;
-	height: 130rpx;
-	display: inline-block;
-	padding: 15rpx;
-	image {
-		width: 100%;
-		height: 100%;
-	}
-}
-/* 商品详情中限制图片大小 */
-/deep/ .rich-img {
-	width: 100% !important;
-	height: auto;
-}
-.mun-box {
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-}
-
-.mask {
-	position: fixed;
-	top: 0;
-	left: 0;
-	width: 100%;
-	height: 100%;
-	z-index: 999;
-	background-color: rgba(0, 0, 0, 0.4);
-	image {
-		width: 100%;
-		height: 100%;
-		opacity: 0.8;
-	}
-}
+<template>
+	<view class="container">
+		<!-- 轮播图 -->
+		<top-swiper :imgList="imgList"></top-swiper>
+		<!-- 标题 -->
+		<view class="introduce-section" v-if="goodsType == 0">
+			<button class="shareDate" style="border: none;" @click="callf()">
+				<image class="share-img" src="../../static/icon/share.png"></image>
+			</button>
+			<view class="price-box">
+				<text class="price-tip">¥</text>
+				<view class="price">
+					{{ goodsObjact.price }}
+					<text class="m-price">¥{{ goodsObjact.ot_price }}</text>
+				</view>
+			</view>
+			<text class="title clamp2" v-if="goodsObjact.title">{{ goodsObjact.title }}</text>
+			<text class="title clamp2" v-else>{{ goodsObjact.store_name }}</text>
+		</view>
+		<view class="introduce-section" v-if="goodsType == 2">
+			<button class="shareDate" style="border: none;" @click="callf()">
+				<image class="share-img" src="../../static/icon/share.png"></image>
+			</button>
+			<view class="price-box-jf">
+				<!-- <text class="price-tip">¥</text> -->
+				<view class="price">
+					<image src="../../static/icon/jf.png" mode=""></image>
+					<text>{{goodsObjact.integral}}</text><text class="jf">积分</text>
+					<text class="m-price">¥{{ goodsObjact.ot_price }}</text>
+				</view>
+			</view>
+			<text class="title clamp2" v-if="goodsObjact.title">{{ goodsObjact.title }}</text>
+			<text class="title clamp2" v-else>{{ goodsObjact.store_name }}</text>
+		</view>
+		<!-- <product-content :goodsObjact="goodsObjact" v-if="!isSckill "></product-content> -->
+		<view class="good-title " v-if="isSckill">{{ goodsObjact.title }}</view>
+		<!-- 兑换说明 -->
+		<view class="dhsm" v-if="goodsType == 2">
+			<view class="title">
+				兑换说明
+			</view>
+			<view class="info">
+				兑换说明详细介绍兑换说明详细介绍兑换兑换说明详细介绍兑换说明详细介绍兑换兑换说明详细介绍兑换说明
+			</view>
+		</view>
+		<!-- 评价 -->
+		<estimate @navTo="navTo('/pages/product/reply?id=' + goodsObjact.product_id)" v-if="reply" :reply="reply"
+			:list="list"></estimate>
+		<!-- 规格信息 -->
+		<!-- <fresh-detail :goodsObjact="goodsObjact"></fresh-detail> -->
+		<!-- 图文详情 -->
+		<content-text :description="description"></content-text>
+		<!-- 底部高度撑开 -->
+		<view class="contentBottomHeight"></view>
+		<!-- 底部操作菜单 -->
+		<product-bottom @buy="buy" :goodsid="goodsid" @specOPne="specOPne" :showAdd="showAdd"></product-bottom>
+		<!-- 规格-模态层弹窗 -->
+		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
+			<!-- 遮罩层 -->
+			<view class="mask"></view>
+			<view class="layer attr-content" @click.stop="stopPrevent">
+				<view class="a-t">
+					<image :src="actionImage"></image>
+					<view class="right">
+						<text class="name clamp">{{ goodsObjact.store_name }}</text>
+						<view class="price">
+							<text>¥</text>
+							{{ actionPrice * goodsNumber }}
+						</view>
+						<image src="../../static/icon/del.png" mode="" class="right-img" @click="closes()"></image>
+					</view>
+				</view>
+				<view v-for="(item, index) in specList" :key="index" class="attr-list">
+					<text>选择{{ item.attr_name }}分类</text>
+					<view class="item-list">
+						<text v-for="(childItem, childIndex) in item.attr_value" :key="childIndex" class="tit"
+							:class="{ selected: childItem.check }" @click="selectSpec(childItem, item, index)">
+							{{ childItem.attr }}
+						</text>
+					</view>
+				</view>
+				<view class="mun-box">
+					<text>购买数量</text>
+					<view class="num">
+						<uni-number-box class="step" :isMin="true" :value="goodsNumber" :min="1" :max="goodsNumberMax"
+							@eventChange="numberChange"></uni-number-box>
+					</view>
+				</view>
+				<button class="btn" @click.stop="buy" v-show="buys_show">完成</button>
+				<button class="btn" style="background-color: #999999;" v-show="buys_shows">售罄</button>
+			</view>
+		</view>
+		<view class="mask" v-if="show">
+			<image @click="onTap" src="../../static/img/shareimg.png"></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		goodsDetail,
+		cartAdd,
+		seckillGoods,
+		getIntegraDetail
+	} from '@/api/product.js';
+	import {
+		mapState
+	} from 'vuex';
+	import store from '@/store/index.js';
+	import {
+		saveUrl
+	} from '@/utils/loginUtils.js';
+	// #ifdef H5
+	import {
+		weixindata
+	} from '@/utils/wxAuthorized';
+	// #endif
+	// 头部轮播图
+	import topSwiper from './common/topSwiper.vue';
+	// 标题
+	import productContent from './common/productContent.vue';
+	// 到货时间及优惠
+	import discounts from './common/discounts.vue';
+	// 规格信息
+	import freshDetail from './common/freshDetail.vue';
+	// 图文详情
+	import contentText from './common/contentText.vue';
+	// 底部按钮
+	import productBottom from './common/productBottom.vue';
+	// 猜你喜欢
+	import guessLike from './common/guessLike.vue';
+	// 评价
+	import estimate from './common/estimate.vue';
+	import {
+		timeComputed
+	} from '@/utils/rocessor.js';
+	import uniNumberBox from '@/components/uni-number-box.vue'
+	export default {
+		components: {
+			guessLike,
+			topSwiper,
+			productContent,
+			discounts,
+			freshDetail,
+			contentText,
+			productBottom,
+			estimate,
+			uniNumberBox
+		},
+		data() {
+			return {
+				showAdd: true, //是否显示加入购物车
+				show: false,
+				isSckill: false, //是否为秒杀
+				goodsStore: 0, //选中库存
+				specList: [],
+				buys_show: true,
+				buys_shows: false,
+				specSelected: [], //选中的分类
+				specClass: 'none', //显示隐藏弹窗
+				many: 1, //1是单规格  2是多规格
+				reply: '', //评论
+				list: '', //商品详情的数据
+				type: 1, //默认支付方式add为
+				goodsType: 0, //商品类型 0:普通,1:秒杀 ,2:积分
+				goodsNumber: 1, //购买数量
+				goodsid: '', //商品id
+				description: '', //商品描述
+				goodsObjact: {
+					percent: 1
+				}, //保存商品数据
+				//图片循环
+				imgList: [],
+				// 对比对象
+				actionPrice: 0, //默认选中商品价格
+				actionImage: '', //默认选中图片
+				good_list: '', //猜你喜欢列表
+				goodsNumberMax: 0, //最大可购买数量
+				goodsNumberMin: 0, //最小可购买数量
+				// 倒计时数据保存
+				seckillObj: {
+					stopTime: 0, //结束时间
+					stop: false, //是否结束
+					stopTimeH: 0, //小时
+					stopTimeM: 0, //分钟
+					stopTimeS: 0, //秒钟
+					stopTimeD: 0, //天
+					upTime: 0 //更新组件内部组件用
+				},
+				// 拼团数据保存
+				pink: {
+					id: '', //拼团编号
+					uid: '', //用户编号
+					people: '', //拼团人数
+					price: '', //拼团价格
+					stop_time: '', //拼团结束时间
+					nickname: '', //团长昵称
+					avatar: '', //团长头像
+					count: '', //拼团剩余人数
+					h: '', //时
+					i: '', //分
+					s: '' //秒
+				},
+				userInfo: ''
+			};
+		},
+		filters: {
+			parseIntTo(percent) {
+				percent = +percent * 100;
+				if (percent % 1 === 0) {
+					return percent;
+				} else {
+					percent = percent.toFixed(1);
+					return percent;
+				}
+			}
+		},
+		async onLoad(options) {
+			let obj = this;
+			obj.userInfo = uni.getStorageSync('userInfo');
+			//保存商品id
+			this.goodsid = options.id;
+			if(options.type) {
+				this.goodsType = options.type * 1;
+			}
+			
+			if (this.goodsType == 2) {
+				this.showAdd = false
+				console.log('不显示', this.showAdd)
+			}
+			console.log(this.goodsType, 'this.goodsTypethis.goodsTypethis.goodsTypethis.goodsType')
+			if (options.type == 1) {
+				obj.isSckill = true
+			}
+			// 判断有无人邀请
+			if (options.spread) {
+				// 存储邀请人
+				uni.setStorageSync('spread', options.spread);
+			}
+			saveUrl();
+			this.goodsDetail();
+			// 注册邀请信息
+			// #ifdef H5
+			let bool = uni.getStorageSync('weichatBrowser') || '';
+			if (bool) {
+				weixindata();
+			}
+			// #endif
+		},
+		computed: {
+			...mapState(['weichatObj', 'baseURL', 'urlFile'])
+		},
+		// 分享
+		onShareAppMessage(options) {
+			// 设置菜单中的转发按钮触发转发事件时的转发内容
+			let pages = getCurrentPages(); //获取加载的页面
+			let currentPage = pages[pages.length - 1]; //获取当前页面的对象
+			let url = currentPage.route; //当前页面url
+			let item = currentPage.options; //如果要获取url中所带的参数可以查看options
+			let shareObj = {
+				title: this.goodsObjact.store_name + '   价格:' + this.goodsObjact.price, // 默认是小程序的名称(可以写slogan等)
+				path: url + '?id=' + item.id + '&spread=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
+				imageUrl: this.goodsObjact.image,
+				success: function(res) {
+					// 转发成功之后的回调
+					if (res.errMsg == 'shareAppMessage:ok') {}
+				},
+				fail: function() {
+					// 转发失败之后的回调
+					if (res.errMsg == 'shareAppMessage:fail cancel') {
+						// 用户取消转发
+					} else if (res.errMsg == 'shareAppMessage:fail') {
+						// 转发失败,其中 detail message 为详细失败信息
+					}
+				}
+			};
+
+			return shareObj;
+		},
+		methods: {
+			//选择规格
+			selectSpec(item, arr, ind) {
+				arr.attr_value.forEach(function(e) {
+					e.check = false;
+				});
+				item.check = true;
+				let obj = this;
+				obj.specSelected[ind] = item.attr;
+				let str = obj.specSelected.join(',');
+				// 获取当前选中的对象
+				if (obj.productValue[str]) {
+					obj.buys_show = true;
+					obj.buys_shows = false;
+					obj.actionPrice = obj.productValue[str].price;
+					// obj.goodsNumberMax = obj.productValue[str].quota;
+					obj.actionImage = obj.productValue[str].image;
+					obj.uniqueId = obj.productValue[str].unique;
+					obj.goodsStore = obj.productValue[str].stock;
+				} else {
+					(obj.buys_show = false), (obj.buys_shows = true);
+				}
+				if (obj.goodsStore == 0) {
+					obj.buys_show = false;
+					obj.buys_shows = true;
+				}
+				obj.specSelected[ind] = item.attr;
+			},
+			// 打開彈窗
+			specOPne(type = 1) {
+				let obj = this;
+				obj.specClass = 'show';
+				obj.type = type
+			},
+			//规格弹窗开关
+			toggleSpec(str) {
+				if (this.specClass === 'show') {
+					this.specClass = 'hide';
+					setTimeout(() => {
+						this.specClass = 'none';
+					}, 250);
+				} else if (this.specClass === 'none') {
+					this.specClass = 'show';
+				}
+				// 保存当前购买类型
+				this.type = str;
+			},
+			//领取优惠券
+			Getcoupon() {
+				uni.navigateTo({
+					url: '/pages/coupon/getcoupon'
+				});
+			},
+			//详情页
+			navToDetailPage(item) {
+				let id = item.id;
+				uni.navigateTo({
+					url: '/pages/product/product?id=' + id
+				});
+			},
+			// 跳转页面
+			navTo(url) {
+				uni.navigateTo({
+					url: url
+				});
+			},
+			//加入购物车
+			Addcar(item) {
+				let obj = this;
+				cartAdd({
+						cartNum: '1', //商品数量
+						uniqueId: '', //商品标签
+						new: 0, //商品是否新增加到购物车1为不加入0为加入
+						mer_id: '',
+						productId: item.id //商品编号
+					})
+					.then(function(e) {
+						console.log(e,'ddddddddddddddd')
+						uni.showToast({
+							title: '成功加入购物车',
+							type: 'top',
+							duration: 500,
+							icon: 'none'
+						});
+
+						obj.goodsDetail();
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			goodsDetail() {
+				let obj = this;
+				// 获取普通商品信息
+				console.log('获取商品信息++++++++++++++')
+				console.log(obj.goodsType)
+				if (obj.goodsType == 0) {
+					console.log('获取普通商品信息++++++++++++++')
+					goodsDetail({}, this.goodsid).then(function({
+						data
+					}) {
+						obj.list = data;
+						console.log(obj.list, '普通商品数据')
+						obj.good_list = data.good_list; //保存猜你喜欢列表
+						obj.reply = data.reply; //保存评论列表
+						let goods = data.storeInfo;
+						obj.goodsObjact = goods;
+						if (obj.goodsObjact.description != null) {
+							obj.description = obj.goodsObjact.description.replace(/\<img/gi,
+								'<img class="rich-img"');
+						} //小程序商品详情图超出屏幕问题
+						obj.imgList = goods.slider_image; //保存轮播图
+						obj.specList = data.productAttr; //保存分类列表
+						if (Array.isArray(data.productValue) != true) {
+							obj.many = 2;
+							obj.specList = data.productAttr; //保存产品属性
+							obj.productValue = data.productValue; //保存属性值
+							obj.specSelected = []; //初始化默认选择对象
+							for (let i = 0; i < obj.specList.length; i++) {
+								// 设置默认数据
+								let attrValue = obj.specList[i].attr_value[0];
+								attrValue.check = true;
+								obj.specSelected.push(attrValue.attr);
+							}
+							let str = obj.specSelected.join(',');
+							console.log(str, 'str');
+							// 设置默认值
+							obj.actionPrice = obj.productValue[str].price;
+							obj.goodsNumberMax = obj.productValue[str].stock;
+							obj.actionImage = obj.productValue[str].image;
+							obj.uniqueId = obj.productValue[str].unique;
+							obj.goodsStore = obj.productValue[str].stock;
+						} else {
+							obj.many = 1;
+							obj.productValue = data.productValue; //保存分类查询数据
+							obj.actionPrice = goods.price; //保存默认选中商品价格
+							obj.actionImage = goods.image_base; //保存默认选中商品图片
+							obj.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
+							obj.shopId = data.mer_id; //保存商店id
+						}
+
+					});
+				}
+				if (obj.goodsType == 1) {
+					seckillGoods({}, this.goodsid).then(({
+						data
+					}) => {
+						obj.list = data;
+						console.log(obj.list, '秒杀商品数据++++++++++')
+						// obj.good_list = data.good_list; //保存猜你喜欢列表
+						obj.reply = data.reply; //保存评论列表
+						let goods = data.storeInfo;
+						obj.goodsNumberMax = goods.num
+						// console.log('obj.goodsNumberMin+++++++++',obj.goodsNumberMin)
+						const time = timeComputed(goods.stop_time * 1000);
+						obj.seckillObj = {
+							stop: time.tpye, //是否结束
+							stopTimeH: time.hours + time.day * 24, //小时
+							stopTimeM: time.minutes, //分钟
+							stopTimeS: time.seconds, //秒钟
+						}
+
+						console.log(obj.seckillObj, '数据');
+						// console.log(obj.seckillObj,'obj.seckillObj++++++++++++++++++++++')
+						obj.goodsObjact = goods;
+						if (obj.goodsObjact.description != null) {
+							obj.description = obj.goodsObjact.description.replace(/\<img/gi,
+								'<img class="rich-img"');
+						} //小程序商品详情图超出屏幕问题
+						obj.imgList = goods.images; //保存轮播图
+						obj.specList = data.productAttr; //保存分类列表
+						if (Array.isArray(data.productValue) != true) {
+							console.log('多规格+++++++++++++')
+							obj.many = 2;
+							obj.specList = data.productAttr; //保存产品属性
+							obj.productValue = data.productValue; //保存属性值
+							obj.specSelected = []; //初始化默认选择对象
+							for (let i = 0; i < obj.specList.length; i++) {
+								// 设置默认数据
+								let attrValue = obj.specList[i].attr_value[0];
+								attrValue.check = true;
+								obj.specSelected.push(attrValue.attr);
+							}
+							let str = obj.specSelected.join(',');
+							console.log(str, 'str');
+							// 设置默认值
+							obj.actionPrice = obj.productValue[str].price;
+							// obj.goodsNumberMax = obj.productValue[str].quota;
+							// console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
+							obj.actionImage = obj.productValue[str].image;
+							obj.uniqueId = obj.productValue[str].unique;
+							obj.goodsStore = obj.productValue[str].stock;
+						} else {
+							console.log('单规格+++++++++++++')
+							obj.many = 1;
+							obj.productValue = data.productValue; //保存分类查询数据
+							obj.actionPrice = goods.price; //保存默认选中商品价格
+							obj.actionImage = goods.image_base; //保存默认选中商品图片
+							// obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
+							console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------')
+							obj.shopId = data.mer_id; //保存商店id
+						}
+
+					})
+				}
+				if (obj.goodsType == 3) {
+					getIntegraDetail({}, this.goodsid).then(({
+						data
+					}) => {
+						obj.list = data;
+						console.log(obj.list, '积分商品数据++++++++++')
+						// obj.good_list = data.good_list; //保存猜你喜欢列表
+						obj.reply = data.reply; //保存评论列表
+						let goods = data.storeInfo;
+						obj.goodsNumberMax = goods.num
+						// console.log('obj.goodsNumberMin+++++++++',obj.goodsNumberMin)
+						// obj.seckillObj = timeComputed( goods.stop_time*1000);
+
+						// console.log(obj.seckillObj,'obj.seckillObj++++++++++++++++++++++')
+						obj.goodsObjact = goods;
+						if (obj.goodsObjact.description != null) {
+							obj.description = obj.goodsObjact.description.replace(/\<img/gi,
+								'<img class="rich-img"');
+						} //小程序商品详情图超出屏幕问题
+						obj.imgList = goods.images; //保存轮播图
+						obj.specList = data.productAttr; //保存分类列表
+						if (Array.isArray(data.productValue) != true) {
+							obj.many = 2;
+							obj.specList = data.productAttr; //保存产品属性
+							obj.productValue = data.productValue; //保存属性值
+							obj.specSelected = []; //初始化默认选择对象
+							for (let i = 0; i < obj.specList.length; i++) {
+								// 设置默认数据
+								let attrValue = obj.specList[i].attr_value[0];
+								attrValue.check = true;
+								obj.specSelected.push(attrValue.attr);
+							}
+							let str = obj.specSelected.join(',');
+							console.log(str, 'str');
+							// 设置默认值
+							obj.actionPrice = obj.productValue[str].price;
+							// obj.goodsNumberMax = obj.productValue[str].quota;
+							// console.log(obj.goodsNumberMax,'obj.goodsNumberMax++++++++++++')
+							obj.actionImage = obj.productValue[str].image;
+							obj.uniqueId = obj.productValue[str].unique;
+							obj.goodsStore = obj.productValue[str].stock;
+						} else {
+							obj.many = 1;
+							obj.productValue = data.productValue; //保存分类查询数据
+							obj.actionPrice = goods.price; //保存默认选中商品价格
+							obj.actionImage = goods.image_base; //保存默认选中商品图片
+							// obj.goodsNumberMax = goods.quota; //保存默认选中最大可购买商品数量
+							console.log(obj.goodsNumberMax, 'obj.goodsNumberMax---------------')
+							obj.shopId = data.mer_id; //保存商店id
+						}
+					})
+				}
+
+			},
+			// 立即购买
+			buy() {
+				let obj = this;
+				// 创建传值对象
+				let data = {
+					productId: obj.goodsid, //商品编号
+					cartNum: obj.goodsNumber, //商品数量
+					uniqueId: obj.uniqueId, //分类编号
+					new: 1,
+					secKillId: '',
+					integralId: '',
+				};
+				console.log(obj.goodsType, 'obj.goodsType77777777777777777777')
+				if(obj.type == 2) {
+					data.new = 0
+				}
+				cartAdd(data)
+					.then(function(e) {
+						let da = e.data;
+						if (obj.type == 1) {
+							// 跳转到支付页
+							console.log(obj.goodsType, 'this.goodsType456444444444444444')
+							uni.navigateTo({
+								url: '/pages/order/createOrder?id=' + da.cartId + '&goodsType=' + obj.goodsType
+							});
+						}
+						if (obj.type == 2) {
+							uni.showToast({
+								title: '成功加入购物车',
+								type: 'top',
+								duration: 2000,
+								icon: 'none'
+							});
+							obj.goodsDetail();
+						}
+						obj.toggleSpec()
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			// 阻止触发上级事件
+			stopPrevent() {},
+			//选择数量
+			numberChange(e) {
+				console.log(e)
+				this.goodsNumber = e.number
+			},
+			callf() {
+				this.show = true;
+			},
+			onTap() {
+				console.log(this.callf);
+
+				if (!this.callf) return;
+				this.close();
+			},
+			close() {
+				this.show = false;
+			},
+			closes() {
+				this.specClass = 'none';
+			},
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	/*  弹出层 */
+	.popup {
+		position: fixed;
+		left: 0;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		z-index: 99;
+
+		&.show {
+			display: block;
+
+			.mask {
+				animation: showPopup 0.2s linear both;
+			}
+
+			.layer {
+				animation: showLayer 0.2s linear both;
+			}
+		}
+
+		&.hide {
+			.mask {
+				animation: hidePopup 0.2s linear both;
+			}
+
+			.layer {
+				animation: hideLayer 0.2s linear both;
+			}
+		}
+
+		&.none {
+			display: none;
+		}
+
+		.mask {
+			position: fixed;
+			top: 0;
+			width: 100%;
+			height: 100%;
+			z-index: 1;
+			background-color: rgba(0, 0, 0, 0.4);
+		}
+
+		.layer {
+			position: fixed;
+			z-index: 99;
+			bottom: 0;
+			width: 100%;
+			min-height: 20vh;
+			border-radius: 10rpx 10rpx 0 0;
+			background-color: #fff;
+
+			.btn {
+				height: 66rpx;
+				line-height: 66rpx;
+				border-radius: 100rpx;
+				background: #6EAB4E;
+				font-size: $font-base + 2rpx;
+				color: #fff;
+				margin: 30rpx auto 20rpx;
+			}
+		}
+
+		@keyframes showPopup {
+			0% {
+				opacity: 0;
+			}
+
+			100% {
+				opacity: 1;
+			}
+		}
+
+		@keyframes hidePopup {
+			0% {
+				opacity: 1;
+			}
+
+			100% {
+				opacity: 0;
+			}
+		}
+
+		@keyframes showLayer {
+			0% {
+				transform: translateY(120%);
+			}
+
+			100% {
+				transform: translateY(0%);
+			}
+		}
+
+		@keyframes hideLayer {
+			0% {
+				transform: translateY(0);
+			}
+
+			100% {
+				transform: translateY(120%);
+			}
+		}
+	}
+
+	/* 规格选择弹窗 */
+	.attr-content {
+		padding: 25rpx 30rpx;
+	
+		.a-t {
+			display: flex;
+	
+			image {
+				width: 170rpx;
+				height: 170rpx;
+				flex-shrink: 0;
+				border-radius: 8rpx;
+				background-color: #eee;
+			}
+	
+			.right {
+				display: flex;
+				flex-direction: column;
+				padding-left: 24rpx;
+				font-size: $font-sm + 2rpx;
+				color: $font-color-base;
+				line-height: 42rpx;
+				width: 75%;
+				position: relative;
+				.right-img {
+					width: 37rpx;
+					height: 37rpx;
+					position: absolute;
+					right: 0;
+					top: 20rpx;
+					// background-color: red;
+				}
+				.price {
+					position: absolute;
+					bottom: 0;
+					font-size: $font-lg;
+					color: $uni-color-primary;
+					margin: 10rpx 0rpx;
+					font-size: 60rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #ef041f;
+					text {
+						font-size: 30rpx;
+					}
+				}
+	
+				.name {
+					width: 350rpx;
+					font-size: 32rpx;
+					color: $font-color-dark;
+					height: 50rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+					display: block;
+					font-size: 30rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #1d2023;
+				}
+	
+				.selected-text {
+					margin-right: 10rpx;
+				}
+			}
+		}
+	
+		.attr-list {
+			display: flex;
+			flex-direction: column;
+			font-size: $font-base + 2rpx;
+			color: $font-color-base;
+			padding-top: 30rpx;
+			padding-left: 10rpx;
+		}
+	
+		.item-list {
+			padding: 20rpx 0 0;
+			display: flex;
+			flex-wrap: wrap;
+	
+			text {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				background: #eee;
+				margin-right: 20rpx;
+				margin-bottom: 20rpx;
+				border-radius: 10rpx;
+				min-width: 60rpx;
+				height: 60rpx;
+				padding: 0 20rpx;
+				font-size: $font-base;
+				color: $font-color-dark;
+			}
+	
+			.selected {
+				background: #fceff1;
+				color: #f35768;
+				border: 1px solid #f35768;
+			}
+		}
+	}
+
+	//默认商品底部高度
+	.goodsBottom {
+		height: 160rpx;
+	}
+
+	page {
+		background: #f0f0f0;
+	}
+
+	//秒杀、拼团底部高度
+	.contentBottomHeight {
+		height: 120rpx;
+	}
+
+	//默认商品底部高度
+	.goodsBottom {
+		height: 160rpx;
+	}
+
+	/deep/ .iconenter {
+		font-size: $font-base + 2rpx;
+		color: #888;
+	}
+
+	/deep/ .con_image {
+		width: 130rpx;
+		height: 130rpx;
+		display: inline-block;
+		padding: 15rpx;
+
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	/* 商品详情中限制图片大小 */
+	/deep/ .rich-img {
+		width: 100% !important;
+		height: auto;
+	}
+
+	.cho-num {
+		margin: 20rpx 0;
+		width: 750rpx;
+		height: 83rpx;
+		background: #ffffff;
+		padding: 29rpx 24rpx 30rpx 25rpx;
+		font-size: 26rpx;
+		font-weight: 500;
+		color: #606972;
+	}
+
+	.row {
+		display: flex;
+		align-items: center;
+		position: relative;
+		padding: 0 30rpx;
+		height: 110rpx;
+		background: #fff;
+
+		.refund {
+			font-size: 30rpx;
+			color: $font-color-dark;
+			padding-left: 128rpx;
+		}
+
+		.noRefund {
+			font-size: 30rpx;
+			color: $font-color-light;
+			padding-left: 128rpx;
+		}
+
+		.tit {
+			flex-shrink: 0;
+			width: 120rpx;
+			font-size: 30rpx;
+			color: $font-color-dark;
+		}
+
+		.input {
+			flex: 1;
+			font-size: 30rpx;
+			color: $font-color-dark;
+			padding-left: 128rpx;
+
+			&.payColor {
+				color: $color-red;
+			}
+		}
+
+		.iconlocation {
+			font-size: 36rpx;
+			color: $font-color-light;
+		}
+	}
+
+	.shop-info {
+		width: 750rpx;
+		height: 140rpx;
+		margin: 20rpx 0;
+		padding: 28rpx 24rpx 22rpx 16rpx;
+		background-color: #fff;
+		display: flex;
+		position: relative;
+
+		.shop-logo {
+			width: 90rpx;
+			height: 90rpx;
+			border-radius: 50%;
+
+			// background-color: red;
+			// overflow: hidden;
+			image {
+				width: 90rpx;
+				height: 90rpx;
+			}
+		}
+
+		.shop-base {
+			padding-left: 15rpx;
+			// width: 376rpx;
+			width: 100%;
+			font-size: 24rpx;
+			font-weight: 500;
+			color: #999999;
+			line-height: 1;
+
+			.base-name {
+				padding-top: 14rpx;
+				font-size: 30rpx;
+				padding-bottom: 16rpx;
+				font-weight: 500;
+				color: #333333;
+			}
+		}
+
+		.shop-dis {
+			padding-top: 31rpx;
+			position: absolute;
+			font-size: 24rpx;
+			font-weight: 500;
+			color: #901b21;
+			// line-height: 140rpx;
+			right: 24rpx;
+
+			image {
+				padding-right: 5rpx;
+				width: 21rpx;
+				height: 21rpx;
+			}
+		}
+	}
+
+	.good-title {
+		background-color: #fff;
+		// height: 142rpx;
+		padding: 24rpx 19rpx 24rpx 34rpx;
+		line-height: 1.5;
+		font-size: 36rpx;
+		font-weight: 800;
+		color: #333333;
+	}
+
+	.introduce-section {
+		position: relative;
+		background: #fff;
+		padding: 35rpx 0rpx;
+		padding-left: 20rpx;
+
+		.title {
+			font-size: 32rpx;
+			color: $font-color-dark;
+			padding-right: 34rpx;
+
+			.tip-o {
+				color: #ff3334;
+				padding-left: 15rpx;
+			}
+		}
+
+		.shareDate {
+			position: absolute;
+			top: 25rpx;
+			right: 10rpx;
+			font-size: 26rpx;
+			color: #3d3f46;
+			border-radius: 15rpx;
+			background-color: #ffffff;
+			height: 60rpx;
+			line-height: 60rpx;
+
+			&::after {
+				border: none;
+			}
+		}
+
+		.share-img {
+			width: 30rpx;
+			height: 30rpx;
+			position: relative;
+			top: 5rpx;
+			left: 0;
+			margin-right: 10rpx;
+		}
+
+		.info {
+			color: #999999;
+			font-size: 26rpx;
+			padding-bottom: 15rpx;
+		}
+
+		.progress-box {
+			width: 260rpx;
+			position: relative;
+			margin-top: 15rpx;
+			line-height: 10px;
+
+			.number {
+				font-size: 17rpx;
+				position: absolute;
+				z-index: 999;
+				top: 3rpx;
+				left: 15rpx;
+				color: #ffffff;
+			}
+		}
+
+		.price-box {
+			display: flex;
+			align-items: baseline;
+			height: 64rpx;
+			padding: 10rpx 0;
+			font-size: 27rpx;
+			color: #FF0000;
+		}
+
+		.price {
+			font-size: $font-lg + 6rpx;
+
+			.text {
+				padding-left: 5rpx;
+				color: #b0b0b0;
+				font-size: 22rpx !important;
+			}
+		}
+
+		.price-green {
+			color: #2dbd59;
+			font-size: 28rpx !important;
+
+			text {
+				background: #2dbd59;
+				color: #ffffff;
+				padding: 0rpx 10rpx;
+				border-radius: 5rpx;
+				font-size: 22rpx !important;
+				margin-left: 15rpx;
+			}
+		}
+
+		.m-price {
+			margin: 0 12rpx;
+			color: $font-color-light;
+			text-decoration: line-through;
+			margin-left: 25rpx;
+			font-size: 24rpx;
+		}
+	}
+
+	.dhsm {
+		display: flex;
+		margin: 20rpx 0;
+		background-color: #fff;
+		padding: 34rpx 104rpx 30rpx 24rpx;
+
+		.title {
+			font-size: 32rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+			margin-right: 32rpx;
+			flex-shrink: 0;
+		}
+
+		.info {
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #8A8A8A;
+			line-height: 38rpx;
+		}
+	}
+
+	.price-box-jf {
+		color: #901b21;
+		display: flex;
+		align-items: baseline;
+		height: 64rpx;
+		font-size: 50rpx;
+		font-family: PingFang SC;
+		font-weight: 800;
+		color: #FF0000;
+
+		.price {
+			font-size: 50rpx;
+		}
+
+		image {
+			height: 30rpx;
+			width: 30rpx;
+		}
+
+		.jf {
+			font-size: 30rpx;
+
+		}
+	}
+	.mun-box {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+	.mask {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		z-index: 999;
+		background-color: rgba(0, 0, 0, 0.4);
+
+		image {
+			width: 100%;
+			height: 100%;
+			opacity: 0.8;
+		}
+	}
 </style>

+ 278 - 0
pages/product/reply.vue

@@ -0,0 +1,278 @@
+<template>
+	<view class="container">
+		<view class="reply_btn flex_item">
+			<view class="btn" v-for="(item, index) in navList" :key="index" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">
+				{{ item.text }}({{ item.number }})
+			</view>
+		</view>
+		<swiper :current="tabCurrentIndex" class="swiper-box" :style="{ height: maxheight + 'px' }" duration="300" @change="changeTab">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadDate">
+					<!-- 评论列表 -->
+					<view v-for="(item, index) in tabItem.orderList" :key="index" class="eva-box">
+						<view class="row-1 flex1">
+							<image class="portrait" :src="item.avatar" mode="aspectFill"></image>
+							<view class="right flex1">
+								<view>
+									<view class="name flex1">
+										<view>{{ item.nickname }}</view>
+										<!-- <image src="../../static/label/vip.png"></image> -->
+									</view>
+									<uniRate class="rate" disabled size="10" margin="1" :value="item.product_score" ></uniRate>
+								</view>
+								<view class="bot">
+									<text class="attr"></text>
+									<text class="time">{{ item.add_time }}</text>
+								</view>
+							</view>
+						</view>
+						<view class="con">{{ item.comment }}</view>
+						<view class="con_box">
+							<view class="con_image" v-for="ls in item.pics"><image :src="ls"></image></view>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+import { reply_config, reply_list } from '@/api/product.js';
+import uniRate from '@/components/uni-rate/uni-rate.vue';
+export default {
+	components: {
+		uniRate
+	},
+	watch: {},
+	data() {
+		return {
+			maxheight: '',
+			id: '', //商品id
+			list: '', //评论列表
+			reply: '', //评论配置
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 0,
+					text: '全部',
+					loadingType: 'more',
+					number: '',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 5 //每次信息条数
+				},
+				{
+					state: 1,
+					text: '好评',
+					loadingType: 'more',
+					number: '',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 5 //每次信息条数
+				},
+				{
+					state: 3,
+					text: '差评',
+					loadingType: 'more',
+					number: '',
+					orderList: [],
+					page: 1, //当前页数
+					limit:5 //每次信息条数
+				},
+				{
+					state: 2,
+					text: '中评',
+					loadingType: 'more',
+					number: '',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 5 //每次信息条数
+				}
+			]
+		};
+	},
+	computed: {},
+	onReady() {
+		// 初始化获取页面宽度
+		uni.createSelectorQuery()
+			.select('.container')
+			.fields(
+				{
+					size: true
+				},
+				data => {
+					// 保存头部高度
+					this.maxheight = data.height - Math.floor((data.width / 750) * 145);
+				}
+			)
+			.exec();
+	},
+	onLoad(option) {
+		this.id = option.id;
+	},
+	onShow() {
+		let obj = this;
+		reply_config({}, this.id).then(function({ data }) {
+			obj.reply = data;
+			obj.navList[0].number = obj.reply.sum_count;
+			obj.navList[1].number = obj.reply.good_count;
+			obj.navList[2].number = obj.reply.poor_count;
+			obj.navList[3].number = obj.reply.in_count;
+		});
+		this.loadDate();
+	},
+	methods: {
+		async loadDate(source) {
+			//这里是将订单挂载到tab列表下
+			let index = this.tabCurrentIndex;
+			let navItem = this.navList[index];
+			let state = navItem.state;
+			if (source === 'tabChange' && navItem.loaded === true) {
+				//tab切换只有第一次需要加载数据
+				return;
+			}
+			if (navItem.loadingType === 'loading') {
+				//防止重复加载
+				return;
+			}
+			if (navItem.loadingType === 'noMore') {
+				//防止重复加载
+				return;
+			}
+			// 修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+			reply_list(
+				{
+					type: state,
+					page: navItem.page,
+					limit: navItem.limit
+				},
+				this.id
+			)
+				.then(({ data }) => {
+					let arr = data;
+					navItem.orderList = navItem.orderList.concat(arr);
+					console.log(navItem.orderList,111)
+					navItem.page++;
+					if (navItem.limit == data.length) {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						navItem.loadingType = 'noMore';
+					}
+					this.$set(navItem, 'loaded', true);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		// async GetList(){
+		// 	let obj = this;
+		// 	reply_list({}, obj.id).then(function({ data }) {
+		// 		// console.log(data)
+		// 		obj.list = data;
+		// 	});
+		// },
+		//跳转接口
+		navTo(url) {
+			uni.navigateTo({
+				url
+			});
+		},
+		//swiper 切换
+		changeTab(e) {
+			this.tabCurrentIndex = e.target.current;
+			this.loadDate('tabChange');
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #ffffff;
+	height: 100%;
+	.container {
+		height: 100%;
+		padding: 25rpx 25rpx;
+		padding-top: 120rpx;
+		.swiper-box {
+			// height: 100%;
+			.list-scroll-content {
+				height: 100%;
+			}
+		}
+	}
+}
+.reply_btn {
+	padding: 15rpx 0rpx;
+	.btn {
+		padding: 10rpx 25rpx;
+		font-size: 24rpx;
+		background: #f4f4f4;
+		margin-right: 25rpx;
+	}
+	.current {
+		background-color: #e93323 !important;
+		color: #ffffff !important;
+	}
+}
+.eva-box {
+	padding: 20rpx 0;
+	// height: 100%;
+	.row-1{
+		.portrait {
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			border-radius: 100px;
+		}
+		.right {
+			flex: 1;
+			font-size: $font-base;
+			color: $font-color-base;
+			padding-left: 26rpx;
+			.name{
+				margin-bottom: 20rpx;
+				image{
+					width: 35rpx;
+					height: 25rpx;
+				}
+			}
+			.bot {
+				display: flex;
+				justify-content: space-between;
+				font-size: $font-sm;
+				color: $font-color-light;
+			}
+		}
+	}
+	.con {
+		font-size:24rpx;
+		font-weight:500;
+		color:rgba(84,84,86,1);
+		padding: 20rpx 0 35rpx 0;
+		letter-spacing: 3rpx;
+	}
+	.con_image {
+		width: 150rpx;
+		height: 150rpx;
+		display: inline-block;
+		margin-right: 20rpx;
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+}
+
+
+</style>

+ 452 - 0
pages/product/search.vue

@@ -0,0 +1,452 @@
+<template>
+	<view class="content">
+		<!-- 兼容小程序搜索 -->
+		<!-- #ifdef MP || APP-PLUS -->
+		<view class="vheight"></view>
+		<view class="input-box flex">
+			<view class=" input-content flex">
+				<view class="iconfont iconsearch"></view>
+				<view class="input"><input type="text" v-model="keyword" placeholder="请输入搜索内容" /></view>
+			</view>
+			<view class="input-button flex" @click="navTo"><text>搜索</text></view>
+		</view>
+		<!-- #endif -->
+		<swiper :current="tabCurrentIndex" class="swiper-box " duration="300">
+			<swiper-item class="search-hot">
+				<view class="title"><text>热门搜索</text></view>
+				<view class="hot-list">
+					<view @click="clickHotText(ls)" class="list-item" :key="ind" v-for="(ls, ind) in list">
+						<text>{{ ls }}</text>
+					</view>
+				</view>
+			</swiper-item>
+			<swiper-item class="search-hot position-relative">
+				<view class="navbar">
+					<view class="nav-item" @click="defaultSearch()">默认</view>
+					<view class="nav-item" :class="{ current: searchType === 1 }" @click="sortTab(1)">
+						<text>销量优先</text>
+						<view class="p-box">
+							<text :class="{ active: searchType === 1 && numberOrder === 1 }" class="iconfont iconfold"></text>
+							<text :class="{ active: searchType === 1 && numberOrder === 2 }" class="iconfont iconfold xia"></text>
+						</view>
+					</view>
+					<view class="nav-item" :class="{ current: searchType === 2 }" @click="sortTab(2)">
+						<text>价格</text>
+						<view class="p-box">
+							<text :class="{ active: searchType === 2 && priceOrder === 1 }" class="iconfont iconfold"></text>
+							<text :class="{ active: searchType === 2 && priceOrder === 2 }" class="iconfont iconfold xia"></text>
+						</view>
+					</view>
+					<view class="nav-item" :class="{ current: newOrder == 1 }" @click="newGoodsTab()">新品</view>
+				</view>
+				<scroll-view scroll-y class="cate-list" @scrolltolower='getProducts'>
+					<view class="guess-section">
+						<view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
+							<view class="image-wrapper"><image :src="item.image" mode="aspectFill"></image></view>
+							<text class="title clamp margin-c-20">{{ item.store_name }}</text>
+							<view class="cmy-hr"></view>
+							<view class="price margin-c-20 flex">
+								<view>
+									<text class="font-size-sm ">¥</text>
+									{{ item.price }}
+								</view>
+								<view class="font-size-sm">
+									<text class="font-color-gray">{{ item.sales }}人购买</text>
+								</view>
+							</view>
+						</view>
+					</view>
+					<uni-load-more :status="loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import { searchKeyword, getProducts } from '@/api/product.js';
+export default {
+	components: {
+		uniLoadMore
+	},
+	data() {
+		return {
+			arrlist: [], //热门关键词
+			keyword: '', //关键字
+			list: [], //搜索内容
+			tabCurrentIndex: 0, //切换
+			goodsList: [],
+			limit: 6, //每次加载数据条数
+			page: 1, //当前页数
+			loadingType: 'more', //加载更多状态
+			numberOrder: 1, //1 销量从低到高 2销量从高到低
+			priceOrder: 1, //1 价格从低到高 2价格从高到低
+			newOrder: 0, //0 不是新品 1是新品
+			searchType: 0 //0为默认查询 1为销量 2 为价格
+		};
+	},
+	// #ifndef MP
+	//点击导航栏 buttons 时触发
+	onNavigationBarButtonTap(e) {
+		const index = e.index;
+		if (index === 0) {
+			this.navTo();
+		}
+	},
+	// 点击键盘搜索事件
+	onNavigationBarSearchInputConfirmed(e) {
+		this.navTo();
+	},
+	// 搜索栏内容变化事件
+	onNavigationBarSearchInputChanged(e) {
+		this.keyword = e.text;
+	},
+	// #endif
+	onLoad() {
+		this.loadData();
+	},
+	//下拉刷新
+		onPullDownRefresh() {
+			this.page = 1
+			this.getProducts('refresh');
+		},
+	methods: {
+		// 加载商品
+		async getProducts(type, loading) {
+			let obj = this;
+			// 判断是否为加载数据
+			if (type !== 'refresh') {
+				//没有更多数据直接跳出方法
+				if (obj.loadingType === 'nomore') {
+					return;
+				} else {
+					// 设置当前为数据载入中
+					obj.loadingType = 'loading';
+				}
+			} else {
+				//当重新加载数据时更新状态为可继续添加数据
+				obj.loadingType = 'more';
+			}
+			let data = {
+				page: obj.page,
+				limit: obj.limit,
+				news: obj.newOrder,
+				keyword: this.keyword
+			};
+			// 判断是否为销售数量排序
+			if (this.searchType === 1) {
+				data.salesOrder = obj.numberOrder === 1 ? 'asc' : 'desc';
+			}
+			// 判断是否为金额排序
+			if (this.searchType === 2) {
+				data.priceOrder = obj.priceOrder === 1 ? 'asc' : 'desc';
+			}
+			getProducts(data).then(e => {
+				if (type === 'refresh') {
+					obj.goodsList = [];
+				}
+				obj.goodsList = obj.goodsList.concat(e.data);
+				//判断是否还有下一页,有是more  没有是nomore
+				if (obj.limit == e.data.length) {
+					obj.page++;
+					obj.loadingType = 'more';
+				} else {
+					obj.loadingType = 'nomore';
+				}
+				// 判断是否为刷新数据
+				if (type === 'refresh') {
+					// 判断是否为点击搜索按钮跳转加载
+					if (loading == 1) {
+						uni.hideLoading();
+					} else {
+						uni.stopPullDownRefresh();
+					}
+				}
+			});
+		},
+		// 点击关键词触发事件
+		clickHotText(e) {
+			this.keyword = e;
+			this.navTo();
+		},
+		// 加载搜索关键字
+		async loadData() {
+			searchKeyword({})
+				.then(e => {
+					this.list = e.data;
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		// 点击触发搜索事件
+		navTo() {
+			this.tabCurrentIndex = 1;
+			this.infoData()
+		},
+		// 默认搜索
+		defaultSearch() {
+			// 初始化查询
+			this.numberOrder = '';
+			this.priceOrder = '';
+			this.newOrder = 0;
+			this.searchType = 0;
+			this.infoData();
+		},
+		// 是否为新品
+		newGoodsTab() {
+			this.newOrder = this.newOrder === 1 ? 0 : 1;
+			this.infoData();
+		},
+		// 排序
+		sortTab(nub) {
+			this.searchType = nub;
+			if (this.searchType === 1) {
+				this.numberOrder = this.numberOrder === 1 ? 2 : 1;
+			}
+			if (this.searchType === 2) {
+				this.priceOrder = this.priceOrder === 1 ? 2 : 1;
+			}
+			this.infoData();
+		},
+		// 查询切换后初始化
+		infoData() {
+			// 初始化页数
+			this.page = 1;
+			// 初始化数组
+			uni.pageScrollTo({
+				duration: 300,
+				scrollTop: 0
+			});
+			// 加载数据
+			this.getProducts('refresh', 1);
+			uni.showLoading({
+				title: '正在加载'
+			});
+		},
+		navToDetailPage(item) {
+			//测试数据没有写id,用title代替
+			let id = item.id;
+			uni.navigateTo({
+				url: '/pages/product/product?id=' + id
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page,
+.content {
+	height: 100%;
+	background-color: $page-color-base;
+}
+/* #ifdef MP || APP-PLUS */
+.vheight{
+	height: var(--status-bar-height);
+	background-color: #FFFFFF;
+}
+.input-box {
+	padding: 25rpx;
+	background-color: #ffffff;
+	height: 44px;
+	.iconsearch {
+		font-size: 50rpx;
+	}
+	.input-content {
+		border-radius: 99rpx;
+		flex-grow: 1;
+		padding: 10rpx 30rpx;
+		background-color: rgba(231, 231, 231, 0.7);
+		.input {
+			flex-grow: 1;
+			input {
+				font-size: $font-lg;
+			}
+		}
+	}
+	.input-button {
+		padding-left: 20rpx;
+		font-size: $font-lg;
+		height: 100%;
+	}
+}
+/* #endif */
+
+.swiper-box {
+	/* #ifndef MP */
+	height: 100%;
+	/* #endif */
+	/* #ifdef MP */
+	height: calc(100% - 44px);
+	/* #endif */
+	.search-hot {
+		padding: 25rpx;
+		.title {
+			font-size: $font-lg;
+			color: $font-color-light;
+		}
+		.hot-list {
+			display: flex;
+			flex-wrap: wrap;
+			margin-top: 30rpx;
+			.list-item {
+				padding: 10rpx 20rpx;
+				border: 1px solid $border-color-dark;
+				color: $font-color-dark;
+				font-size: $font-base;
+				margin-right: 20rpx;
+				margin-bottom: 20rpx;
+			}
+		}
+	}
+}
+
+// 订单
+%icon {
+	margin-right: 10rpx;
+	display: inline-block;
+	padding: 2rpx 10rpx;
+	border: 1rpx solid $color-yellow;
+	color: $color-yellow;
+	line-height: 1;
+	font-size: $font-base;
+	border-radius: 10rpx;
+}
+.guess-section {
+	display: flex;
+	flex-wrap: wrap;
+	.guess-item {
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+		width: 48%;
+		margin-bottom: 4%;
+		border-radius: $border-radius-sm;
+		background-color: white;
+		box-shadow: $box-shadow;
+		&:nth-child(2n + 1) {
+			margin-right: 4%;
+		}
+	}
+	.image-wrapper {
+		width: 100%;
+		height: 330rpx;
+		border-radius: 3px;
+		overflow: hidden;
+		image {
+			width: 100%;
+			height: 100%;
+			opacity: 1;
+		}
+	}
+	.title {
+		font-size: $font-base;
+		color: $font-color-dark;
+		font-weight: bold;
+		line-height: 80rpx;
+	}
+	.price {
+		font-size: $font-lg;
+		color: $font-color-base;
+		font-weight: bold;
+		line-height: 1;
+		line-height: 80rpx;
+	}
+
+	.icon {
+		@extend %icon;
+	}
+
+	.detail {
+		line-height: 1;
+	}
+	.tip {
+		color: white;
+		background-color: $color-yellow;
+		line-height: 1.5;
+		font-size: $font-sm;
+		padding-left: 20rpx;
+	}
+}
+
+.navbar {
+	position: absolute;
+	top: 0;
+	left: 0;
+	display: flex;
+	width: 100%;
+	height: 40px;
+	background: #fff;
+	box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
+	z-index: 10;
+	.nav-item {
+		flex: 1;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		font-size: 30rpx;
+		color: $font-color-dark;
+		position: relative;
+		&.current {
+			color: $base-color;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 120rpx;
+				height: 0;
+				border-bottom: 4rpx solid $base-color;
+			}
+		}
+	}
+	.p-box {
+		display: flex;
+		flex-direction: column;
+		.iconfont {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 30rpx;
+			height: 14rpx;
+			line-height: 1;
+			margin-left: 4rpx;
+			font-size: 26rpx;
+			color: #888;
+			&.active {
+				color: $base-color;
+			}
+		}
+		.xia {
+			transform: scaleY(-1);
+		}
+	}
+	.cate-item {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		width: 80rpx;
+		position: relative;
+		font-size: 44rpx;
+		&:after {
+			content: '';
+			position: absolute;
+			left: 0;
+			top: 50%;
+			transform: translateY(-50%);
+			border-left: 1px solid #ddd;
+			width: 0;
+			height: 36rpx;
+		}
+	}
+}
+.cate-list {
+	height: 100%;
+	padding-top: 40px;
+}
+</style>

+ 17 - 4
pages/public/login.vue

@@ -1,7 +1,11 @@
 <template>
 	<view class="container">
 		<view class="container_text">
+<<<<<<< HEAD
 			<image class="banner-img" src="/static/img/login.png" mode="scaleToFill">
+=======
+			<image class="banner-img" src="/static/img/logo.png" mode="scaleToFill">
+>>>>>>> 9120b76f6c258133d586d998575baec28e13fae4
 		</image>
 		</view>
 		<view class="loginTitle"><text>登录</text></view>
@@ -23,11 +27,16 @@
 				<view class="fenge"></view>
 			</view> -->
 			<!-- #ifndef APP-PLUS -->
+<<<<<<< HEAD
 			<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
 			<!-- <view class="weixin_text" @click="wecahtLogin">微信登录</view> -->
+=======
+			<!-- <view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
+			<view class="weixin_text" @click="wecahtLogin">微信登录</view> -->
+>>>>>>> 9120b76f6c258133d586d998575baec28e13fae4
 			<!-- #endif -->
 			<!-- #ifdef APP-PLUS -->
-			<block v-if="!is_ios">
+			<!-- <block v-if="!is_ios">
 				<view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png" mode="scaleToFill"></image></view>
 				<!-- <view class="weixin_text" @click="wecahtLogin">微信登录</view> -->
 			</block>
@@ -40,7 +49,7 @@
 					<image class="loginIcon" src="/static/icon/appleIcon.png" mode=" scaleToFill"></image>
 					<text class="weixin_text">通过Apple登录</text>
 				</view>
-			</block>
+			</block> -->
 			<!-- #endif -->
 		</view>
 	</view>
@@ -294,7 +303,11 @@ page {
 	width: 100%;
 	height: 500rpx;
 	top: 0rpx;
+<<<<<<< HEAD
 	
+=======
+	// background-color: #6EAB4E;
+>>>>>>> 9120b76f6c258133d586d998575baec28e13fae4
 	.banner-img {
 		width: 100%;
 		height: 100%;
@@ -369,10 +382,10 @@ page {
 		border-radius: 10rpx;
 	}
 	.uni-button-green-plain {
-		border: 1px solid #ff4c4c;
+		border: 1px solid #6EAB4E;
 		margin: 40rpx 10rpx;
 		border-radius: 50rpx;
-		color: #ff4c4c;
+		color: #6EAB4E;
 		background-color: #ffffff;
 	}
 	.uni-button {

+ 121 - 40
pages/public/register.vue

@@ -1,35 +1,57 @@
 <template>
 	<view class="container">
 		<view class="container_text" >
-			<!-- <image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image> -->
+			<image class="banner-img" src="/static/img/logo.png" mode="scaleToFill"></image>
 		</view>
 		<view class="loginTitle"><text>注册</text></view>
 		<view class="login_text">
 			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img03.png"></image></view>
-				<view class="login_name"><input class="uni-input" v-model="phone" focus placeholder="请输入账号" /></view>
+				<view class="login_img"><image src="/static/icon/phone.png"></image></view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="phone" focus placeholder="请输入账号" /></view>
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/pread.png"></image></view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入接点人id" :disabled="isinvitation" /></view>
 			</view>
 			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
+				<view class="login_img"><image src="/static/icon/psw.png"></image></view>
 				<view class="login_name"><input class="uni-input" type="password" v-model="password" focus placeholder="请输入密码" /></view>
 			</view>
 			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img04.png"></image></view>
+				<view class="login_img"><image src="/static/icon/psw.png"></image></view>
 				<view class="login_name"><input class="uni-input" type="password" v-model="repassword" focus placeholder="请重复输入密码" /></view>
 			</view>
 			<view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img07.png"></image></view>
-				<view class="login_name"><input class="uni-input" type="text" v-model="invitation" focus placeholder="请输入邀请码" /></view>
-			</view>
-			<!-- <view class="login_input flex">
-				<view class="login_img"><image src="/static/icon/img06.png"></image></view>
+				<view class="login_img"><image src="/static/icon/code.png"></image></view>
 				<view class="login_name flex">
 					<input class="uni-input width" v-model="code" focus placeholder="请输入验证码" />
 					<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
 				</view>
-			</view> -->
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/dw.png"></image></view>
+				<picker v-if="!isparent_area" @change="bindParentArea" :value="parent_area" :range="parent_areas" class="uni-input">
+					<view class="placeholder" v-if="parent_area === ''">请选择区域</view>
+					<text>{{ parent_area }}</text>
+				</picker>
+				<view class="login_name" v-else><input class="uni-input" type="text" v-model="parent_area" focus disabled /></view>
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/dw.png"></image></view>
+				<picker @change="bindPayType" :value="pay_type" :range="pay_types" class="uni-input">
+					<view class="placeholder" v-if="pay_type === ''">请选择支付方式</view>
+					<text>{{ pay_type }}</text>
+				</picker>
+			</view>
+			<view class="login_input flex">
+				<view class="login_img"><image src="/static/icon/jft.png"></image></view>
+				<view class="uni-input" style="color: #999;">
+					是否使用积分抵扣
+					<image src="../../static/icon/noselect.png" mode="" v-if="!isSelsect" @click="jfdk(1)"></image>
+					<image src="../../static/icon/select.png" mode="" v-if="isSelsect" @click="jfdk(0)"></image>
+				</view>
+			</view>
 			<view><button type="green" @click="register" class="uni-button uni-button-green">注册账号</button></view>
-			<view><button class="uni-button uni-button-green uni-button-green-plain" type="green" plain="true" hover-class="none" @click="login">返回登录</button></view>
 		</view>
 	</view>
 </template>
@@ -41,15 +63,31 @@ export default {
 			phone: '', //用户
 			password: '', //密码
 			repassword: '',
-			invitation: '', //邀请码
+			invitation: '', //接点人id
 			code: '', //验证码
 			time: '', //保存倒计时对象
-			countDown: 0 ,//倒计时
+			countDown: 0 ,//倒计时
+			parent_area: '',//区域
+			parent_areas: ['A','B','C'],//区域列表
+			pay_type: '',
+			pay_types: ['微信','余额','佣金'],
+			isSelsect: false,
+			isinvitation: false,
+			isparent_area: false,
 		};
 	},
-	onLoad() {
+	onLoad(option) {
+		if(option.id){
+			this.invitation = option.id
+			console.log(this.invitation)
+			this.isinvitation = true;
+		}
+		if(option.area){
+			this.parent_area = option.area
+			this.isparent_area = true
+		}
 		// 获取扫码邀请人id
-		this.invitation = uni.getStorageSync('spread')||'';
+		// this.invitation = uni.getStorageSync('spread')||'';
 	},
 	watch: {
 		// 监听倒计时
@@ -59,7 +97,30 @@ export default {
 			}
 		}
 	},
-	methods: {
+	methods: {
+		//选择是否积分抵扣
+		jfdk(index) {
+			if(index == 1) {
+				this.isSelsect = true
+			}else {
+				this.isSelsect = false
+			}
+		},
+		//选择区域
+		bindParentArea(e) {
+			console.log(e.detail.value)
+			this.parent_area = this.parent_areas[e.detail.value]
+		},
+		//选择值支付方式
+		bindPayType(e) {
+			console.log(e)
+			if(e.detail.value) {
+				this.pay_type = this.pay_types[e.detail.value]
+			}else if(e.detail.value == 0){
+				this.pay_type = this.pay_types[e.detail.value]
+			}
+			
+		},
 		// 注册
 		register() {
 			let obj = this;
@@ -67,10 +128,6 @@ export default {
 				obj.$api.msg('请输入账号');
 				return;
 			}
-			// if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.phone)) {
-			// 	obj.$api.msg('请输入正确的手机号');
-			// 	return;
-			// }
 			if (obj.password == '') {
 				obj.$api.msg('请输入密码');
 				return;
@@ -82,20 +139,36 @@ export default {
 			if (obj.repassword != obj.password) {
 				obj.$api.msg('两次密码不正确');
 				return;
+			}
+			if(obj.code == '') {
+				obj.$api.msg('请输入验证吗');
+				return;
+			}
+			if(obj.parent_area == '') {
+				obj.$api.msg('请选择区域');
+				return;
+			}
+			if(obj.pay_type == '') {
+				obj.$api.msg('请选择支付方式');
+				return;
+			}
+			let paytype = ''
+			if(obj.pay_type == '微信') {
+				paytype = 'weixin'
+			}else if(obj.pay_type == '余额') {
+				paytype = 'yue'
+			}else if(obj.pay_type == '佣金') {
+				paytype = 'brokerage'
 			}
-			// if ((obj.invitation = '')) {
-			// 	obj.$api.msg('请输入邀请码');
-			// 	return;
-			// }
-			// if (obj.code == '') {
-			// 	obj.$api.msg('请输入验证码');
-			// 	return;
-			// }
 			register({
 				account: obj.phone, //账号
-				// captcha: obj.code, //验证码
+				captcha: obj.code, //验证码
 				password: obj.password ,//密码
-				spread:this.invitation//上级推广人
+				parent: obj.invitation,//接点人uid
+				parent_area: obj.parent_area,//区域
+				pay_type: paytype,
+				use_integral: obj.isSelsect ? '1':'0',
+				from: 'APP'
 			}).then(function(e) {
 				uni.showToast({
 					title:'注册成功',
@@ -104,12 +177,12 @@ export default {
 				});
 				setTimeout(function () {
 					uni.navigateTo({
-						url: '/pages/public/login'
+						url: '/pages/user/user'
 					});
 				},1000)
-				
-			});
-			//调用注册接口,成功跳转登录页
+			}).catch( err => {
+				console.log(err)
+			})
 		},
 		//发送验证码
 		verification() {
@@ -158,13 +231,14 @@ page {
 .container {
 	width: 100%;
 	height: 100%;
-	background-size: 100%;
+	background-size: 100%;
+	background-color: #fff;
 }
 .container_text {
 	width: 100%;
 	height: 500rpx;
 	top: 0rpx;
-	background-color: #FF4343;
+	// background-color: #FF4343;
 	.banner-img {
 		width: 100%;
 		height: 100%;
@@ -175,7 +249,7 @@ page {
 	position: relative;
 	padding: 100rpx 102rpx;
 	background-color: #ffffff;
-	margin-top: -180rpx;
+	// margin-top: -180rpx;
 	border-radius: 20rpx;
 	.login_input {
 		border-bottom: 1px solid #f0f0f0;
@@ -188,7 +262,14 @@ page {
 		.uni-input {
 			text-align: left;
 			width: 470rpx;
-			font-size: 28rpx !important;
+			font-size: 28rpx !important;
+			position: relative;
+			image {
+				width: 30rpx;
+				height: 30rpx;
+				position: absolute;
+				right: 0;
+			}
 		}
 		.login_name {
 			color: #333333;
@@ -232,7 +313,7 @@ page {
 		color: #ffffff;
 		background-color:  $base-color;
 		margin: 40rpx 10rpx;
-		border-radius: 50rpx;
+		border-radius: 10rpx;
 	}
 	.uni-button-green-plain {
 		border: 1px solid  $base-color;

+ 122 - 0
pages/redirect/redirect.vue

@@ -0,0 +1,122 @@
+<template>
+	<view>
+	</view>
+</template>
+<script>
+import { getUserInfo } from '@/api/user.js';
+import { mapMutations,mapState } from 'vuex';
+// #ifdef H5
+import { wechatAuth } from '@/api/wx';
+// #endif
+// #ifdef MP-WEIXIN
+import { wechatMpAuth } from '@/api/wx';
+// #endif
+export default {
+	computed: {
+		...mapState('user',['urlFile'])
+	},
+	onLoad(option) {
+		let obj = this;
+		// 判断是否需要保存定向地址
+		// #ifdef H5
+		this.loadH5()
+		// #endif
+		// #ifdef MP-WEIXIN
+		this.loadMp(option)
+		// #endif
+	},
+	methods: {
+		...mapMutations('user',['login', 'setUserInfo']),
+		// #ifdef H5
+		loadH5() {
+			let obj = this;
+			let url = window.location.href;
+			let code = url.match(/code=([0-9]|[a-z]|[A-Z])*/g)[0].replace('code=', '');
+			let spread = uni.getStorageSync('spread')||'';
+			wechatAuth({
+				code: code,
+				spread:spread,
+			}).then(({ data }) => {
+				obj.wchatAuth(data);
+			}).catch((e) => {
+				uni.showModal({
+					title: '错误',
+					content: JSON.stringify(e),
+					showCancel: false,
+				});
+			});;
+		},
+		// #endif
+		// #ifdef MP-WEIXIN
+		loadMp(option) {
+			let obj = this;
+			// 获取登录授权页数据
+			let user = obj.$api.prePage().userInfo;
+			// #ifndef MP
+			// 获取推广人id
+			let spread_spid = uni.getStorageSync('spread') || '';
+			// #endif
+			// #ifdef MP
+			// 小程序推广人
+			let spread_code = uni.getStorageSync('spread_code') || '';
+			// #endif
+			wechatMpAuth({
+				code: option.code,
+				iv: user.target.iv,
+				encryptedData: user.target.encryptedData,
+				// #ifndef MP
+				spread_spid: spread_spid,
+				// #endif
+				// #ifdef MP
+				spread_code:spread_code
+				// #endif
+			}).then(({ data }) => {
+				obj.wchatAuth(data);
+			}).catch((e) => {
+				uni.showModal({
+					title: '错误',
+					content: JSON.stringify(e),
+					showCancel: false,
+				});
+			});
+		},
+		// #endif
+		wchatAuth(data) {
+			let obj = this;
+			// 保存token
+			uni.setStorageSync('token', data.token);
+			// 获取用户基础信息
+			getUserInfo({}).then(e => {
+				obj.login();
+				// 保存返回用户数据
+				obj.setUserInfo(e.data);
+				let ur = uni.getStorageSync('present')|| '/pages/index/index';
+				// 用于处理缓存bug
+				if (ur=='pages/product/product') {
+					ur = '/pages/index/index'
+				}
+				uni.switchTab({
+					url: ur,
+					fail(e) {
+						uni.navigateTo({
+							url: ur,
+							fail(e) {
+								uni.navigateTo({
+									url: '/pages/index/index',
+								});
+							}
+						});
+					}
+				});
+			}).catch((e) => {
+				uni.showModal({
+					title: '错误',
+					content: JSON.stringify(e),
+					showCancel: false,
+				});
+			});;
+		}
+	}
+};
+</script>
+<style></style>

+ 21 - 18
pages/set/userinfo.vue

@@ -38,9 +38,9 @@
   	</view>
   	<view class="row b-b flex" v-if="userInfo.account || userInfo.phone">
   		<text class="tit">用户账号</text>
-  		<input class="input" v-model="userInfo.account || userInfo.phone" type="number" disabled="true" placeholder-class="placeholder" />
+  		<input class="input" v-model="userInfo.account || userInfo.phone" type="number" disabled="true" placeholder-class="placeholder" style="color: #999;"/>
   	</view>
-  	<view class="submit-box flex" >
+  	<view class="submit-box" >
   		<view class="submit" @click="edit">确认修改</view>
   		<view class="submit" @click="toLogout">退出登录</view>
   	</view>
@@ -52,7 +52,7 @@
   import uniList from '@/components/uni-list/uni-list.vue';
   import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
   import { mapState, mapMutations } from 'vuex';
-  import { logout } from '@/api/set.js';
+  import { logout } from '@/api/set.js';
 
   import {
   		uploads,edit,upload
@@ -64,7 +64,7 @@
   	},
   	data() {
   		return {
-  			userInfo:{},
+  			userInfo:{},
 			pics:[],
   		};
   	},
@@ -94,25 +94,28 @@
   				}
   			});
   		},
-  		imgsub() {
-			let obj = this
-			upload({
-				filename: ''
-			}).then(res => {
-				console.log(res[0].url)
-				obj.userInfo.avatar = res[0].url
+  		imgsub() {
+			let obj = this
+			upload({
+				filename: ''
+			}).then(res => {
+				console.log(res[0].url)
+				obj.userInfo.avatar = res[0].url
 			});
   		},
   		edit() {
-  			const that = this;
-			uni.showLoading({
-				title: '提交中...',
-				mask:true
-			})
+  			const that = this;
+			uni.showLoading({
+				title: '提交中...',
+				mask:true
+			})
+			if(this.userInfo.nickname == '') {
+				return this.$api.msg('昵称不能为空!')
+			}
   			edit({
   				avatar: this.userInfo.avatar,
   				nickname: this.userInfo.nickname
-  			}).then( e =>{
+  			}).then( e =>{
 				uni.hideLoading()
   				that.$api.msg('修改成功');
   				setTimeout(()=> {
@@ -191,7 +194,7 @@
   		.submit{
   			margin: 40rpx auto;
   			width: 560rpx;
-  			background-color: #ff4c4b;
+  			background-color: #6EAB4E;
   			color: #FFFFFF;
   			text-align: center;
   			padding:26rpx 0rpx;

+ 1 - 9
pages/story/story.vue

@@ -131,12 +131,6 @@
 					//防止重复加载
 					return;
 				}
-				if (source == 'tabChange') {
-					uni.showLoading({
-						title: "加载中...",
-						mask: true
-					})
-				}
 				navItem.loadingType = 'loading';
 				article({
 					page: navItem.page,
@@ -144,9 +138,7 @@
 				}, navItem.cid).then(({
 					data
 				}) => {
-					if (source == 'tabChange' && navItem.loaded != false) {
-						uni.hideLoading()
-					}
+					
 					console.log(data)
 					let list = data.map(item => {
 						return item

+ 361 - 0
pages/user/award.vue

@@ -0,0 +1,361 @@
+<template>
+	<view class="content">
+		<view class="content-money">
+			<view class="money-box">
+				<image src="../../static/img/img33.png" mode=""></image>
+				<view class="money">
+					<text>¥</text>
+					{{ money | getMoneyStyle }}
+				</view>
+				<view class="transfer" @click="navto('/pages/user/transfer')">
+					佣金转账
+				</view>
+			</view>
+		</view>
+		<view class="navbar">
+			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+		</view>
+		<swiper :current="tabCurrentIndex" :style="{ height: maxheight + 'px' }" class="swiper-box" duration="300" @change="changeTab">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
+					<!-- 空白页 -->
+					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+					<!-- 订单列表 -->
+					<view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index" @click="showItem(item)">
+						<view class="title-box">
+							<view class="title">
+								<text>{{ item.title }} </text>
+								<!-- <text>{{item.status == 0 ? (' ' + ' ' + ' (冻结中)'):''}}</text> -->
+							</view>
+							<view class="time">
+								<text>{{ item.add_time }}</text>
+							</view>
+						</view>
+						<view class="money">
+							<text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+		<view class="moneyTx" ><view class="btn" @click="navto('./withdrawal')">提现</view></view>
+	</view>
+</template>
+
+<script>
+import { getSpreadCount } from '@/api/user.js';
+import { spreadCommission, userBalance } from '@/api/wallet.js';
+import { mapState, mapMutations } from 'vuex';
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	components: {
+		empty,
+		uniLoadMore
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	onReady() {
+		//初始化获取页面宽度
+		uni.createSelectorQuery()
+			.select('.content')
+			.fields(
+				{
+					size: true
+				},
+				data => {
+					console.log(data);
+					console.log(Math.floor((data.width / 750) * 300));
+					//保存头部高度
+					this.maxheight = data.height - Math.floor((data.width / 750) * 570);
+					console.log(this.maxheight);
+				}
+			)
+			.exec();
+	},
+	data() {
+		return {
+			// 头部图高度
+			maxheight: '',
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 0,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页面
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 1,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页面
+					limit: 10 //每次信息条数
+				}
+			],
+			money: ''
+		};
+	},
+	onLoad(options) {},
+	onShow() {
+		this.loadData();
+		//获取用户余额
+		getSpreadCount({}, 3).then(({ data }) => {
+			console.log(data);
+			this.money = data.count;
+		});
+		// userBalance({}).then(({ data }) => {
+		// 	this.money = data.orderStatusSum;
+		// });
+	},
+	methods: {
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		},
+		async loadData(source) {
+			//这里时将订单挂载到tab列表下
+			let index = this.tabCurrentIndex;
+			let navItem = this.navList[index];
+			let state = navItem.state + 3;
+			if (source === 'tabChange' && navItem.loaded === true) {
+				//tab切换只有第一次需要加载数据
+				return;
+			}
+			if (navItem.loadingType === 'loading') {
+				//防止重复加载
+				return;
+			}
+			//修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+
+			spreadCommission(
+				{
+					page: navItem.page,
+					limit: navItem.limit
+				},
+				state
+			)
+				.then(({ data }) => {
+					if (data.length > 0) {
+						navItem.orderList = navItem.orderList.concat(data[0].list);
+						console.log(navItem.orderList);
+						navItem.page++;
+					}
+					//判断是否还有数据, 有改为more, 没有改为noMore
+					if (navItem.limit == data.length) {
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						navItem.loadingType = 'noMore';
+					}
+					uni.hideLoading();
+					this.$set(navItem, 'loaded', true);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		//swiper 切换
+		changeTab(e) {
+			this.tabCurrentIndex = e.target.current;
+			this.loadData('tabChange');
+		},
+		//顶部tab点击
+		tabClick(index) {
+			this.tabCurrentIndex = index;
+		},
+		showItem(item) {
+			uni.showModal({
+				title: '佣金明细',
+				content: item.mark,
+				showCancel: false
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #ffffff;
+	height: 100%;
+}
+.content-money {
+	padding-bottom: 30rpx;
+	background: $page-color-base;
+	.buttom-box {
+		background-color: #ffffff;
+		text-align: center;
+		margin: 0 30rpx;
+		padding: 20rpx 0;
+		border-radius: $border-radius-sm;
+		margin-top: -60rpx;
+		.buttom {
+			font-size: $font-lg;
+			flex-grow: 1;
+		}
+		.interval {
+			width: 2px;
+			height: 60rpx;
+			background-color: #eeeeee;
+		}
+		.icon {
+			height: 50rpx;
+			width: 48rpx;
+			margin: 0 auto;
+			.icon-img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+}
+.money-box {
+	// background-color: $base-color;
+	// padding-top: var(--status-bar-height);
+	height: 400rpx;
+	color: #3F7C1F;
+	text-align: center;
+	position: relative;
+	.transfer {
+		width: 147rpx;
+		line-height: 56rpx;
+		background: #fff;
+		box-shadow: 0px 3rpx 8rpx 0px rgba(0, 0, 0, 0.17);
+		border-radius: 7rpx 0px 0px 7rpx;
+		position: absolute;
+		right: 0;
+		bottom: 210rpx;
+		z-index: 10;
+		font-size: 28rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #FF0000;
+	}
+	image {
+		position: absolute;
+		top: 0;
+		right: 0;
+		height: 100%;
+		width: 100%;
+		// z-index: 1;
+	}
+	.text {
+		padding-top: 147rpx;
+		font-size: $font-sm;
+		position: relative;
+	}
+	.money {
+		padding-top: 175rpx;
+		// margin: auto 0;
+		font-size: 56rpx;
+		font-weight: bold;
+		color: #3F7C1F;
+		position: relative;
+		.money-icon {
+			font-size: 38rpx;
+			font-weight: bold;
+			color: #3F7C1F;
+		}
+	}
+}
+
+.navbar {
+	display: flex;
+	height: 40px;
+	padding: 0 5px;
+	background: #fff;
+	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+	position: relative;
+	z-index: 10;
+	.nav-item {
+		flex: 1;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		font-size: 15px;
+		color: $font-color-dark;
+		position: relative;
+		&.current {
+			color: $base-color;
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid $base-color;
+			}
+		}
+	}
+}
+//列表
+
+.swiper-box {
+	padding-top: 10rpx;
+	.order-item {
+		padding: 20rpx 30rpx;
+		line-height: 1.5;
+		.title-box {
+			.title {
+				font-size: $font-lg;
+				color: $font-color-base;
+			}
+			.time {
+				font-size: $font-base;
+				color: $font-color-light;
+			}
+		}
+		.money {
+			color: #fd5b23;
+			font-size: $font-lg;
+		}
+	}
+}
+.list-scroll-content {
+	height: 100%;
+}
+.content {
+	height: 100%;
+	.empty-content {
+		background-color: #ffffff;
+	}
+}
+.moneyTx {
+	width: 750rpx;
+	height: 88rpx;
+	background-color: #fff;
+	.btn {
+		margin: 0 auto;
+		width: 674rpx;
+		height: 88rpx;
+		line-height: 88rpx;
+		background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
+		border-radius: 44rpx;
+		font-size: 36rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #ffffff;
+	}
+	position: fixed;
+	bottom: 51rpx;
+	right: 0;
+	left: 0;
+	text-align: center;
+	margin: 0 auto;
+}
+</style>

+ 0 - 261
pages/user/balance.vue

@@ -1,261 +0,0 @@
-<template>
-	<view class="container">
-		<!-- 头部 -->
-		<view class="header">
-			<image src="../../static/img/img33.png" mode="scaleToFill"></image>
-			<!-- 钱 -->
-			<view class="money">
-				<view class="fuhao">¥</view>
-				<view class="counts">3852</view>
-			</view>
-		</view>
-		<!-- 收入和支出 -->
-		<view class="navbar">
-			<view class="nav-item" v-for="(item, index) in navList" :key="index"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
-
-		</view>
-		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
-			>
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
-				<!-- 空白页 -->
-				<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
-				<!-- 推广奖励 -->
-				<scroll-view class="scorll" scroll-y="true" >
-					<view class="cost">
-						<view class="award" v-for="item in 10">
-							<view class="award-left">
-								<view class="text">充值到账</view>
-								<view class="time">2021-8-26 09:30</view>
-							</view>
-							<view class="award-right">+200</view>
-						</view>
-					</view>
-				</scroll-view>
-
-			</swiper-item>
-		</swiper>
-		<view class="btm">
-			<view class="btn" @click="nav('/pages/user/withdraw')">立即提现</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				height: '',
-				tabCurrentIndex: 0,
-				navList: [{
-						state: 1,
-						text: '收入',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 2,
-						text: '支出',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					}
-				],
-				list: [],
-				money: ''
-			}
-		},
-		methods: {
-			nav (url) {
-				uni.navigateTo({
-					url
-				})
-			},
-			// back(){
-			// 	uni.navigateBack({
-			// 		delta:1
-			// 	})
-			// },
-			// handclick () {
-			// 	console.log(123)
-			// },
-			//swiper 切换
-			changeTab(e) {
-				this.tabCurrentIndex = e.target.current;
-				this.loadData('tabChange')
-			},
-			//顶部tab点击
-			tabClick(index) {
-				this.tabCurrentIndex = index;
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.container {
-		width: 750rpx;
-		height: 1334rpx;
-		background-color: #f1f1f1;
-
-		.header {
-			position: relative;
-			image {
-				width: 750rpx;
-				height: 400rpx;
-			}
-		}
-		
-			.text {
-				width: 112rpx;
-				height: 27rpx;
-				font-size: 28rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #FF0000;
-				padding-top: 8rpx;
-				margin-left: 18rpx;
-			}
-
-		.money {
-			top: 0;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			position: absolute;
-			padding-left: 246rpx;
-			padding-top: 200rpx;
-
-			.fuhao {
-				font-size: 45rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #3F7C1F;
-				padding-top: 25rpx;
-			}
-
-			.counts {
-				font-size: 70rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #3F7C1F;
-			}
-		}
-
-		.swiper-box {
-			height: calc(100% - 700rpx);
-			background-color: #FFFFFF;
-		}
-		.scorll {
-			height: 100%;
-		}
-		.navbar {
-			display: flex;
-			height: 100rpx;
-			padding: 0 5rpx;
-			background: #fff;
-			box-shadow: 0 1rpx 5rpx rgba(0, 0, 0, 0.06);
-			position: relative;
-			z-index: 10;
-			margin-top: 25rpx;
-
-			.nav-item {
-				flex: 1;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				height: 100%;
-				font-size: 15px;
-				color: #999999;
-				position: relative;
-
-				&.current {
-					color: #333333;
-
-					&:after {
-						content: '';
-						position: absolute;
-						left: 50%;
-						bottom: 0;
-						transform: translateX(-50%);
-						width: 44px;
-						height: 0;
-						border-bottom: 2px solid #3F7C1F;
-					}
-				}
-			}
-		}
-
-		.cost {
-			width: 750rpx;
-			height: auto;
-			background-color: #fff;
-
-			.award {
-				width: 701rpx;
-				height: 132rpx;
-				border-bottom: 1px solid #F0F4F8;
-				margin-left: 25rpx;
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-
-				.award-left {
-					width: 221rpx;
-					height: 40rpx;
-					margin-left: 30rpx;
-					margin-bottom: 35rpx;
-
-					.text {
-						width: 182rpx;
-						height: 30rpx;
-						font-size: 30rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #666666;
-						margin-bottom: 16rpx;
-					}
-
-					.time {
-						width: 221rpx;
-						height: 20rpx;
-						font-size: 26rpx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #AEAEAE;
-					}
-				}
-
-				.award-right {
-					width: 82rpx;
-					height: 27rpx;
-					font-size: 36rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #FF0000;
-					margin-right: 30rpx;
-				}
-			}
-		}
-		.btm {
-			background-color: #fff;
-			height: 190rpx;
-			padding-top: 40rpx;
-			display: flex;
-			justify-content: center;
-			.btn {
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				width: 674rpx;
-				height: 88rpx;
-				background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
-				border-radius: 44rpx;
-			}
-		}
-	}
-</style>
-	

+ 458 - 0
pages/user/extension.vue

@@ -0,0 +1,458 @@
+ <template>
+ 	<view class="content">
+ 		<view class="content-money">
+ 			<view class="money-box">
+ 				<image class="tuiguang_bg" src="../../static/image/jiedian.png"></image>
+ 			 <view class="money-frame">
+ 				 <view class="money_num">
+ 					{{userInfo.spread_count || '0'}}
+ 					<text class="money_ren">人</text>
+ 				</view>
+ 			 </view>
+ 			</view>
+ 			<view class="flex buttom-box">
+ 				<view class="buttom"  @click="tabClick(0)">
+ 					<view class="money">{{total || 0}}</view>
+ 					<text class="text" :class="{ current: tabCurrentIndex === 0 }">一级推广</text>
+ 				</view>
+ 				<view class="buttom"  @click="tabClick(1)">
+ 					<view class="money">{{totalLevel || 0}}</view>
+ 					<text class="text" :class="{ current: tabCurrentIndex === 1 }">二级推广</text>
+ 				</view>
+ 			</view>
+ 		</view>
+ 		<swiper :current="tabCurrentIndex" :style="{ height: maxheight + 'px' }" class="swiper-box" duration="300" @change="changeTab">
+ 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<!-- <view class="tg-wrapper">
+					<view class="tg-box">
+						<view class="tg-item">
+							<view class="tg-tit">
+								会员
+							</view>
+							<view class="tg-val">
+								10人
+							</view>
+						</view>
+						<view class="tg-jg"></view>
+						<view class="tg-item">
+							<view class="tg-tit">
+								店长
+							</view>
+							<view class="tg-val">
+								10人
+							</view>
+						</view>
+						<view class="tg-jg"></view>
+						<view class="tg-item">
+							<view class="tg-tit">
+								代理
+							</view>
+							<view class="tg-val">
+								10人
+							</view>
+						</view>
+					</view>
+				</view> -->
+ 				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
+ 					<!-- 空白页 -->
+ 					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+ 
+ 					<!-- 订单列表 -->
+ 					<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item flex">
+ 						<view class="title-box flex_item">
+ 							<view class="title-avatar"><image :src="item.avatar"></image></view>
+ 							<view class="list_tpl">
+ 								<view class="time">
+ 									<text>{{ item.time }}</text>
+ 								</view>
+ 							</view>
+ 						</view>
+ 					</view>
+ 					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+ 				</scroll-view>
+ 			</swiper-item>
+ 		</swiper>
+ 	</view>
+ </template>
+ <script>
+ import { getExtensionData,getUserInfo ,getSpreadPeople} from '@/api/user.js';
+ import { mapState, mapMutations } from 'vuex';
+ import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+ import empty from '@/components/empty';
+ export default {
+ 	components: {
+ 		empty,
+ 		uniLoadMore,
+ 	},
+ 	onReady() {
+ 		// 初始化获取页面宽度
+ 		uni.createSelectorQuery()
+ 			.select('.content')
+ 			.fields(
+ 				{
+ 					size: true
+ 				},
+ 				data => {
+ 					// console.log(data);
+ 					// console.log(Math.floor((data.width / 750) * 300));
+ 					// 保存头部高度
+ 					this.maxheight = data.height - Math.floor((data.width / 750) * 470) - 44;
+ 					// console.log(this.maxheight);
+ 				}
+ 			)
+ 			.exec();
+ 	},
+ 	data() {
+ 		return {
+ 			// 头部图高度
+ 			maxheight: '',
+ 			tabCurrentIndex: 0,
+ 			navList: [
+ 				{
+ 					state: 0,
+ 					text: '一级推广',
+ 					loadingType: 'more',
+ 					orderList: [],
+ 					page: 1, //当前页数
+ 					limit: 10 //每次信息条数
+ 				},
+ 				{
+ 					state: 1,
+ 					text: '二级推广',
+ 					loadingType: 'more',
+ 					orderList: [],
+ 					page: 1, //当前页数
+ 					limit: 10 //每次信息条数
+ 				}
+ 			],
+ 			all:'',
+ 			list:'',
+ 			total:'',
+ 			totalLevel:'',
+ 			img:'http://kaifa.crmeb.net/uploads/attach/2019/08/20190807/723adbdd4e49a0f9394dfc700ab5dba3.png',
+			userInfo: {}
+ 		};
+ 	},
+ 	onLoad(options) {},
+ 	onShow() {
+ 		this.loadData();
+		this.loadAll()
+ 	},
+ 	methods: {
+ 		// 页面跳转
+ 		navto(e) {
+ 			uni.navigateTo({
+ 				url: e
+ 			});
+ 		},
+ 		//获取推广人数信息
+ 		async loadData(source) {
+ 			//这里是将订单挂载到tab列表下
+ 			let index = this.tabCurrentIndex;
+ 			let navItem = this.navList[index];
+ 			let state = navItem.state;
+ 			if (source === 'tabChange' && navItem.loaded === true) {
+ 				//tab切换只有第一次需要加载数据
+ 				return;
+ 			}
+ 			if (navItem.loadingType === 'loading') {
+ 				//防止重复加载
+ 				return;
+ 			}
+ 			if (navItem.loadingType === 'noMore') {
+ 				//防止重复加载
+ 				return;
+ 			}
+ 			// 修改当前对象状态为加载中
+ 			navItem.loadingType = 'loading';
+ 			getSpreadPeople(
+ 				{
+ 					page: navItem.page,
+ 					limit: navItem.limit,
+ 					keyword:'',
+					// sort: 'ASC/DESC',
+					// level: index,
+ 					// sort:'uid desc'
+					// sort: 'pay_price ASC'
+ 					grade:state
+ 				},
+ 			)
+ 				.then(({ data }) => {
+ 					console.log(data);
+ 					
+ 					this.total = data.total;
+ 					this.totalLevel =data.totalLevel;
+ 					// this.all = this.total + this.totalLevel;
+ 					if (data.list.length > 0) {
+ 						this.list = data.list;
+ 						navItem.orderList = navItem.orderList.concat(data.list);
+ 						navItem.page++;
+ 					}
+ 					this.$nextTick(function(){
+ 						if (navItem.limit == data.list.length) {
+ 							//判断是否还有数据, 有改为 more, 没有改为noMore
+ 							navItem.loadingType = 'more';
+ 							return;
+ 						} else {
+ 							//判断是否还有数据, 有改为 more, 没有改为noMore
+ 							navItem.loadingType = 'noMore';
+ 						}
+ 					})
+ 					this.$set(navItem, 'loaded', true);
+ 				})
+ 				.catch(e => {
+ 					console.log(e);
+ 				});
+ 		},
+ 		//swiper 切换
+ 		changeTab(e) {
+ 			this.tabCurrentIndex = e.target.current;
+ 			this.loadData('tabChange');
+ 		},
+ 		//顶部tab点击
+ 		tabClick(index) {
+ 			this.tabCurrentIndex = index;
+ 		},
+ 		// 点击返回 我的页面
+ 		toBack(){
+ 			uni.switchTab({
+ 				url:'/pages/user/user'
+ 			})
+ 		},
+		loadAll(){
+			getUserInfo().then(res => {
+				this.userInfo = res.data
+				console.log(res,'6666666666666666666')
+			});
+		}
+ 	}
+ };
+ </script>
+ 
+ <style lang="scss">
+ page {
+ 	background: #ffffff;
+ 	height: 100%;
+ }
+ .content-money {
+ 	// padding-bottom: 30rpx;
+ 	background: $page-color-base;
+ 	.buttom-box {
+ 		position: relative;
+ 		background-color: #ffffff;
+ 		text-align: center;
+ 		padding: 30rpx 0;
+ 		.buttom {
+ 			flex-grow: 1;
+ 		}
+ 		.money{
+ 			
+ 			font-size: 32rpx;
+ 			font-weight: bold;
+ 			color: #3F7C1F;
+ 		}
+ 		.text {
+ 			padding-bottom: 26rpx;
+ 			font-size: 28rpx;
+ 			font-weight: 500;
+ 			color: #666666;
+ 			&.current {
+ 				border-bottom: 2px solid #3F7C1F;
+ 			}
+ 		}
+ 		.icon {
+ 			height: 50rpx;
+ 			width: 48rpx;
+ 			margin: 0 auto;
+ 			.icon-img {
+ 				width: 100%;
+ 				height: 100%;
+ 			}
+ 		}
+ 	}
+ }
+ .money-box {
+ 	// background: $base-color;
+ 	height: 380rpx;
+ 	color: #FF4C4C;
+ 	text-align: center;
+ 	font-size: 35rpx;
+ 	position: relative;
+ 	// padding-top: 60rpx;
+ 	.header{
+ 		position: absolute;
+ 		left: 0;
+ 		top: 0;
+ 		width: 100%;
+ 		height: 80rpx;
+ 		font-size: 36rpx;
+ 		font-weight: bold;
+ 		z-index: 99;
+ 		display: flex;
+ 		justify-content: center;
+ 		align-items: center;
+ 	}
+ 	.goback-box{
+ 		position: absolute;
+ 		left: 29rpx;
+ 		top: 0;
+ 		height: 80rpx;
+ 		display: flex;
+ 		align-items: center;
+ 	}
+ 	.goback{
+ 		z-index: 100;
+ 		width: 34rpx;
+ 		height: 34rpx;
+ 	}
+ 	.tuiguang_bg {
+ 		width: 100%;
+ 		height: 400rpx;
+ 		position: relative;
+ 	}
+ 	.money_img{
+ 		width: 100%;
+ 		height: 120rpx;
+ 		text-align: center;
+ 		padding-top: 50rpx;
+ 		padding-bottom: 135rpx;
+ 		image{
+ 			width:120rpx;
+ 			height: 120rpx;
+ 			border: 4rpx solid #FD5F6F;
+ 			border-radius: 50%;
+ 		}
+ 	}
+ 	.money-frame {
+ 		position: absolute;
+ 		top: 0;
+ 		width: 100%;
+ 		padding-top: 120rpx;
+ 		// left: 30rpx;
+ 		// height: 460rpx;
+ 		// display: flex;
+ 		// align-items: flex-start;
+ 		// flex-direction: column;
+ 		// justify-content: center;
+ 	}
+ 	.money_name{
+ 		width: 100%;
+ 		text-align: center;
+ 		font-size: 32rpx;
+ 		font-family: PingFang SC;
+ 		font-weight: bold;
+ 		color: #FFFFFF;
+ 		
+ 	}
+ 	.money_num {
+		padding-top: 50rpx;
+ 		font-size: 72rpx;
+ 		font-family: PingFang SC;
+ 		font-weight: bold;
+ 		color: #3F7C1F;
+ 		.money_ren {
+ 			font-size: 36rpx;
+ 		}
+ 	}
+ }
+ 
+ // 列表
+ 
+ .swiper-box {
+ 	// padding-top: 10rpx;
+ 	.order-item {
+ 		padding: 20rpx 30rpx;
+ 		line-height: 1.5;
+ 		.title-box {
+ 			width: 100%;
+ 			.title-avatar{
+ 				width: 100rpx;
+ 				height: 100rpx;
+ 				margin-right: 25rpx;
+ 				image{
+ 					width: 100%;
+ 					height: 100%;
+ 					border-radius: 100%;
+ 				}
+ 			}
+ 			.list_tpl{
+ 				width: 85%;
+ 				.title {
+ 					font-size: $font-lg;
+ 					color: $font-color-base;
+ 					overflow:hidden;            //超出的文本隐藏
+ 					text-overflow:ellipsis;     //溢出用省略号显示
+ 					white-space:nowrap;
+					 justify-content: flex-start;
+					image {
+						margin-left: 9rpx;
+						width: 147rpx;
+						height: 32rpx;
+					}
+ 				}
+ 				.time {
+ 					margin-top: 15rpx;
+ 					font-size: 22rpx;
+ 					color: $font-color-light;
+ 				}
+ 			}
+ 		}
+ 		.money {
+ 			color: #DB1935;
+ 			font-size: $font-lg;
+ 		}
+ 	}
+ }
+ .list-scroll-content {
+ 	height: 100%;
+ }
+ .content {
+ 	height: 100%;
+ 	.empty-content {
+ 		background-color: #ffffff;
+ 	}
+ }
+ .tg-wrapper {
+	width: 100%;
+	background-color: #f7f7f7;
+	
+	padding: 20rpx 0;
+	.tg-box {
+		display: flex;
+		justify-content: center;
+		width: 690rpx;
+		height: 143rpx;
+		background-color: #fff;
+		margin: 0 auto;
+		align-items: center;
+		.tg-item {
+			width: 33%;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			.tg-tit {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				
+			}
+			.tg-val {
+				padding-top: 15rpx;
+				font-size: 34rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				
+			}
+		}
+		.tg-jg {
+			width: 1rpx;
+			height: 51rpx;
+			background: #DDDDDD;
+		}
+	}
+ }
+ </style>
+ 

+ 202 - 144
pages/user/integral.vue

@@ -3,190 +3,248 @@
 		<!-- 头部 -->
 		<view class="header">
 			<image src="../../static/img/img38.png" mode="scaleToFill"></image>
-			<view class="money">3852</view>
+			<view class="money">{{+integralAll || 0}}</view>
 		</view>
 		<!-- 收入和支出 -->
 		<view class="navbar">
-			<view class="nav-item" v-for="(item, index) in navList" :key="index"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
-		
+			<view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
 		</view>
-		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
-			>
+		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab" :style="{'height':height}">
 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
 				<!-- 空白页 -->
-				<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
+				<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
 				<!-- 推广奖励 -->
-				<scroll-view class="scorll" scroll-y="true" >
+				<scroll-view class="scorll" scroll-y="true" :style="{'height':height}">
 					<view class="cost">
-						<view class="award" v-for="item in 10">
+						<view class="award" v-for="item in tabItem.orderList">
 							<view class="award-left">
-								<view class="text">消费赠送</view>
-								<view class="time">2021-8-26 09:30</view>
+								<view class="text clamp">{{ item.mark }}</view>
+								<view class="time">{{ item.add_time }}</view>
 							</view>
-							<view class="award-right">+200</view>
+							<view class="award-right">{{ item.pm == 1 ? '+' : '-' }}{{ item.number }}</view>
 						</view>
 					</view>
 				</scroll-view>
-		
+				<uni-load-more :status="tabItem.loadingType"></uni-load-more>
 			</swiper-item>
 		</swiper>
-	</view>
-</template>
-
+	</view>
+</template>
+
 <script>
+// 组件
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+//接口
+import { integral } from '@/api/wallet.js';
+import { getUserInfo } from '@/api/user.js';
 export default {
-	data () {
+	components: {
+		empty,
+		uniLoadMore
+	},
+	data() {
 		return {
 			height: '',
-				tabCurrentIndex: 0,
-				navList: [{
-						state: 1,
-						text: '收入',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 2,
-						text: '支出',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					}
-				],
-				list: [],
-				money: ''
-		}
+			tabCurrentIndex: 0,
+			navList: [
+				{
+					state: 1,
+					text: '收入',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 0,
+					text: '支出',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				}
+			],
+			list: [],
+			// money: '',
+			integralAll: '',//当前积分
+		};
+	},
+	onLoad() {
+		this.loadData();
+		this.userinfo()
+	},
+	onReady(res) {
+		var _this = this;
+		uni.getSystemInfo({
+			success: resu => {
+				const query = uni.createSelectorQuery();
+				query.select('.swiper-box').boundingClientRect();
+				query.exec(function(res) {
+					_this.height = resu.windowHeight - res[0].top + 'px';
+					console.log('打印页面的剩余高度', _this.height);
+				});
+			},
+			fail: res => {}
+		});
 	},
 	methods: {
+		//加载用户信息
+		userinfo() {
+			getUserInfo({}).then(({ data }) => {
+				this.integralAll = data.integral;
+			});
+		},
 		//swiper 切换
-		changeTab (e) {
+		changeTab(e) {
 			this.tabCurrentIndex = e.target.current;
-			this.loadData('tabChange')
+			this.loadData('tabChange');
 		},
 		//顶部tab点击
 		tabClick(index) {
 			this.tabCurrentIndex = index;
-		}
-	}
-}
-</script>
-
-<style lang="scss">
-	.container {
-		width: 750rpx;
-		height: 1334rpx;
-		background-color: #f1f1f1;
-		.header {
-			image {
-				width: 750rpx;
-				height: 400rpx;
+		},
+		loadData(type) {
+			let obj = this;
+			let index = obj.tabCurrentIndex;
+			let navItem = obj.navList[index];
+			if (navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
+				return;
 			}
-			.money {
-				font-size: 72rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #3F7C1F;
-				top: 15%;
-				position: absolute;
-				left: 50%;
-				transform: translate(-50%);
+			if (type == 'tabChange' && navItem.loaded == 'loaded') {
+				return;
 			}
+			navItem.loadingType == 'loading';
+			integral({
+				page: navItem.page,
+				limit: navItem.limit,
+				pm: navItem.state
+			}).then(res => {
+				navItem.orderList = navItem.orderList.concat(res.data);
+				if (navItem.limit == res.data.length) {
+					navItem.loadingType = 'more';
+					return;
+				} else {
+					navItem.loadingType = 'noMore';
+				}
+				uni.hideLoading();
+				this.$set(navItem, 'loaded', true);
+			});
 		}
-		.swiper-box {
-			height: calc(100% - 500rpx);
-			background-color: #FFFFFF;
+	}
+};
+</script>
+
+<style lang="scss">
+.container {
+	width: 750rpx;
+	height: 1334rpx;
+	background-color: #f1f1f1;
+
+	.header {
+		position: relative;
+		image {
+			width: 750rpx;
+			height: 400rpx;
 		}
-		.scorll {
-			height: 90%;
+
+		.money {
+			font-size: 72rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #3f7c1f;
+			position: absolute;
+			top: 60%;
+			left: 50%;
+			transform: translate(-50%, -50%);
 		}
-		.navbar {
+	}
+
+	
+
+	
+
+	.navbar {
+		display: flex;
+		height: 100rpx;
+		padding: 0 5rpx;
+		background: #fff;
+		box-shadow: 0 1rpx 5rpx rgba(0, 0, 0, 0.06);
+		position: relative;
+		z-index: 10;
+		margin-top: 25rpx;
+
+		.nav-item {
+			flex: 1;
 			display: flex;
-			height: 100rpx;
-			padding: 0 5rpx;
-			background: #fff;
-			box-shadow: 0 1rpx 5rpx rgba(0, 0, 0, 0.06);
+			justify-content: center;
+			align-items: center;
+			height: 100%;
+			font-size: 15px;
+			color: #999999;
 			position: relative;
-			z-index: 10;
-			margin-top: 25rpx;
-		
-			.nav-item {
-				flex: 1;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				height: 100%;
-				font-size: 15px;
-				color: #999999;
-				position: relative;
-		
-				&.current {
-					color: #333333;
-		
-					&:after {
-						content: '';
-						position: absolute;
-						left: 50%;
-						bottom: 0;
-						transform: translateX(-50%);
-						width: 44px;
-						height: 0;
-						border-bottom: 2px solid #3F7C1F;
-					}
+
+			&.current {
+				color: #333333;
+
+				&:after {
+					content: '';
+					position: absolute;
+					left: 50%;
+					bottom: 0;
+					transform: translateX(-50%);
+					width: 44px;
+					height: 0;
+					border-bottom: 2px solid #3f7c1f;
 				}
 			}
 		}
-		.cost {
-			width: 750rpx;
-			height: auto;
-			background-color: #fff;
-		
-			.award {
-				width: 701rpx;
-				height: 132rpx;
-				border-bottom: 1px solid #F0F4F8;
-				margin-left: 25rpx;
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-		
-				.award-left {
-					width: 221rpx;
-					height: 40rpx;
-					margin-left: 30rpx;
-					margin-bottom: 35rpx;
-		
-					.text {
-						width: 182rpx;
-						height: 30rpx;
-						font-size: 30rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #666666;
-						margin-bottom: 16rpx;
-					}
-		
-					.time {
-						width: 221rpx;
-						height: 20rpx;
-						font-size: 26rpx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #AEAEAE;
-					}
-				}
-		
-				.award-right {
-					font-size: 36rpx;
+	}
+
+	.cost {
+		width: 750rpx;
+		height: auto;
+		background-color: #fff;
+
+		.award {
+			width: 100%;
+			border-bottom: 1px solid #f0f4f8;
+			padding: 20rpx 25rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			.award-left {
+				width: 60%;
+				.text {
+					width: 100%;
+					font-size: 30rpx;
 					font-family: PingFang SC;
 					font-weight: bold;
-					color: #FF0000;
-					margin-right: 30rpx;
+					color: #666666;
+					margin-bottom: 16rpx;
+				}
+
+				.time {
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #aeaeae;
 				}
 			}
+
+			.award-right {
+				font-size: 36rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #ff0000;
+				margin-right: 30rpx;
+			}
 		}
-	}
+	}
+}
+.swiper-box {
+		// height: calc(100% - 536rpx);
+		background-color: #fff;
+	}
 </style>

+ 301 - 248
pages/user/jiedian.vue

@@ -1,221 +1,262 @@
 <template>
 	<view class="content">
+		<!-- 头部 -->
+
 		<view class="container">
-			<view class="jiedianbackground">
-				<image src="../../static/image/jiedian.png" mode=""></image>
-			</view>
+			<view class="jiedianbackground"><image src="../../static/image/jiedian.png" mode=""></image></view>
 			<view class="number-box">
 				<view class="number">
-					<text>{{people}}</text>人
-				</view>
-				<view class="renshu">
-					我的接点人数
+					<text>{{ userInfo.A_count + userInfo.B_count + userInfo.C_count }}</text>
+					人
 				</view>
+				<view class="renshu">我的接点人数</view>
 			</view>
 		</view>
 		<view class="message">
 			<view class="yeji">
 				<view class="yeji-a">
-					<view class="yeji-top">
-						A区业绩
-					</view>
-					<view class="yeji-buttom">¥{{a}}</view>
+					<view class="yeji-top">A区业绩</view>
+					<view class="yeji-buttom">¥{{ userInfo.A_achievement }}</view>
 				</view>
 				<view class="border"></view>
 				<view class="yeji-a">
-					<view class="yeji-top">
-						B区业绩
-					</view>
-					<view class="yeji-buttom">¥{{b}}</view>
+					<view class="yeji-top">B区业绩</view>
+					<view class="yeji-buttom">¥{{ userInfo.B_achievement }}</view>
 				</view>
 				<view class="border"></view>
 				<view class="yeji-a">
-					<view class="yeji-top">
-						C区业绩
-					</view>
-					<view class="yeji-buttom">¥{{c}}</view>
+					<view class="yeji-top">C区业绩</view>
+					<view class="yeji-buttom">¥{{ userInfo.C_achievement }}</view>
 				</view>
 			</view>
 			<view class="relation-box">
 				<view class="relation">
 					<view class="headbox">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="avatar || '../../static/error/missing-face.png'"></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
 					<view class="information">
-						<view class="name">
-							徐浩岚
-						</view>
-						<view class="cell">
-							18252757278
-						</view>
+						<view class="name clamp">{{ name }}</view>
+						<view class="cell clamp">{{ phone }}</view>
 					</view>
 				</view>
-				<view class="sanchaji">
-					<image src="../../static/image/sanchaji.png" mode=""></image>
-				</view>
+				<view class="sanchaji"><image src="../../static/image/sanchaji.png" mode=""></image></view>
 				<view class="subordinate">
-					<view class="headbox" >
+					<view class="headbox" v-if="listA != ''" @click="nav('a')">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="listA.avatar" mode=""></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
-					<view class="headbox" >
+					<view class="zhuce" v-if="listA == ''" @click="navto('a')">注册接点A</view>
+					<view class="headbox" v-if="listB != ''" @click="nav('b')">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="listB.avatar" mode=""></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
-					<view class="headbox" >
+					<view class="zhuce" v-if="listB == ''" @click="navto('b')">注册接点B</view>
+					<view class="headbox" v-if="listC != ''" @click="nav('c')">
 						<view class="head">
-							<view class="photo">
-								<image src="../../static/image/photo.jpg" mode=""></image>
-							</view>
-						</view>
-						<view class="head-title">
-							<image src="../../static/image/jiedian1.png" mode=""></image>
+							<view class="photo"><image :src="listC.avatar" mode=""></image></view>
 						</view>
+						<view class="head-title"><image src="../../static/image/jiedian1.png" mode=""></image></view>
 					</view>
+					<view class="zhuce" v-if="listC == ''" @click="navto('c')">注册接点C</view>
 				</view>
 			</view>
-
 		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				a: 1,
-				b: 2,
-				c: 3,
-				people: 255,
-				//'12345678901'.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+import { getjiedian } from '@/api/user.js';
+import { mapState, mapMutations } from 'vuex';
+export default {
+	data() {
+		return {
+			a: 1,
+			b: 2,
+			c: 3,
+			people: 255,
+			listA: '',
+			listB: '',
+			listC: '',
+			name: '',
+			phone: '',
+			avatar: '',
+			id: ''
+		};
+	},
+	computed: {
+		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+	},
+	onLoad() {
+		this.name = this.userInfo.nickname;
+		this.phone = this.userInfo.phone;
+		this.avatar = this.userInfo.avatar;
+		this.id = this.userInfo.uid;
+		this.loadData();
+	},
+	methods: {
+		loadData() {
+			const obj = this;
+			getjiedian({}, this.id).then(({ data }) => {
+				if (data.list.length != 0) {
+					data.list.forEach(e => {
+						console.log('e', e);
+						if (e.parent_area == 'A') {
+							this.listA = e;
+						} else if (e.parent_area == 'B') {
+							this.listB = e;
+						} else if (e.parent_area == 'C') {
+							this.listC = e;
+						}
+					});
+				} else {
+					return;
+				}
+			});
+		},
+		nav(type) {
+			if (type == 'a') {
+				this.name = this.listA.nickname;
+				this.phone = this.listA.phone;
+				this.avatar = this.listA.avatar;
+				this.id = this.listA.uid;
+				this.listA = '';
+				this.listB = '';
+				this.listC = '';
+				this.loadData();
+			} else if (type == 'b') {
+				this.name = this.listB.nickname;
+				this.phone = this.listB.phone;
+				this.avatar = this.listB.avatar;
+				this.id = this.listB.uid;
+				this.listA = '';
+				this.listB = '';
+				this.listC = '';
+				this.loadData();
+			} else if (type == 'c') {
+				this.name = this.listC.nickname;
+				this.phone = this.listC.phone;
+				this.avatar = this.listC.avatar;
+				this.id = this.listC.uid;
+				this.listA = '';
+				this.listB = '';
+				this.listC = '';
+				this.loadData();
 			}
 		},
-		methods: {}
+		navto(type) {
+			if (type == 'a') {
+				uni.navigateTo({
+					url: '/pages/public/register?id=' + this.id + '&area=A'
+				});
+			} else if (type == 'b') {
+				uni.navigateTo({
+					url: '/pages/public/register?id=' + this.id + '&area=B'
+				});
+			} else if (type == 'c') {
+				if (this.listA == '' || this.listB == '') {
+					this.$api.msg('请先注册完接点A和接点B');
+				} else {
+					uni.navigateTo({
+						url: '/pages/public/register?id=' + this.id + '&area=C'
+					});
+				}
+			}
+		}
 	}
+};
 </script>
 
 <style lang="scss">
-	page {
-		padding: 0;
-		margin: 0;
-		height: 100%;
-		background-color: #FFFFFF;
-	}
-
-	.content {}
-
-	.container {
+page {
+	padding: 0;
+	margin: 0;
+	height: 100%;
+	background-color: #ffffff;
+}
+.container {
+	width: 750rpx;
+	height: 400rpx;
+	position: relative;
+
+	.jiedianbackground {
+		position: absolute;
 		width: 750rpx;
 		height: 400rpx;
-		position: relative;
 
-		.jiedianbackground {
-			position: absolute;
-			width: 750rpx;
-			height: 400rpx;
-
-			image {
-				width: 100%;
-				height: 100%;
-			}
+		image {
+			width: 100%;
+			height: 100%;
 		}
+	}
 
-		.number-box {
-			width: 750rpx;
-			height: 400rpx;
-			position: absolute;
-			display: flex;
-			justify-content: center;
-			flex-direction: column;
-			align-items: center;
-
-			.number {
-				font-size: 30rpx;
+	.number-box {
+		width: 750rpx;
+		height: 400rpx;
+		position: absolute;
+		display: flex;
+		justify-content: center;
+		flex-direction: column;
+		align-items: center;
+
+		.number {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #3f7c1f;
+
+			text {
+				font-size: 72rpx;
 				font-family: PingFang SC;
-				font-weight: 500;
-				color: #3F7C1F;
-
-				text {
-					font-size: 72rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #3F7C1F;
-					line-height: 86rpx;
-				}
+				font-weight: bold;
+				color: #3f7c1f;
+				line-height: 86rpx;
 			}
+		}
 
-			.renshu {
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #3F7C1F;
-			}
+		.renshu {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #3f7c1f;
 		}
 	}
+}
+
+.message {
+	padding: 0 30rpx;
 
-	.message {
-		padding: 0 30rpx;
+	.relation-box {
+		margin-top: 100rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
 
-		.relation-box {
-			margin-top: 100rpx;
+		.relation {
+			position: relative;
 			display: flex;
-			flex-direction: column;
 			align-items: center;
-
-			.relation {
-				position: relative;
-				display: flex;
-				align-items: center;
-				
-
-				.headbox {
-
-					position: absolute;
+			.headbox {
+				position: absolute;
+				width: 154rpx;
+				height: 154rpx;
+				.head {
 					width: 154rpx;
 					height: 154rpx;
+					background: #ef9e20;
+					box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
+					border-radius: 50%;
+					overflow: hidden;
 
-					.head {
+					.photo {
 						width: 154rpx;
 						height: 154rpx;
-						background: #EF9E20;
-						box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
-						border-radius: 50%;
-						overflow: hidden;
-
-						.photo {
-							width: 154rpx;
-							height: 154rpx;
-
-							image {
-								width: 100%;
-								height: 100%;
-							}
-						}
-					}
-
-					.head-title {
-						margin: -30rpx 30rpx 0 30rpx;
-						width: 94rpx;
-						height: 32rpx;
 
 						image {
 							width: 100%;
@@ -224,133 +265,145 @@
 					}
 				}
 
-				.information {
-					margin-left: 77rpx;
-					display: flex;
-					justify-content: center;
-					flex-direction: column;
-					width: 297rpx;
-					height: 137rpx;
-					align-items: center;
-					background: #FFFFFF;
-					border: 4rpx solid #6EAB4E;
-					border-radius: 10rpx;
-
-					.name {
-						font-size: 32rpx;
-						font-family: PingFang SC;
-						font-weight: bold;
-						color: #3F7C1F;
-						line-height: 48rpx;
-					}
+				.head-title {
+					margin: -30rpx 30rpx 0 30rpx;
+					width: 94rpx;
+					height: 32rpx;
 
-					.cell {
-						margin-left: 70rpx;
-						font-size: 26rpx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #ABD56F;
-						line-height: 48rpx;
+					image {
+						width: 100%;
+						height: 100%;
 					}
 				}
+			}
 
+			.information {
+				margin-left: 77rpx;
+				display: flex;
+				padding: 20rpx 10rpx;
+				flex-direction: column;
+				width: 297rpx;
+				height: 137rpx;
+				background: #ffffff;
+				border: 4rpx solid #6eab4e;
+				border-radius: 10rpx;
+				.name {
+					text-align: left;
+					margin-left: 70rpx;
+					font-size: 32rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #3f7c1f;
+				}
 
+				.cell {
+					text-align: left;
+					margin-left: 70rpx;
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #abd56f;
+				}
 			}
+		}
 
-			.sanchaji {
-				margin: 30rpx 0;
-				width: 530rpx;
-				height: 91rpx;
+		.sanchaji {
+			margin: 30rpx 0;
+			width: 530rpx;
+			height: 91rpx;
 
-				image {
-					width: 100%;
-					height: 100%;
-				}
+			image {
+				width: 100%;
+				height: 100%;
 			}
+		}
 
-			.subordinate {
-				width: 750rpx;
-				display: flex;
-				justify-content: space-around;
-					.headbox {
-						
-						width: 154rpx;
-						height: 154rpx;
+		.subordinate {
+			width: 750rpx;
+			display: flex;
+			justify-content: space-around;
+			.zhuce {
+				padding: 10rpx;
+				background: #abd56f;
+				color: #fff;
+			}
+			.headbox {
+				width: 154rpx;
+				height: 154rpx;
 
-						.head {
-							width: 154rpx;
-							height: 154rpx;
-							background: #EF9E20;
-							box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
-							border-radius: 50%;
-							overflow: hidden;
+				.head {
+					width: 154rpx;
+					height: 154rpx;
+					background: #ef9e20;
+					box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
+					border-radius: 50%;
+					overflow: hidden;
 
-							.photo {
-								width: 154rpx;
-								height: 154rpx;
+					.photo {
+						width: 154rpx;
+						height: 154rpx;
 
-								image {
-									width: 100%;
-									height: 100%;
-								}
-							}
+						image {
+							width: 100%;
+							height: 100%;
 						}
+					}
+				}
 
-						.head-title {
-							margin: -30rpx 30rpx 0 30rpx;
-							width: 94rpx;
-							height: 32rpx;
+				.head-title {
+					margin: -30rpx 30rpx 0 30rpx;
+					width: 94rpx;
+					height: 32rpx;
 
-							image {
-								width: 100%;
-								height: 100%;
-							}
-						}
-					
+					image {
+						width: 100%;
+						height: 100%;
+					}
 				}
 			}
 		}
+	}
 
-		.yeji {
-			position: relative;
-			margin-top: -72rpx;
-			width: 690rpx;
-			height: 143rpx;
-			background: #FFFFFF;
-			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
-			border-radius: 10rpx;
+	.yeji {
+		position: relative;
+		margin-top: -72rpx;
+		width: 690rpx;
+		height: 143rpx;
+		background: #ffffff;
+		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
+		border-radius: 10rpx;
+		display: flex;
+		justify-content: space-around;
+		align-items: center;
+
+		.yeji-a {
 			display: flex;
+			flex-direction: column;
 			justify-content: space-around;
 			align-items: center;
 
-			.yeji-a {
-				display: flex;
-				flex-direction: column;
-				justify-content: space-around;
-				align-items: center;
-
-				.yeji-top {
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #333333;
-					line-height: 35px;
-				}
-
-				.yeji-buttom {
-					font-size: 34rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #333333;
-					line-height: 35px;
-				}
+			.yeji-top {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				line-height: 35px;
 			}
 
-			.border {
-				width: 1rpx;
-				height: 51rpx;
-				background: #DDDDDD;
+			.yeji-buttom {
+				font-size: 34rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				line-height: 35px;
 			}
 		}
+
+		.border {
+			width: 1rpx;
+			height: 51rpx;
+			background: #dddddd;
+		}
 	}
+}
 </style>

+ 269 - 0
pages/user/registerList.vue

@@ -0,0 +1,269 @@
+<template>
+	<view class="content">
+		<view class="jg"></view>
+		<view class="navbar">
+			<view class="nav-item" v-for="(item, index) in registerList" :key="index"
+				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
+		</view>
+		<swiper :interval="3000" :duration="200" :style="{'height': height}" class="swiper-wrapper"
+			:current="tabCurrentIndex" @change="changeTab">
+			<swiper-item v-for="(item, index) in registerList">
+				<scroll-view scroll-y="true" :style="{'height': height}">
+					<view v-for="(itemt,index) in item.list" class="list">
+						<view class="" v-if="itemt.rebuy == 0">
+							<view class="order-id">账号{{itemt.account}}</view>
+							<view class="time">
+								<view class="">父接点:{{itemt.account}}</view>
+								<view class="">接点区域:{{itemt.parent_area}}</view>
+							</view>
+							<view class="zfqx" v-if="tabCurrentIndex == 0">
+								<view class="btn" @click="payRegister(itemt)">
+									支付
+								</view>
+								<view class="btn qx" @click="cancelRegister(itemt)">
+									取消
+								</view>
+							</view>
+						</view>
+						<view class="" v-if="itemt.rebuy == 1">
+							<view class="order-id">
+								报单编号{{itemt.order_id}}
+							</view>
+							<view class="zfqx" v-if="tabCurrentIndex == 0">
+								<view class="btn"  @click="payRegister(itemt)">
+									支付
+								</view>
+								<view class="btn qx" @click="cancelRegister(itemt)">
+									取消
+								</view>
+							</view>
+						</view>
+					</view>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+	import {
+		getRegisterList,
+		cancelRegister,
+		payRegister
+	} from '@/api/user.js'
+	export default {
+		data() {
+			return {
+				paytype: 'yue',
+				height: '',
+				tabCurrentIndex: 0,
+				registerList: [{
+						status: 0,
+						title: '未支付',
+						loadingType: 'more',
+						list: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					},
+					{
+
+						status: 1,
+						title: '已支付',
+						loadingType: 'more',
+						list: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					}
+				]
+			}
+		},
+		onReady(res) {
+			var _this = this;
+			uni.getSystemInfo({
+				success: resu => {
+					const query = uni.createSelectorQuery();
+					query.select('.swiper-wrapper').boundingClientRect();
+					query.exec(function(res) {
+						_this.height = resu.windowHeight - res[0].top + 'px';
+						console.log('打印页面的剩余高度', _this.height);
+					});
+				},
+				fail: res => {}
+			});
+		},
+		onLoad() {
+			this.getRegisterList()
+		},
+		methods: {
+			getRegisterList(type) {
+				let obj = this;
+				let index = obj.tabCurrentIndex;
+				let navItem = obj.registerList[index];
+				if (navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
+					return;
+				}
+				if (type == 'tabChange' && navItem.loaded == 'loaded') {
+					return;
+				}
+				navItem.loadingType == 'loading';
+				getRegisterList({
+					page: navItem.page,
+					limit: navItem.limit,
+					type: navItem.status
+				}).then(res => {
+					console.log(res, 'ddd')
+					navItem.list = navItem.list.concat(res.data);
+					if (navItem.limit == res.data.length) {
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						navItem.loadingType = 'noMore';
+					}
+					uni.hideLoading();
+					this.$set(navItem, 'loaded', true);
+				});
+			},
+			//顶部tab点击
+			tabClick(index) {
+				this.tabCurrentIndex = index;
+			},
+			//swiper 切换
+			changeTab(e) {
+				this.tabCurrentIndex = e.target.current;
+				this.getRegisterList('tabChange');
+			},
+			//取消订单
+			cancelRegister(item) {
+				let obj = this
+				cancelRegister({},item.id).then( res => {
+					uni.showToast({
+						title:'取消成功',
+						duration:2000
+					});
+					let s = obj.registerList[obj.tabCurrentIndex].list.indexOf(item);
+					obj.registerList[obj.tabCurrentIndex].list.splice(s, 1);
+				}).catch( err => {
+					console.log(err)
+				})
+			},
+			//支付报单
+			payRegister(item) {
+				let obj = this
+				payRegister({
+					paytype: obj.paytype,
+					// #ifdef MP
+					form: 'MP',
+					// #endif
+					// #ifdef H5
+					form: 'H5',
+					// #endif
+					// #ifdef APP-PLUS
+					form: 'APP',
+					// #endif
+				},item.id).then( res => {
+					uni.showToast({
+						title:'支付成功',
+						duration:2000
+					});
+					let s = obj.registerList[obj.tabCurrentIndex].list.indexOf(item);
+					obj.registerList[obj.tabCurrentIndex].list.splice(s, 1);
+				}).catch( err => {
+					console.log(err)
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page {
+		height: 100%;
+		background-color: #fff;
+	}
+
+	.content {
+		height: 100%;
+
+		.jg {
+			height: 20rpx;
+			background-color: #eee;
+		}
+
+		.navbar {
+			display: flex;
+			height: 100rpx;
+			padding: 0 5rpx;
+			background: #fff;
+			box-shadow: 0 1rpx 5rpx rgba(0, 0, 0, 0.06);
+			position: relative;
+			z-index: 10;
+			margin-top: 25rpx;
+
+			.nav-item {
+				flex: 1;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				height: 100%;
+				font-size: 15px;
+				color: #999999;
+				position: relative;
+
+				&.current {
+					color: #333333;
+
+					&:after {
+						content: '';
+						position: absolute;
+						left: 50%;
+						bottom: 0;
+						transform: translateX(-50%);
+						width: 44px;
+						height: 0;
+						border-bottom: 2px solid #3f7c1f;
+					}
+				}
+			}
+		}
+
+		.swiper-wrapper {}
+	}
+
+	.list {
+		padding: 5rpx 10rpx 5rpx 10rpx;
+
+		.order-id {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #666666;
+		}
+		.time {
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #AEAEAE;
+			display: flex;
+			view {
+				margin-right: 20rpx;
+			}
+		}
+		.zfqx {
+			display: flex;
+			justify-content: space-around;
+
+			.btn {
+				width: 150rpx;
+				// height: 50rpx;
+				background-color: #d7eeb6;
+				border-radius: 10rpx;
+				text-align: center;
+				line-height: 50rpx;
+				color: #FF0000;
+			}
+			.qx {
+				color: #999;
+			}
+		}
+	}
+</style>

+ 123 - 0
pages/user/shareQrCode.vue

@@ -0,0 +1,123 @@
+<template>
+	<view class="container">
+		<image @longtap="bc_code" class="backImg" :src="backImg"></image>
+		<view class="tki-qrcode"><canvas @longtap="bc_code" canvas-id="qrcode" /></view>
+	</view>
+</template>
+
+<script>
+import { spreadBanner } from '@/api/user.js';
+export default {
+	// components: { tkiQrcode },
+	data() {
+		return {
+			url: '',
+			backImg:'',
+			userInfo:''
+		};
+	},
+	onLoad() {
+		this.spread();
+	},
+	computed: {
+			cpSize() {
+				if(this.unit == "upx"){
+					return uni.upx2px(this.size)
+				}else{
+					return this.size
+				}
+			}
+	},
+	methods: {
+		spread(){
+			let obj = this;
+			spreadBanner({
+				type:2
+			}).then(({ data }) => {
+				console.log(data)
+				obj.backImg = data[0].wap_poster;
+			});
+		},
+		bc_code(){
+			let that = this;
+			console.log('保存二维码',this.backImg)
+			uni.downloadFile({           //获得二维码的临时地址
+				url:this.backImg,
+				success:(res)=>{
+					//console.log('获取url',res)
+					if(res.statusCode == 200){
+						uni.saveImageToPhotosAlbum({
+							filePath:res.tempFilePath,//传入临时地址
+							success() {
+								that.$api.msg('保存成功')//封装的提示
+							},
+							fail() {
+								that.$api.msg('保存失败')
+							}
+						})
+					}
+				}
+			})
+		},
+	},
+}
+</script>
+
+<style lang="scss">
+	page{
+		width: 100%;
+		min-height: 100%;
+		.container{
+			width: 100%;
+			height: 100%;	
+		}
+	}
+	.backImg{
+		position: absolute;
+		width: 100%;
+		height: 100%;
+	}
+.portrait{
+	width: 100%;
+	text-align: center;
+	padding-top: 80rpx;
+	padding-bottom: 30rpx;
+	image{
+		width: 250rpx;
+		height: 250rpx;
+	}
+}
+.text{
+	text-align: center;
+	width: 100%;
+	color: #FFFFFF;
+	font-size:55rpx;
+	letter-spacing:15rpx;
+}
+.uid-name{
+	padding: 50rpx 0rpx;
+	text-align: center;
+	width: 100%;
+	color: #FFFFFF;
+}
+.copy-btn{
+	color: #FFFFFF;
+	background-color: #4BA6ED;
+	border-radius: 50rpx;
+	width: 170rpx;
+	line-height: 70rpx;
+	margin: 0rpx auto;
+	text-align: center;
+}
+.tki-qrcode{
+	position: fixed;
+	bottom: 10%;
+	left: 30%;
+}
+canvas{
+	width:150px;
+	height: 150px;
+	margin: auto;
+	
+}
+</style>

+ 49 - 17
pages/user/transfer.vue

@@ -1,41 +1,74 @@
 <template>
 	<view class="container">
-		<!-- 佣金转账 -->
-		<!-- <view class="top-one">
-			<image src="../../static/img/xiangzuo.png" mode="scaleToFill"></image>
-			<view class="text">佣金转账</view>
-		</view> -->
-		<!-- 可转账佣金 -->
 		<view class="top-two">
-			<view class="count">360</view>
+			<view class="count">{{money || 0}}</view>
 			<view class="text">可转账佣金</view>
 		</view>
 		<view class="top-three">
-			<view class="text">收款入账户</view>
-				<input class="input" type="number" placeholder="请输入收款人账户"/>
+			<view class="text">收款人账户</view>
+				<input class="input" type="text" placeholder="请输入收款人账户" v-model="to_user_account"/>
+		</view>
+		<view class="top-three">
+			<view class="text">收款人UID</view>
+				<input class="input" type="number" placeholder="请输入收款人UID" v-model="to_uid"/>
 		</view>
 		<view class="top-four">
 			<view class="text">转账数量</view>
 			<view class="row">
 				<text class="tit">¥</text>
-				<input class="input" type="number" placeholder="请输入转账数量" />
+				<input class="input" type="number" placeholder="请输入转账数量" v-model="num"/>
 			</view>
 		</view>
-			<view class="btn" @click="nav('/pages/user/submit')" >提交申请</view>
+			<view class="btn" @click="sub">提交申请</view>
 	</view>
 </template>
 
 <script>
+	import { trade, getSpreadCount } from '@/api/user.js'
 export default {
 	data () {
 		return {
+			num: '',//转账金额
+			to_user_account: '',//收款人账户
+			to_uid: '',//收款人UID
+			money: 0,
 		}
 	},
+	onLoad() {
+		this.getNum()
+	},
 	methods: {
 		nav (url) {
 			uni.navigateTo({
 				url
 			})
+		},
+		sub() {
+			let obj = this
+			if(obj.num == '') {
+				return this.$api.msg('请输入收款人账户!')
+			}
+			if(to_user_account == '') {
+				return this.$api.msg('请输入收款人账户!')
+			}
+			if(obj.to_uid == '') {
+				return this.$api.msg('请输入转账金额!')
+			}
+			if( +obj.num > +obj.money)
+			trade({
+				type: 'd',
+				num: obj.num,
+				to_user_account: obj.to_user_account,
+				to_uid: obj.to_uid
+			}).then( res => {
+				
+			})
+		},
+		getNum() {
+			getSpreadCount({}, 3).then(({ data }) => {
+				console.log(data);
+				this.money = +data.count;
+			});
 		}
 	}
 }
@@ -45,14 +78,13 @@ export default {
 	.container {
 		background-color: #F2F3F5;
 		width: 750rpx;
-		height: 1334rpx;
+		// height: 1334rpx;
 		.top-two {
-			margin-top: 20rpx;
-			height: 160rpx;
+			padding-bottom: 20rpx;
 			background-color: #fff;
 			.count {
-				width: 76rpx;
-				height: 34rpx;
+				text-align: center;
+				height: 50rpx;
 				font-size: 42rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
@@ -62,7 +94,7 @@ export default {
 			}
 			.text {
 				width: 140rpx;
-				height: 26rpx;
+				// height: 26rpx;
 				font-size: 28rpx;
 				font-family: PingFang SC;
 				font-weight: 500;

+ 234 - 20
pages/user/user.vue

@@ -8,14 +8,14 @@
 			<view class="infor">
 				<!-- 用户信息 -->
 				<view class="infor-left">
-					<image src="../../static/error/missing-face.png" mode=""></image>
+					<image :src=" userInfo.avatar || '../../static/error/missing-face.png' "></image>
 					<view class="info-box">
-						<view class="username">李丹丹</view>
-						<view class="phone">13911111111</view>
+						<view class="username">{{ userInfo.nickname || '游客' }}</view>
+						<view class="phone" v-if="userInfo.phone">{{userInfo.phone | phone}}</view>
 					</view>
 				</view>
 				<!-- 设置 -->
-				<view class="infor-right" @click="nav('/pages/user/shezhi')">
+				<view class="infor-right" @click="nav('/pages/set/userinfo')">
 					<image src="../../static/img/img18.png" mode="scaleToFill"></image>
 					<view class="setting">设置</view>
 				</view>
@@ -28,19 +28,19 @@
 				</view>
 				<!-- 订单栏 -->
 				<view class="order-section">
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=0')">
 						<image src="../../static/img/img19.png" mode="scaleToFill"></image>
 						<view class="text">待付款</view>
 					</view>
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=1')">
 						<image src="../../static/img/img20.png" mode="scaleToFill"></image>
 						<view class="text">待发货</view>
 					</view>
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=2')">
 						<image src="../../static/img/img21.png" mode="scaleToFill"></image>
 						<view class="text">待收货</view>
 					</view>
-					<view class="order-item" @click="nav('/pages/order/')">
+					<view class="order-item" @click="nav('/pages/order/order?state=4')">
 						<image src="../../static/img/img22.png" mode="scaleToFill"></image>
 						<view class="text">已完成</view>
 					</view>
@@ -51,11 +51,11 @@
 		<view class="item-box">
 			<!-- 我的余额 -->
 			<view class="order-section">
-				<view class="order-item" @click="nav('/pages/user/balance')">
+				<view class="order-item" @click="nav('/pages/money/wallet')">
 					<image src="../../static/img/img26.png" mode="scaleToFill"></image>
 					<view class="text">我的余额</view>
 				</view>
-				<view class="order-item" @click="nav('/pages/user/accounts')">
+				<view class="order-item" @click="nav('/pages/user/award')">
 					<image src="../../static/img/img23.png" mode="scaleToFill"></image>
 					<view class="text">我的佣金</view>
 				</view>
@@ -63,53 +63,177 @@
 					<image src="../../static/img/img24.png" mode="scaleToFill"></image>
 					<view class="text">我的积分</view>
 				</view>
-				<view class="order-item" @click="nav('/pages/user/extend')">
+				<view class="order-item" @click="nav('/pages/user/extension')">
 					<image src="../../static/img/img25.png" mode="scaleToFill"></image>
 					<view class="text">我的推广</view>
 				</view>
 			</view>
 			<!-- 底部列表 -->
 			<view class="btm">
-				<view class="ul-btm">
+				<view class="ul-btm" @click="nav('/pages/user/jiedian')">
 					<image src="../../static/img/img27.png" mode="scaleToFill"></image>
 					<view class="text">我的接点</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" @click="nav('/pages/user/shareQrCode')">
 					<image src="../../static/img/img28.png" mode="scaleToFill"></image>
 					<view class="text">邀请海报</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" @click="nav('/pages/public/register')">
 					<image src="../../static/img/img29.png" mode="scaleToFill"></image>
 					<view class="text">会员注册</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" @click="nav('/pages/user/registerList')">
+					<image src="../../static/img/img29.png" mode="scaleToFill"></image>
+					<view class="text">报单列表</view>
+					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
+				</view>
+				<view class="ul-btm" @click="nav('/pages/set/address')">
 					<image src="../../static/img/img30.png" mode="scaleToFill"></image>
 					<view class="text">收货地址</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
-				<view class="ul-btm">
+				<view class="ul-btm" @click="open()">
 					<image src="../../static/img/img31.png" mode="scaleToFill"></image>
 					<view class="text">联系客服</view>
 					<image class="jiantou" src="../../static/img/img32.png" mode="scaleToFill"></image>
 				</view>
 			</view>
 		</view>
+		<uni-popup ref="popup" type="center">
+			<view class="popup-box">
+				<view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
+				<view class="mian">
+					<view class="delivery">
+						<view class="title">已经为您定制专属客服</view>
+						<image src="../../static/img/img010.png" mode=""></image>
+					</view>
+					<view class="nocancel">客服VX:{{ text }}</view>
+					<view class="comfirm-box">
+						<view class="cancel" @click="cancel">取消</view>
+						<view class="comfirm" @click="comfirm(text)">复制微信</view>
+					</view>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
+	import { orderData, getUserInfo,service } from '@/api/user.js';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniCopy from '@/utils/uni-copy.js';
+	import { mapState, mapMutations } from 'vuex';
+	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	export default {
+		components: {
+			uniPopup
+		},
 		data() {
-			return {}
+			return {
+				text:'123465'
+			}
+		},
+		filters: {
+			phone(val) {
+				let str = ''
+				if(val) {
+					val = "" + val;
+					str = val.substr(0,3) + "****" + val.substr(7)
+				}
+				return str
+			}
+		},
+		onShow() {
+			//判断是否已经登录
+			if (this.hasLogin) {
+				this.loadBaseData();
+			} else {
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+			}
+		},
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
 		},
 		methods: {
+			...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+			loadBaseData() {
+				getUserInfo({})
+					.then(({ data }) => {
+						console.log(data)
+						this.setUserInfo(data);
+						// 获取用户数据完毕后在获取订单数据防止多次跳转到登录页
+						orderData({})
+							.then(({ data }) => {
+								this.setOrderInfo(data);
+							})
+							.catch(e => {
+								this.setOrderInfo({
+									complete_count: 0, //完成
+									received_count: 0, //待收货
+									unshipped_count: 0, //待发货
+									order_count: 0, //订单总数
+									unpaid_count: 0 //待付款
+								});
+							});
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 			nav(url) {
-				uni.navigateTo({
-					url
-				})
+				console.log(url)
+				if(!this.hasLogin) {
+					// 保存地址
+					saveUrl();
+					// 登录拦截
+					interceptor();
+				}else {
+					uni.navigateTo({
+						url
+					})
+				}
+				
+			},
+			open(){
+				console.log('点击出现弹窗');
+				this.$refs.popup.open();
+			},
+			// 客服弹窗 - 复制微信
+			comfirm(value) {
+				
+				let content = value; //需要复制的内容
+				console.log('复制的内容:', content);
+				// content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
+				const result = uniCopy({content,success});
+				if (result === false) {
+					uni.showToast({
+						title: '不支持'
+					});
+				} else {
+					uni.showToast({
+						title: '复制成功',
+						icon: 'none'
+					});
+				}
+				this.$refs.popup.close();
+			},
+			// 客服弹窗 - 取消
+			cancel() {
+				this.$refs.popup.close();
 			}
 		}
 	}
@@ -149,6 +273,8 @@
 				image {
 					width: 126.5rpx;
 					height: 126.5rpx;
+					border-radius: 50%;
+					flex-shrink: 0;
 				}
 
 				.info-box {
@@ -163,6 +289,7 @@
 				}
 
 				.phone {
+					padding-top: 10rpx;
 					font-size: 26rpx;
 					font-family: PingFang SC;
 					font-weight: 500;
@@ -320,4 +447,91 @@
 			}
 		}
 	}
+	.popup-box {
+		width: 522rpx;
+		height: 605rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		position: relative;
+		.img {
+			position: relative;
+			top: -56rpx;
+			left: 0;
+			width: 522rpx;
+			height: 132rpx;
+			display: flex;
+			justify-content: center;
+			image {
+				border-radius: 20rpx 20rpx 0 0;
+				width: 450rpx;
+				height: 132rpx;
+			}
+		}
+	
+		.mian {
+			margin-top: -44rpx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			// padding: 32rpx 32rpx;
+			background-color: #ffffff;
+			border-radius: 0 0 20rpx 20rpx;
+			text-align: center;
+	
+			.delivery {
+				font-size: 40rpx;
+				color: #333333;
+				display: flex;
+				align-items: center;
+				flex-direction: column;
+				.title {
+				}
+				image {
+					margin-top: 48rpx;
+					width: 172rpx;
+					height: 160rpx;
+				}
+			}
+	
+			.nocancel {
+				font-size: 32rpx;
+				color: #333333;
+				margin-top: 14rpx;
+			}
+	
+			.comfirm-box {
+				margin-top: 52rpx;
+				display: flex;
+				// margin-bottom: 32rpx;
+	
+				// justify-content: space-around;
+				.cancel {
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 197rpx;
+					height: 74rpx;
+					border: 1px solid #dcc786;
+					border-radius: 38rpx;
+	
+					font-size: 32rpx;
+					color: #605128;
+				}
+	
+				.comfirm {
+					margin-left: 32rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 197rpx;
+					height: 74rpx;
+					background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
+					border-radius: 38px;
+					font-size: 32rpx;
+					color: #605128;
+				}
+			}
+		}
+	}
+	
 </style>

+ 312 - 0
pages/user/withdrawal.vue

@@ -0,0 +1,312 @@
+<template>
+	<view class="content">
+		<!-- <uni-notice-bar single="true" text="每月25号到月底可提现上月结算余额"></uni-notice-bar> -->
+		<view class="content-money">
+			<view class="flex ">
+				<view class="buttom">
+					<view class="icon">{{ money | getMoneyStyle }}</view>
+					<text class="text">可提现金额</text>
+				</view>
+				<view class="interval"></view>
+				<view class="buttom">
+					<view class=" icon">{{ freeze | getMoneyStyle }}</view>
+					<text class="text">待审核提现金额</text>
+				</view>
+			</view>
+		</view>
+		<view class="row-box">
+			<view class="title">提现金额</view>
+			<view class="row">
+				<text class="tit">¥</text>
+				<input class="input" type="number" v-model="withdrawal" :placeholder="'最低提现金额' + minPrice + '元'" placeholder-class="placeholder" />
+				<view class="buttom" @click="withdrawal = money">全部提现</view>
+			</view>
+		</view>
+		<!-- #ifndef MP-WEIXIN -->
+		<view class="list" v-if="!weichatBsrowser">
+			<radio-group @change="tabRadio">
+				<label>
+					<view class="box">
+						<view class="icon iconfont iconweixin1"></view>
+						<view class="title-box">
+							<view class="title"><text>提现至微信</text></view>
+						</view>
+						<view class="right"><radio value="weixin" color="#5dbc7c" :checked="type == 'weixin'" /></view>
+					</view>
+				</label>
+				<!-- <label>
+					<view class="box">
+						<view class="icon iconfont iconzhifubao"></view>
+						<view class="title-box">
+							<view class="title">
+								<text v-if="aliData.fullname">提现至支付宝</text>
+								<text v-else>请创建支付宝账号</text>
+							</view>
+							<view class="node">
+								<text v-if="aliData.fullname">真实姓名({{ aliData.fullname }})</text>
+							</view>
+						</view>
+						<view class="right"><radio value="alipay" color="#5dbc7c" :checked="type == 'alipay'" /></view>
+					</view>
+				</label> -->
+				<label>
+					<view class="box">
+						<view class="icon iconfont"><image class="icon-img" src="../../static/icon/i8.png" mode="aspectFit"></image></view>
+						<view class="title-box">
+							<view class="title">
+								<text v-if="bankData.bankno">{{ bankData.bank + ' ' + bankData.bankno }}</text>
+								<text v-else>请创建银行账号</text>
+							</view>
+							<view class="node">
+								<text v-if="bankData.fullname">真实姓名({{ bankData.fullname }})</text>
+							</view>
+						</view>
+						<view class="right"><radio value="bank" color="#5dbc7c" :checked="type == 'bank'" /></view>
+					</view>
+				</label>
+			</radio-group>
+		</view>
+		<!-- #endif -->
+		<button class="add-btn up" @click="confirm">提交申请</button>
+		<button class="add-btn modified" v-if="!weichatBsrowser" @click="navTo('/pages/money/account')">账号管理</button>
+	</view>
+</template>
+
+<script>
+import { getMoneyStyle } from '@/utils/rocessor.js';
+import { extractCash, extractBank, aliInfo, bankInfo } from '@/api/wallet.js';
+import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
+export default {
+	filters: {
+		getMoneyStyle
+	},
+	components: {
+		uniNoticeBar
+	},
+	data() {
+		return {
+			type: 'weixin', //提现方式
+			money: '0.00', //可提现金额
+			freeze: '0.0', //冻结金额
+			withdrawal: '', //提现金额
+			minPrice: '', //最少提现金额
+			aliData: {},
+			bankData: {},
+			// #ifdef H5
+			weichatBsrowser: false
+			// #endif
+		};
+	},
+	onLoad(options) {
+		// #ifdef H5
+		this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
+		// #endif
+		//加载提现信息
+		this.loadData();
+		// 加载提款账号信息
+		this.loadAli();
+		this.loadBank();
+	},
+	methods: {
+		// 更新数据
+		dataUp(){
+			this.loadAli();
+			this.loadBank();
+		},
+		//加载数据
+		async loadAli(source) {
+			aliInfo({}).then(e => {
+				this.aliData = e.data;
+			});
+		},
+		// 加载银行卡信息
+		async loadBank() {
+			bankInfo({}).then(e => {
+				this.bankData = e.data;
+			});
+		},
+		// 加载余额信息
+		async loadData() {
+			extractBank({}).then(({ data }) => {
+				this.money = data.moneyCount;//可提现余额
+				this.minPrice = data.minPrice;//最小提现
+				this.freeze =data.inmoneyCount//提现中的余额
+			});
+		},
+		// 跳转
+		navTo(url) {
+			uni.navigateTo({
+				url: url
+			});
+		},
+		// 切换选中对象
+		tabRadio(e) {
+			this.type = e.detail.value;
+		},
+		// 提交
+		confirm() {
+			let data = {
+				extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
+				money: this.withdrawal, //金额
+				money_type: 1//0佣金1余额
+			}
+			if (this.type=='alipay') {
+				data.name = this.aliData.fullname;
+				data.alipay_code = this.aliData.alino;
+			}
+			if (this.type=='bank') {
+				data.name = this.bankData.fullname;
+				data.bankname = this.bankData.bank;
+				data.cardnum = this.bankData.bankno;
+			}
+			
+			
+			extractCash(data)
+				.then(e => {
+					uni.showToast({
+						title: '提交成功',
+						duration: 2000,
+						position: 'top'
+					});
+				})
+				.catch(e => {
+					console.log();
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	height: 100%;
+}
+.content-money {
+	padding: 30rpx 0;
+	background: #ffffff;
+}
+.flex {
+	background-color: #ffffff;
+	text-align: center;
+	margin: 0 30rpx;
+	border-radius: $border-radius-sm;
+	.buttom {
+		font-size: $font-lg;
+		width: 50%;
+	}
+	.interval {
+		width: 2px;
+		height: 60rpx;
+		background-color: #eeeeee;
+	}
+	.icon {
+		background-size: 100%;
+		font-size: 42rpx;
+		color: $font-color-dark;
+		font-weight: bold;
+		background-repeat: no-repeat;
+		background-position: center;
+	}
+	.text {
+		color: $font-color-light;
+	}
+}
+
+.row-box {
+	margin-top: 30rpx;
+	padding: 20rpx 30rpx;
+	background: #fff;
+	.title {
+		font-size: $font-base + 2rpx;
+		color: $font-color-dark;
+	}
+	.row {
+		display: flex;
+		align-items: center;
+		position: relative;
+		height: 80rpx;
+		.tit {
+			flex-shrink: 0;
+			width: 40rpx;
+			font-size: 30rpx;
+			color: $font-color-dark;
+		}
+		.input {
+			flex: 1;
+			font-size: 30rpx;
+			color: $font-color-dark;
+		}
+		.iconlocation {
+			font-size: 36rpx;
+			color: $font-color-light;
+		}
+
+		.buttom {
+			color: $font-color-spec;
+			font-size: $font-base;
+		}
+	}
+}
+.add-btn {
+	&.modified {
+		color: $base-color;
+	}
+	&.up {
+		background-color: $base-color;
+		color: #fff;
+	}
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	margin: 0 auto;
+	margin-top: 30rpx;
+	font-size: $font-lg;
+	border-radius: 10rpx;
+	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+}
+
+.list {
+	padding-left: 30rpx;
+	margin-top: 30rpx;
+	background-color: #ffffff;
+	.box {
+		display: flex;
+		align-items: center;
+		width: 100%;
+		height: 120rpx;
+		border-bottom: 1px solid $border-color-light;
+		.icon {
+			font-size: 48rpx;
+			padding-right: 20rpx;
+			.icon-img {
+				height: 50rpx;
+				width: 50rpx;
+			}
+		}
+		.iconweixin1 {
+			color: #18bf16;
+		}
+		.iconzhifubao {
+			color: #08aaec;
+		}
+		.title-box {
+			flex-grow: 1;
+			text-align: left;
+			.title {
+				font-size: $font-base + 2rpx;
+				color: $font-color-base;
+			}
+			.node {
+				font-size: $font-sm;
+				color: $font-color-light;
+			}
+		}
+	}
+}
+/deep/ .uni-radio-input {
+	width: 45rpx;
+	height: 45rpx;
+}
+</style>

BIN
static/icon/code.png


BIN
static/icon/dw.png


BIN
static/icon/i8.png


BIN
static/icon/jf.png


BIN
static/icon/jft.png


BIN
static/icon/noselect.png


BIN
static/icon/paytype.png


BIN
static/icon/phone.png


BIN
static/icon/pread.png


BIN
static/icon/psw.png


BIN
static/icon/select.png


BIN
static/image/jifen.png


BIN
static/image/sanchaji.png


BIN
static/img/img009.png


BIN
static/img/img010.png


BIN
static/img/jiedian.png


BIN
static/img/logo.png


BIN
static/img/qbbg.png


BIN
static/img/weixin.png


BIN
static/img/x.png


BIN
static/img/yong.png


BIN
static/img/yue.png


BIN
static/tabBar/dingdan.png


BIN
static/tabBar/home.png


BIN
static/tabBar/tab-cart-current.png


BIN
static/tabBar/tab-cart.png


BIN
static/tabBar/tab-cate-current.png


BIN
static/tabBar/tab-cate.png


BIN
static/tabBar/tab-home-current.png


BIN
static/tabBar/tab-home.png


BIN
static/tabBar/tab-my-current.png


BIN
static/tabBar/tab-my.png


BIN
static/tabBar/tab-store-current.png


BIN
static/tabBar/tab-store.png


+ 35 - 36
store/index.js

@@ -1,36 +1,35 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import user from './model/user'
-Vue.use(Vuex)
-
-const store = new Vuex.Store({
-	namespaced: true,
-	state: {
-		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
-		baseURL:'http://po.frp.liuniu946.com',//请求地址配置 
-		urlFile:'/index',//项目部署所在文件夹
-		userInfo: {}, //登录信息
-		loginInterceptor:false,//是否打开强制登录
-		// #ifdef H5 || MP-WEIXIN
-		weichatInfo:{},//保存微信注册信息
-		weichatObj:'',//微信对象
-		// #endif
-	},
-	mutations: {
-		//保存微信信息
-		setWeiChatInfo(state, provider) {
-			state.weichatInfo = provider;
-			
-		},
-		//保存微信对象
-		setWeiChatObj(state, provider) {
-			state.weichatObj = provider;
-		}
-	},
-	modules:{
-		user
-	},
-	actions: {}
-})
-
-export default store
+import Vue from 'vue'
+import Vuex from 'vuex'
+import user from './model/user'
+Vue.use(Vuex)
+
+const store = new Vuex.Store({
+	namespaced: true,
+	state: {
+		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
+		baseURL:'http://po.frp.liuniu946.com',//请求地址配置 
+		urlFile:'/index',//项目部署所在文件夹
+		userInfo: {}, //登录信息
+		loginInterceptor:false,//是否打开强制登录
+		// #ifdef H5 || MP-WEIXIN
+		weichatInfo:{},//保存微信注册信息
+		weichatObj:'',//微信对象
+		// #endif
+	},
+	mutations: {
+		//保存微信信息
+		setWeiChatInfo(state, provider) {
+			state.weichatInfo = provider;
+		},
+		//保存微信对象
+		setWeiChatObj(state, provider) {
+			state.weichatObj = provider;
+		}
+	},
+	modules:{
+		user
+	},
+	actions: {}
+})
+
+export default store

+ 1 - 0
utils/uni-copy.js

@@ -1,4 +1,5 @@
 export default function uniCopy({content,success,error}) {
+	console.log(content,"123456")
 	if(!content) return error('复制的内容不能为空 !')
 	content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
 	/**

Some files were not shown because too many files changed in this diff