소스 검색

2023-5-16

cmy 2 년 전
부모
커밋
5e1099b4fd
89개의 변경된 파일8153개의 추가작업 그리고 585개의 파일을 삭제
  1. 47 23
      api/index.js
  2. 0 9
      api/login.js
  3. 153 0
      api/order.js
  4. 186 0
      api/product.js
  5. 2 19
      api/user.js
  6. 2 2
      manifest.json
  7. 462 290
      pages.json
  8. 510 0
      pages/home/cart.vue
  9. 216 0
      pages/home/category.vue
  10. 161 208
      pages/home/index.vue
  11. 730 0
      pages/home/order.vue
  12. 0 0
      pages/home/user.vue
  13. 816 0
      pages/order/createOrder.vue
  14. 405 0
      pages/order/evaluate.vue
  15. 633 0
      pages/order/orderAfter.vue
  16. 185 0
      pages/order/orderDetail.vue
  17. 296 0
      pages/order/orderRefund.vue
  18. 172 0
      pages/order/shopList.vue
  19. 204 0
      pages/product/classify.vue
  20. 68 0
      pages/product/common/contentText.vue
  21. 139 0
      pages/product/common/discounts.vue
  22. 115 0
      pages/product/common/estimate.vue
  23. 78 0
      pages/product/common/freshDetail.vue
  24. 120 0
      pages/product/common/guessLike.vue
  25. 165 0
      pages/product/common/productBottom.vue
  26. 150 0
      pages/product/common/productContent.vue
  27. 55 0
      pages/product/common/topSwiper.vue
  28. 416 0
      pages/product/list.vue
  29. 648 0
      pages/product/product.vue
  30. 278 0
      pages/product/reply.vue
  31. 449 0
      pages/product/search.vue
  32. 252 0
      pages/product/showImg.vue
  33. 2 2
      pages/public/domApp.vue
  34. 9 8
      pages/public/login.vue
  35. 3 2
      pages/public/loginMethods.vue
  36. 1 1
      pages/public/phoneLogin.vue
  37. 9 4
      pages/public/redirect.vue
  38. 6 7
      pages/public/wxLogin.vue
  39. 1 1
      pages/user/model/model.vue
  40. 1 1
      pages/user/money/paySuccess.vue
  41. 1 1
      pages/user/myteam.vue
  42. 1 1
      pages/user/shareQrCode.vue
  43. BIN
      static/icon/goodsAddCart.png
  44. BIN
      static/icon/goodsServer.png
  45. BIN
      static/icon/hot.png
  46. BIN
      static/icon/index1.png
  47. BIN
      static/icon/index2.png
  48. BIN
      static/icon/index3.png
  49. BIN
      static/icon/index4.png
  50. BIN
      static/icon/index5.png
  51. BIN
      static/icon/tj.png
  52. BIN
      static/icon/底部菜单_slices/组 2291(1).png
  53. BIN
      static/icon/底部菜单_slices/组 2291(2).png
  54. BIN
      static/icon/底部菜单_slices/组 2291(3).png
  55. BIN
      static/icon/底部菜单_slices/组 2291(4).png
  56. BIN
      static/icon/底部菜单_slices/组 2291(5).png
  57. BIN
      static/icon/底部菜单_slices/组 2291(6).png
  58. BIN
      static/icon/底部菜单_slices/组 2291(7).png
  59. BIN
      static/icon/底部菜单_slices/组 2291(8).png
  60. BIN
      static/icon/底部菜单_slices/组 2291(9).png
  61. BIN
      static/icon/底部菜单_slices/组 2291.png
  62. BIN
      static/icon/底部菜单_slices/组 2291@2x(1).png
  63. BIN
      static/icon/底部菜单_slices/组 2291@2x(2).png
  64. BIN
      static/icon/底部菜单_slices/组 2291@2x(3).png
  65. BIN
      static/icon/底部菜单_slices/组 2291@2x(4).png
  66. BIN
      static/icon/底部菜单_slices/组 2291@2x(5).png
  67. BIN
      static/icon/底部菜单_slices/组 2291@2x(6).png
  68. BIN
      static/icon/底部菜单_slices/组 2291@2x(7).png
  69. BIN
      static/icon/底部菜单_slices/组 2291@2x(8).png
  70. BIN
      static/icon/底部菜单_slices/组 2291@2x(9).png
  71. BIN
      static/icon/底部菜单_slices/组 2291@2x.png
  72. 0 0
      static/image/bg.png
  73. 0 0
      static/image/domLogo.png
  74. BIN
      static/image/img009.png
  75. BIN
      static/image/img010.png
  76. BIN
      static/image/index-top.png
  77. 0 0
      static/image/tg-bg.png
  78. BIN
      static/tabBar/tab-cart-current.png
  79. BIN
      static/tabBar/tab-cart.png
  80. BIN
      static/tabBar/tab-cate-current.png
  81. BIN
      static/tabBar/tab-cate.png
  82. BIN
      static/tabBar/tab-home-current.png
  83. BIN
      static/tabBar/tab-home.png
  84. BIN
      static/tabBar/tab-my-current.png
  85. BIN
      static/tabBar/tab-my.png
  86. BIN
      static/tabBar/tab-order-current.png
  87. BIN
      static/tabBar/tab-order.png
  88. 1 1
      store/index.js
  89. 5 5
      utils/request.js

+ 47 - 23
api/index.js

@@ -1,55 +1,79 @@
 import request from '@/utils/request'
 
-// 获取版本号信息
-// #ifdef APP || H5
-export function getAppBBH(data) {
+// 促销商品
+export function groom4(data) {
 	return request({
-		url: '/api/version',
+		url: '/api/groom/list/4',
 		method: 'get',
 		data
 	});
 }
-// #endif
-
-
-// 消息通知
-export function articleList(data, id) {
+// 精品推荐
+export function groom1(data) {
 	return request({
-		url: '/api/article/list/' + id,
+		url: '/api/groom/list/1',
+		method: 'get',
+		data
+	});
+}
+// 新品首发
+export function groom3(data) {
+	return request({
+		url: '/api/groom/list/3',
 		method: 'get',
 		data
 	});
 }
 
-// 文章详细
-export function details(data, id) {
+// 获取首页信息
+export function loadIndexs(data) {
 	return request({
-		url: '/api/article/details/' + id,
+		url: '/api/index',
 		method: 'get',
 		data
 	});
 }
-// 是否已读
-export function notify_read(data) {
+
+//获取活动列表
+export function getActionList(data) {
 	return request({
-		url: '/api/car/notify_read',
-		method: 'post',
+		url: '/api/partake/out',
+		method: 'get',
 		data
 	});
 }
-// 获取首页引导图
-export function guide_map(data) {
+
+//获取活动详情
+export function getActionDetail(data,id) {
 	return request({
-		url: '/api/guide_map',
+		url: '/api/partake/out/' + id,
 		method: 'get',
 		data
 	});
 }
-//获取从业人员列表
-export function getWorkerList(data) {
+
+// 参加活动
+export function addAction(data) {
 	return request({
-		url: '/api/pub/getWorkerList',
+		url: '/api/partake/participate_in',
 		method: 'post',
 		data
 	});
 }
+
+export function getAddList(data) {
+	return request({
+		url: '/api/partake/partake',
+		method: 'get',
+		data
+	});
+}
+
+//
+export function getStoreList(data) {
+	return request({
+		url: '/api/store_list',
+		method: 'get',
+		data
+	})
+}

+ 0 - 9
api/login.js

@@ -27,15 +27,6 @@ export function verify(data) {
 	});
 }
 
-// 获取用户信息
-export function getUserInfo(data) {
-	return request({
-		url: '/api/user/userInfo',
-		method: 'get',
-		data
-	});
-}
-
 // 短信登录
 export function loginMobile(data) {
 	return request({

+ 153 - 0
api/order.js

@@ -0,0 +1,153 @@
+import request from '@/utils/request'
+import {upFilse} from '@/utils/request'
+// 订单确认
+export function confirm(data) {
+	return request({
+		url: '/api/order/confirm',
+		method: 'post',
+		data
+	});
+}
+//获取可使用优惠券
+export function couponsOrder(data,price) {
+	return request({
+		url: '/api/coupons/order/'+price,
+		method: 'get',
+		data
+	});
+}
+//获取优惠券列表
+export function getCouponsList(data,types) {
+	//优惠券状态 0全部 1未使用 2已使用
+	return request({
+		url: '/api/coupons/user/'+types,
+		method: 'get',
+		data
+	});
+}
+//提交评论
+export function order_comment(data) {
+	return request({
+		url: '/api/order/comment',
+		method: 'post',
+		data
+	});
+}
+//订单产品信息
+export function product(data) {
+	return request({
+		url: '/api/order/product',
+		method: 'post',
+		data
+	});
+}
+// 快递查询
+export function express_query(data) {
+	return request({
+		url: '/api/order/express_query',
+		method: 'get',
+		data
+	});
+}
+//上传图片
+export function upload(data) {
+	return upFilse({
+		url: '/api/upload/image',
+		method: 'post',
+		data
+	});
+}
+// 订单列表
+export function orderList(data) {
+	return request({
+		url: '/api/order/list',
+		method: 'get',
+		data
+	});
+}
+// 订单详细
+export function orderDetail(data,orderid) {
+	return request({
+		url: '/api/order/detail/'+orderid,
+		method: 'get',
+		data
+	});
+}
+
+// 取消订单
+export function orderCancel(data) {
+	return request({
+		url: '/api/order/cancel',
+		method: 'post',
+		data
+	});
+}
+
+// 删除订单
+export function orderDel(data) {
+	return request({
+		url: '/api/order/del',
+		method: 'post',
+		data
+	});
+}
+// 申请退款
+export function refund(data) {
+	return request({
+		url: '/api/order/refund/verify',
+		method: 'post',
+		data
+	});
+}
+// 退款理由列表
+export function refundReason(data) {
+	return request({
+		url: '/api/order/refund/reason',
+		method: 'get',
+		data
+	});
+}
+
+// 确认收货
+export function orderTake(data) {
+	return request({
+		url: '/api/order/take',
+		method: 'post',
+		data
+	});
+}
+
+// 订单支付
+export function orderPay(data) {
+	return request({
+		url: '/api/order/pay',
+		method: 'post',
+		data
+	});
+}
+
+// 创建订单
+export function createOrderkey(data,key) {
+	return request({
+		url: '/api/order/create/'+key,
+		method: 'post',
+		data
+	});
+}
+
+// 统计订单金额
+export function computedOrderkey(data) {
+	return request({
+		url: '/api/order/computed/'+data.orderkey,
+		method: 'post',
+		data
+	});
+}
+// 门店地址
+export function storeList(data) {
+	return request({
+		url: '/api/PublicController/store_list',
+		method: 'post',
+		data
+	});
+}

+ 186 - 0
api/product.js

@@ -0,0 +1,186 @@
+import request from '@/utils/request'
+
+// 获取商品列表
+export function getProducts(data) {
+	// 	{
+	// 参数名称	是否必须	示例	备注
+	// sid			否			二级分类编号
+	// cid			否			一级分类编号(!)
+	// keyword		否			搜索
+	// priceOrder	否			价格排序
+	// salesOrder	否			销量排序
+	// news			否			是否新品
+	// page			否			分页参数起始值
+	// limit		否			分页数步长值
+	// }
+	return request({
+		url: '/api/products',
+		method: 'get',
+		data
+	});
+}
+// 获取商品详情
+export function goodsDetail(data, id) {
+	return request({
+		url: '/api/product/detail/' + id,
+		method: 'get',
+		data
+	});
+}
+
+// 砍价列表
+export function getBargainList(data) {
+	return request({
+		url: '/api/bargain/list',
+		method: 'get',
+		data
+	});
+}
+// 加入购物车
+export function cartAdd(data) {
+	return request({
+		url: '/api/cart/add',
+		method: 'post',
+		data
+	});
+}
+
+// 收藏商品
+export function collectAdd(data) {
+	return request({
+		url: '/api/collect/add',
+		method: 'post',
+		data
+	});
+}
+
+// 取消收藏商品
+export function collectDel(data) {
+	return request({
+		url: '/api/collect/del',
+		method: 'post',
+		data
+	});
+}
+
+// 获取搜搜关键字
+export function searchKeyword(data) {
+	return request({
+		url: '/api/search/keyword',
+		method: 'get',
+		data
+	});
+}
+
+// 获取热门分类信息
+export function groomList(data,type) {
+	// 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
+	return request({
+		url: '/api/groom/list/'+type,
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取秒杀商品详细
+export function seckillGoods(data,id) {
+	return request({
+		url: '/api/seckill/detail/'+id,
+		method: 'get',
+		data
+	});
+}
+
+// 获取拼团商品详细
+export function groupGoods(data,id) {
+	return request({
+		url: '/api/combination/detail/'+id,
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取商品分类
+export function getCategoryList(data) {
+	return request({
+		url: '/api/category',
+		method: 'get',
+		data
+	});
+}
+
+
+// 获取拼团列表
+export function getCombinationList(data) {
+	return request({
+		url: '/api/combination/list',
+		method: 'get',
+		data
+	});
+}
+
+//取消拼团
+export function getCombinationLisRemove(data,id) {
+	return request({
+		url: '/api/combination/remove'+id,
+		method: 'get',
+		data
+	});
+}
+
+//拼团开团页面数据
+export function getCombinationLisPink(data,id) {
+	return request({
+		url: '/api/combination/pink/'+id,
+		method: 'get',
+		data
+	});
+}
+
+// 获取拼团海报
+export function getCombinationPoster(data) {
+	return request({
+		url: '/api/combination/poster',
+		method: 'post',
+		data
+	});
+}
+
+
+// 获取秒杀分类
+export function getSeckillClass(data) {
+	return request({
+		url: '/api/seckill/index',
+		method: 'get',
+		data
+	});
+}
+// 获取秒杀列表
+export function getSeckillList(data,id) {
+	return request({
+		url: '/api/seckill/list/'+id,
+		method: 'get',
+		data
+	});
+}
+
+
+// 产品评价数量和好评度
+export function reply_config(data,id) {
+	return request({
+		url: '/api/reply/config/'+id,
+		method: 'get',
+		data
+	});
+}
+// 获取产品评论
+export function reply_list(data,id) {
+	return request({
+		url: '/api/reply/list/'+id,
+		method: 'get',
+		data
+	});
+}
+

+ 2 - 19
api/user.js

@@ -20,7 +20,7 @@ export function real_name(data) {
 // 获取用户信息
 export function getUserInfo(data) {
 	return request({
-		url: '/api/user/userInfo',
+		url: '/api/userinfo',
 		method: 'get',
 		data
 	});
@@ -28,7 +28,7 @@ export function getUserInfo(data) {
 // 个人中心页数据
 export function getUser(data) {
 	return request({
-		url: '/api/user/userInfo',
+		url: '/api/user',
 		method: 'get',
 		data
 	});
@@ -270,20 +270,3 @@ export function getcar_status(data) {
 	});
 }
 
-//获取分享海报
-export function getWxmpInviteQrcode(data) {
-	return request({
-		url: '/api/user/getWxmpInviteQrcode',
-		method: 'post',
-		data
-	});
-}
-
-//获取下级
-export function getChildList(data) {
-	return request({
-		url: '/api/user/getChildList',
-		method: 'post',
-		data
-	});
-}

+ 2 - 2
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "母婴界严选",
+    "name" : "小井康泉",
     "appid" : "__UNI__F0EBD91",
     "description" : "",
     "versionName" : "1.0.19",
@@ -178,7 +178,7 @@
         "devServer" : {
             "proxy" : {
                 "/api" : {
-                    "target" : "https://api.myjie.cn/api",
+                    "target" : "http://sc.frp.liuniu946.com/api",
                     // "changeOrigin": true,
                     "pathRewrite" : {
                         "/api" : "" // rewrite path

+ 462 - 290
pages.json

@@ -1,6 +1,6 @@
 {
 	"pages": [{
-			"path": "pages/index/index",
+			"path": "pages/home/index",
 			"style": {
 				// #ifndef MP
 				"navigationStyle": "custom",
@@ -10,304 +10,470 @@
 				// #endif
 				// #ifdef MP
 				"navigationBarBackgroundColor": "#ff629f",
-				"navigationBarTextStyle":"white",
+				"navigationBarTextStyle": "white",
 				// #endif
-				"navigationBarTitleText": "母婴界严选"
+				"navigationBarTitleText": "小井康泉"
 			}
 		},
-		// {
-		// 	"path": "pages/cart/cart",
-		// 	"style": {
-		// 		// #ifndef MP-WEIXIN
-		// 		"navigationStyle": "custom",
-		// 		// #endif
-		// 		"navigationBarTitleText": "购物车"
-		// 	}
-		// },
 		{
-			"path": "pages/userhome/user",
+			"path": "pages/home/cart",
 			"style": {
+				// #ifndef MP-WEIXIN
 				"navigationStyle": "custom",
-				"navigationBarTitleText": "个人中心"
+				// #endif
+				"navigationBarTitleText": "购物车"
 			}
-		}
-	],
-	"subPackages": [
+		},
 		{
-		"root": "pages/modelData",
-		"name": "model_index",
-		"pages": [
-		]
-	},
-	{
-		"root": "pages/user",
-		"name": "user",
-		"pages": [
-			{
-				"path": "realName/realNameAuthentication",
-				"style": {
-					"navigationBarTitleText": "实名认证"
-				}
-			},
-			{
-				"path": "realName/cropper",
-				"style": {
-					"navigationBarTitleText": "图片裁切"
-				}
-			},
-			{
-				"path": "myteam",
-				"style": {
-					"navigationBarTitleText": "我的团队"
-				}
-			},
-			{
-				"path": "teamph",
-				"style": {
-					"navigationBarTitleText": "我的团队"
-				}
-			},
-			{
-				"path": "award/award",
-				"style": {
-					"navigationBarTitleText": "佣金",
-					"navigationBarBackgroundColor": "#f6ab0b",
-					"navigationBarTextStyle": "white"
-				}
-			},
-			{
-				"path": "award/awardList",
-				"style": {
-					"navigationBarTitleText": "佣金明细"
-				}
-			},
-			{
-				"path": "award/withdrawal",
-				"style": {
-					"navigationBarTitleText": "提现"
-				}
-			},
-			{
-				"path": "money/pay",
-				"style": {
-					"navigationBarTitleText": "支付",
-					"navigationBarBackgroundColor": "#0BBB62",
-					"navigationBarTextStyle": "white"
-				}
-			},
-			{
-				"path": "money/paySuccess",
-				"style": {
-					"navigationBarTitleText": "支付成功"
-				}
-			},
-			{
-				"path": "money/wallet",
-				"style": {
-					"navigationBarTitleText": "我的钱包",
-					"navigationBarBackgroundColor": "#0BBB62",
-					"navigationBarTextStyle": "white"
-				}
-			},
-			{
-				"path": "money/walletList",
-				"style": {
-					"navigationBarTitleText": "余额明细"
-				}
-			},
-			{
-				"path": "award/account",
-				"style": {
-					"navigationBarTitleText": "提现账号"
-				}
-			},
-			{
-				"path": "money/recharge",
-				"style": {
-					"navigationBarTitleText": "充值",
-					"navigationBarBackgroundColor": "#0BBB62",
-					"navigationBarTextStyle": "white"
-				}
-			},
-			{
-				"path": "shareQrCode",
-				"style": {
-					"navigationBarTitleText": "邀请好友"
-				}
-			},
-			{
-				"path": "model/modelrz",
-				"style": {
-					"navigationBarTitleText": "资料认证"
-				}
-			},
-			{
-				"path": "model/model",
-				"style": {
-					"navigationBarTitleText": ""
-				}
-			},
-			{
-				"path": "model/modelList",
-				"style": {
-					"navigationBarTitleText": "模板列表"
-				}
-			},
-			{
-				"path": "model/mymodellist",
-				"style": {
-					"navigationBarTitleText": "我的模板"
-				}
-			},
-			{
-				"path": "model/shoprz",
-				"style": {
-					"navigationBarTitleText": "平台认证"
-				}
-			},
-			{
-				"path": "model/phb",
-				"style": {
-					"navigationBarTitleText": "排行榜"
-				}
+			"path": "pages/home/order",
+			"style": {
+				// #ifndef MP-WEIXIN
+				"navigationStyle": "custom",
+				// #endif
+				"navigationBarTitleText": "订单"
 			}
-			
-		]
-	}, {
-		"root": "pages/set",
-		"name": "set",
-		"pages": [{
-				"path": "set",
-				"style": {
-					"navigationBarTitleText": "设置"
-				}
-			},
-			{
-				"path": "address",
-				"style": {
-					"navigationBarTitleText": "收货地址"
-				}
-			},
-			{
-				"path": "addressManage",
-				"style": {
-					"navigationBarTitleText": ""
-				}
-			},
-			{
-				"path": "phone",
-				"style": {
-					"navigationBarTitleText": "手机认证"
-				}
-			},
-			{
-				"path": "password",
-				"style": {
-					"navigationBarTitleText": "修改密码"
-				}
-			},
-			{
-				"path": "userinfo",
-				"style": {
-					"navigationBarTitleText": "修改资料"
-				}
+		},
+		{
+			"path": "pages/home/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": "分类"
 			}
-		]
-	}, {
-		"root": "pages/public",
-		"name": "public",
-		"pages": [
-			// #ifdef H5
-			{
-				"path": "domApp",
-				"style": {
-					"navigationBarTitleText": "app下载",
-					"app-plus": {
-						"titleNView": false
+		},
+		{
+			"path": "pages/home/user",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "个人中心"
+			}
+		}
+	],
+	"subPackages": [{
+			"root": "pages/order",
+			"name": "order",
+			"pages": [{
+					"path": "/orderAfter",
+					"style": {
+						"navigationBarTitleText": "售后管理"
 					}
-				}
-			},
-			// #endif
-			// #ifndef MP
-			{
-				"path": "workwork",
-				"style": {
-					"navigationBarTitleText": "关于我们"
-				}
-			},
-			// #endif
-			{
-				"path": "register",
-				"style": {
-					"navigationBarTitleText": "注册",
-					"app-plus": {
-						"titleNView": false
+				},
+				{
+					"path": "/orderDetail",
+					"style": {
+						"navigationBarTitleText": "订单详情",
+						"app-plus": {
+							"bounce": "none"
+						}
 					}
-				}
-			},
-			{
-				"path": "phoneLogin",
-				"style": {
-					"navigationBarTitleText": "手机登录",
-					"app-plus": {
-						"titleNView": false
+				},
+				// {
+				// 	"path": "/evaluate",
+				// 	"style": {
+				// 		"navigationBarTitleText": "评论"
+				// 	}
+				// },
+				{
+					"path": "/orderRefund",
+					"style": {
+						"navigationBarTitleText": "申请退款"
 					}
-				}
-			},
-			{
-				"path": "login",
-				"style": {
-					"navigationBarTitleText": "登录",
-					"app-plus": {
-						"titleNView": false
+				},
+				{
+					"path": "/createOrder",
+					"style": {
+						"navigationBarTitleText": "创建订单"
+					}
+				},
+				{
+					"path": "/shopList",
+					"style": {
+						"navigationBarTitleText": "门店列表"
 					}
 				}
-			},
-			// #ifdef MP || H5
-			{
-				"path": "wxLogin",
-				"style": {
-					"navigationBarTitleText": "微信登录",
-					"app-plus": {
-						"titleNView": {
-							"type": "transparent"
+			]
+		},
+		{
+			"root": "pages/product",
+			"name": "product",
+			"pages": [
+				// {
+				// 	"path": "/reply",
+				// 	"style": {
+				// 		"navigationBarTitleText": "商品评价",
+				// 		"app-plus": {
+				// 			"titleNView": {
+				// 				"type": "transparent"
+				// 			}
+				// 		}
+				// 	}
+				// },
+				{
+					"path": "/product",
+					"style": {
+						"navigationBarTitleText": "详情展示",
+						"app-plus": {
+							"titleNView": {
+								"type": "transparent"
+							}
 						}
 					}
-				}
-			},
-			// #endif
-			{
-				"path": "forget",
-				"style": {
-					"navigationBarTitleText": "忘记密码",
-					"app-plus": {
-						"titleNView": false
+				},
+				{
+					"path": "/showImg",
+					"style": {
+						"navigationBarTitleText": "图片预览",
+						"app-plus": {
+							"animationType": "fade-in",
+							"titleNView": {
+								"type": "transparent"
+							},
+							"animationDuration": 300
+						}
+					}
+				},
+				// {
+				// 	"path": "/seckill",
+				// 	"style": {
+				// 		"navigationBarTitleText": "限时秒杀"
+				// 	}
+				// },
+				// {
+				// 	"path": "/list",
+				// 	"style": {
+				// 		"enablePullDownRefresh": true,
+				// 		"navigationBarTitleText": "商品列表"
+				// 	}
+				// },
+				{
+					"path": "/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": "redirect",
-				"style": {
-					"navigationBarTitleText": "微信登录跳转页面",
-					"app-plus": {
-						"titleNView": false
+				// {
+				// 	"path": "pages/product/classify",
+				// 	"style": {
+				// 		"navigationStyle": "custom",
+				// 		"app-plus": {
+				// 			"titleNView": {
+				// 				"type": "transparent"
+				// 			}
+				// 		}
+				// 	}
+				// },
+			]
+		},
+		{
+			"root": "pages/user",
+			"name": "user",
+			"pages": [{
+					"path": "realName/realNameAuthentication",
+					"style": {
+						"navigationBarTitleText": "实名认证"
+					}
+				},
+				{
+					"path": "realName/cropper",
+					"style": {
+						"navigationBarTitleText": "图片裁切"
+					}
+				},
+				{
+					"path": "myteam",
+					"style": {
+						"navigationBarTitleText": "我的团队"
+					}
+				},
+				{
+					"path": "teamph",
+					"style": {
+						"navigationBarTitleText": "我的团队"
+					}
+				},
+				{
+					"path": "award/award",
+					"style": {
+						"navigationBarTitleText": "佣金",
+						"navigationBarBackgroundColor": "#f6ab0b",
+						"navigationBarTextStyle": "white"
+					}
+				},
+				{
+					"path": "award/awardList",
+					"style": {
+						"navigationBarTitleText": "佣金明细"
+					}
+				},
+				{
+					"path": "award/withdrawal",
+					"style": {
+						"navigationBarTitleText": "提现"
+					}
+				},
+				{
+					"path": "money/pay",
+					"style": {
+						"navigationBarTitleText": "支付",
+						"navigationBarBackgroundColor": "#0BBB62",
+						"navigationBarTextStyle": "white"
+					}
+				},
+				{
+					"path": "money/paySuccess",
+					"style": {
+						"navigationBarTitleText": "支付成功"
+					}
+				},
+				{
+					"path": "money/wallet",
+					"style": {
+						"navigationBarTitleText": "我的钱包",
+						"navigationBarBackgroundColor": "#0BBB62",
+						"navigationBarTextStyle": "white"
+					}
+				},
+				{
+					"path": "money/walletList",
+					"style": {
+						"navigationBarTitleText": "余额明细"
+					}
+				},
+				{
+					"path": "award/account",
+					"style": {
+						"navigationBarTitleText": "提现账号"
+					}
+				},
+				{
+					"path": "money/recharge",
+					"style": {
+						"navigationBarTitleText": "充值",
+						"navigationBarBackgroundColor": "#0BBB62",
+						"navigationBarTextStyle": "white"
+					}
+				},
+				{
+					"path": "shareQrCode",
+					"style": {
+						"navigationBarTitleText": "邀请好友"
+					}
+				},
+				{
+					"path": "model/modelrz",
+					"style": {
+						"navigationBarTitleText": "资料认证"
+					}
+				},
+				{
+					"path": "model/model",
+					"style": {
+						"navigationBarTitleText": ""
+					}
+				},
+				{
+					"path": "model/modelList",
+					"style": {
+						"navigationBarTitleText": "模板列表"
+					}
+				},
+				{
+					"path": "model/mymodellist",
+					"style": {
+						"navigationBarTitleText": "我的模板"
+					}
+				},
+				{
+					"path": "model/shoprz",
+					"style": {
+						"navigationBarTitleText": "平台认证"
+					}
+				},
+				{
+					"path": "model/phb",
+					"style": {
+						"navigationBarTitleText": "排行榜"
 					}
 				}
-			},
-			{
-				"path": "userAgreement",
-				"style": {
-					"navigationBarTitleText": "用户协议"
+
+			]
+		}, {
+			"root": "pages/set",
+			"name": "set",
+			"pages": [{
+					"path": "set",
+					"style": {
+						"navigationBarTitleText": "设置"
+					}
+				},
+				{
+					"path": "address",
+					"style": {
+						"navigationBarTitleText": "收货地址"
+					}
+				},
+				{
+					"path": "addressManage",
+					"style": {
+						"navigationBarTitleText": ""
+					}
+				},
+				{
+					"path": "phone",
+					"style": {
+						"navigationBarTitleText": "手机认证"
+					}
+				},
+				{
+					"path": "password",
+					"style": {
+						"navigationBarTitleText": "修改密码"
+					}
+				},
+				{
+					"path": "userinfo",
+					"style": {
+						"navigationBarTitleText": "修改资料"
+					}
 				}
-			},
-			{
-				"path": "privacyAgreement",
-				"style": {
-					"navigationBarTitleText": "隐私协议"
+			]
+		}, {
+			"root": "pages/public",
+			"name": "public",
+			"pages": [
+				// #ifdef H5
+				{
+					"path": "domApp",
+					"style": {
+						"navigationBarTitleText": "app下载",
+						"app-plus": {
+							"titleNView": false
+						}
+					}
+				},
+				// #endif
+				// #ifndef MP
+				{
+					"path": "workwork",
+					"style": {
+						"navigationBarTitleText": "关于我们"
+					}
+				},
+				// #endif
+				{
+					"path": "register",
+					"style": {
+						"navigationBarTitleText": "注册",
+						"app-plus": {
+							"titleNView": false
+						}
+					}
+				},
+				{
+					"path": "phoneLogin",
+					"style": {
+						"navigationBarTitleText": "手机登录",
+						"app-plus": {
+							"titleNView": false
+						}
+					}
+				},
+				{
+					"path": "login",
+					"style": {
+						"navigationBarTitleText": "登录",
+						"app-plus": {
+							"titleNView": false
+						}
+					}
+				},
+				// #ifdef MP || H5
+				{
+					"path": "wxLogin",
+					"style": {
+						"navigationBarTitleText": "微信登录",
+						"app-plus": {
+							"titleNView": {
+								"type": "transparent"
+							}
+						}
+					}
+				},
+				// #endif
+				{
+					"path": "forget",
+					"style": {
+						"navigationBarTitleText": "忘记密码",
+						"app-plus": {
+							"titleNView": false
+						}
+					}
+				},
+				{
+					"path": "redirect",
+					"style": {
+						"navigationBarTitleText": "微信登录跳转页面",
+						"app-plus": {
+							"titleNView": false
+						}
+					}
+				},
+				{
+					"path": "userAgreement",
+					"style": {
+						"navigationBarTitleText": "用户协议"
+					}
+				},
+				{
+					"path": "privacyAgreement",
+					"style": {
+						"navigationBarTitleText": "隐私协议"
+					}
 				}
-			}
-		]
-	}],
+			]
+		}
+	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "uni-app",
@@ -320,25 +486,31 @@
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{
-				"pagePath": "pages/index/index",
+				"pagePath": "pages/home/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/cart/cart",
-			// 	"iconPath": "static/tabBar/tab-cart.png",
-			// 	"selectedIconPath": "static/tabBar/tab-cart-current.png",
-			// 	"text": "购物车"
-			// },
 			{
-				"pagePath": "pages/userhome/user",
+				"pagePath": "pages/category/category",
+				"iconPath": "static/tabBar/tab-cate.png",
+				"selectedIconPath": "static/tabBar/tab-cate-current.png",
+				"text": "分类"
+			},
+			{
+				"pagePath": "pages/cart/cart",
+				"iconPath": "static/tabBar/tab-cart.png",
+				"selectedIconPath": "static/tabBar/tab-cart-current.png",
+				"text": "购物车"
+			},
+			{
+				"pagePath": "pages/cart/cart",
+				"iconPath": "static/tabBar/tab-order.png",
+				"selectedIconPath": "static/tabBar/tab-order-current.png",
+				"text": "订单"
+			},
+			{
+				"pagePath": "pages/home/user",
 				"iconPath": "static/tabBar/tab-my.png",
 				"selectedIconPath": "static/tabBar/tab-my-current.png",
 				"text": "我的"

+ 510 - 0
pages/home/cart.vue

@@ -0,0 +1,510 @@
+<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="../home/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-list">
+				<block v-for="(item, index) in cartList" :key="item.id">
+					<view class="cart-item" :class="{ 'b-b': index !== cartList.length - 1 }">
+						<view class="flex padding-r-20" @click="item.checked=!item.checked">
+							<image v-if='item.checked' class="checkedGoods" src="../../static/icon/addressIconXz.png"
+								mode="scaleToFill">
+							</image>
+							<view v-else class="icon-checked-box">
+
+							</view>
+						</view>
+						<image class="image-wrapper" :src="item.productInfo.image" :class="[item.loaded]"
+							mode="aspectFill" lazy-load @load="onImageLoad('cartList', index)"
+							@error="onImageError('cartList', index)"></image>
+						<view class="item-right">
+							<view class="clamp title">{{ item.productInfo.store_name }}</view>
+							<view class="attr">{{ item.productInfo.attrInfo.suk }}</view>
+							<view class="flex">
+								<text class="price">¥{{ item.productInfo.price }}</text>
+								<uni-number-box class="step" :min="1" :max="item.productInfo.stock"
+									:value="item.cart_num > item.productInfo.stock ? item.productInfo.stock : item.cart_num"
+									:isMax="item.cart_num >= item.productInfo.stock ? true : false"
+									:isMin="item.cart_num === 1" :index="index" @eventChange="numberChange">
+								</uni-number-box>
+							</view>
+							<view class="server" v-if="item.day>0">
+								(服务费:{{item.day_deducted}} 服务天数:{{item.day}})
+							</view>
+						</view>
+						<image class="del-btn" src="../../static/icon/goodsExit.png" @click="deleteCartItem(index)"
+							mode="scaleToFill"></image>
+					</view>
+				</block>
+			</view>
+			<!-- 底部菜单栏 -->
+			<view class="action-section">
+				<view class="flex leftBox">
+					<view class="checkbox" @click="check('all')">
+						<image class="icon-checked-box icon-checked" v-if='allChecked'
+							src="../../static/icon/addressIconXz.png" mode="scaleToFill"></image>
+						<view v-else class="icon-checked-box"></view>
+					</view>
+					<view class="margin-l-20">
+						全选
+					</view>
+				</view>
+				<view class="total-box">
+					<view class="font-size-base">
+						<text>合计:</text>
+						<text class="price">¥{{ total }}</text>
+
+					</view>
+					<view class="coupon">
+						共{{checkedNum}}件商品
+					</view>
+				</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 {
+		saveUrl,
+		interceptor
+	} from '@/utils/loginUtils.js';
+	export default {
+		data() {
+			return {
+				total: 0, //总价格
+				allChecked: false, //全选状态  true|false
+				empty: false, //空白页现实  true|false
+				cartList: []
+			};
+		},
+		onShow() {
+			uni.setTabBarStyle({
+				backgroundColor: '#FFFFFF'
+			})
+			// 只有登录时才加载数据
+			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']),
+			...mapState('shop', ['shopDetail']),
+			checkedNum() {
+				let num = 0;
+				for (var i = 0; i < this.cartList.length; i++) {
+					if (this.cartList[i].checked) {
+						num++
+					}
+				}
+				return num
+			},
+		},
+		methods: {
+			//请求数据
+			async loadData() {
+				let obj = this;
+				getCartList({
+					store_id:obj.shopDetail.id
+				})
+					.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();
+			},
+			//删除
+			deleteCartItem(index) {
+				let list = this.cartList;
+				let row = list[index];
+				let id = row.id;
+				uni.showModal({
+					title: '提示',
+					content: '是否删除'+row.productInfo.store_name,
+					success: res => {
+						if(res.confirm){
+							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;
+		/* #ifdef MP-WEIXIN || H5 */
+		padding-top: 30rpx;
+		/* #endif */
+		/* #ifdef APP */
+		padding-top: var(--status-bar-height);
+		/* #endif */
+		/* 空白页 */
+		.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-list {
+		padding: 0 30rpx;
+	}
+
+	.cart-item {
+		display: flex;
+		position: relative;
+		padding: 20rpx;
+		background-color: #FFFFFF;
+		margin-bottom: 20rpx;
+		border-radius: 20rpx;
+
+		.icon-checked-box {
+			width: 37rpx;
+			height: 37rpx;
+			z-index: 5;
+			border: 1px solid $font-color-light;
+			border-radius: 99rpx;
+		}
+
+		.checkedGoods {
+			width: 37rpx;
+			height: 37rpx;
+		}
+
+		.image-wrapper {
+			width: 170rpx;
+			height: 170rpx;
+			flex-shrink: 0;
+			position: relative;
+			border-radius: 20rpx;
+		}
+
+		.checkbox {
+			position: absolute;
+			left: -16rpx;
+			top: -16rpx;
+			z-index: 8;
+			font-size: 44rpx;
+			line-height: 1;
+			padding: 4rpx;
+			color: $font-color-disabled;
+			background: #fff;
+			border-radius: 50px;
+		}
+
+		.item-right {
+			overflow: hidden;
+			position: relative;
+			padding-left: 30rpx;
+			flex-grow: 1;
+
+			.title,
+			.price {
+				font-size: $font-base;
+				color: $font-color-dark;
+			}
+
+			.attr {
+				font-size: 24rpx;
+				color: $font-color-light;
+				height: 40rpx;
+				line-height: 40rpx;
+			}
+
+			.server {
+				font-size: 24rpx;
+				color: $font-color-light;
+				margin-top: 10rpx;
+			}
+
+			.price {
+				font-size: 30rpx;
+				color: $color-green;
+			}
+		}
+
+		.del-btn {
+			flex-shrink: 0;
+			height: 40rpx;
+			width: 40rpx;
+		}
+	}
+
+	/* 底部栏 */
+	.action-section {
+		/* #ifdef H5 */
+		margin-bottom: 100rpx;
+		/* #endif */
+		position: fixed;
+		left: 0rpx;
+		bottom: 0rpx;
+		z-index: 95;
+		display: flex;
+		align-items: center;
+		width: 750rpx;
+		height: 100rpx;
+		padding: 0 30rpx;
+		background: rgba(255, 255, 255, 0.9);
+
+		.leftBox {
+			padding-right: 30rpx;
+			border-right: 1px solid $font-color-disabled;
+		}
+
+		.checkbox {
+			line-height: 1;
+			font-size: 30rpx;
+
+			.icon-checked-box {
+				width: 37rpx;
+				height: 37rpx;
+				z-index: 5;
+				border: 1px solid $font-color-light;
+				border-radius: 99rpx;
+			}
+
+			.icon-checked {
+				border: none;
+				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-grow: 1;
+			padding-left: 30rpx;
+			font-size: 30rpx;
+
+			.price {
+				color: $color-green;
+			}
+
+			.coupon {
+				font-size: 24rpx;
+				color: $font-color-light;
+			}
+		}
+
+		.confirm-btn {
+			padding: 0 70rpx;
+			margin: 0;
+			border-radius: 100px;
+			height: 70rpx;
+			line-height: 70rpx;
+			font-size: 24rpx;
+			background: $color-yellow;
+			color: #714D01;
+		}
+	}
+
+	/* 复选框选中状态 */
+	.action-section .checkbox.checked,
+	.cart-item .checkbox.checked {
+		color: $base-color;
+	}
+</style>

+ 216 - 0
pages/home/category.vue

@@ -0,0 +1,216 @@
+<template>
+	<view class="content">
+		<scroll-view scroll-y class="left-aside">
+			<view v-for="item in flist" :key="item.id" class="f-item b-b" :class="{ active: item.id === currentId }" @click="tabtap(item)">{{ item.cate_name }}</view>
+		</scroll-view>
+		<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll" :scroll-top="tabScrollTop">
+			<view v-for="item in flist" :key="item.id" class="s-list" :id="'main-' + item.id">
+				<text class="s-item">{{ item.cate_name }}</text>
+				<view class="t-list ">
+					<view @click="navToList(item.id, titem.id)" class="t-item" v-for="titem in item.children" :key="titem.id">
+						<image :src="titem.pic"></image>
+						<text>{{ titem.cate_name }}</text>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+import { getCategoryList } from '@/api/product.js';
+export default {
+	data() {
+		return {
+			sizeCalcState: false,
+			tabScrollTop: 0,
+			currentId: 9,
+			flist: [],
+		};
+	},
+	onLoad() {
+		this.loadData();
+	},
+	// 监听导航栏输入框点击事件
+	onNavigationBarSearchInputClicked(e) {
+		uni.navigateTo({
+			url: '/pages/product/search'
+		});
+	},
+	methods: {
+		// 载入数据
+		async loadData() {
+			let obj = this;
+			getCategoryList({})
+				.then(({ data }) => {
+					obj.flist = data.map(function(s) {
+						return s;
+					});
+				})
+				.catch(err => {
+					console.log(err);
+				});
+		},
+		//一级分类点击
+		tabtap(item) {
+			console.log(item);
+			// 判断有没有初始化页面高度对象数据
+			if (!this.sizeCalcState) {
+				this.calcSize();
+			}
+			// 获取当前点击的id
+			this.currentId = item.id;
+			console.log(item.top);
+			this.tabScrollTop = item.top;
+			console.log(this.tabScrollTop);
+		},
+		//右侧栏滚动
+		asideScroll(e) {
+			// 判断有没有初始化页面高度对象数据
+			if (!this.sizeCalcState) {
+				this.calcSize();
+			}
+			let scrollTop = e.detail.scrollTop;
+			let box = 0; //列表包裹框高度初始化
+			let bottom = 10; //距离页面底部多少像素左侧列表切换到最后一个一级分类
+			// 查询当前页面对象
+			let view = uni.createSelectorQuery().select('.content');
+			view.fields(
+				{
+					id: true,
+					dataset: true,
+					rect: true,
+					size: true,
+					scrollOffset: true
+				},
+				function(e) {
+					// 保存包裹框高度
+					box = e.height;
+				}
+			).exec();
+			// 获取所有距离顶部大于滚轮距离页面高度的所有分类
+			let tabs = this.flist.filter(item =>( item.top-10) <= scrollTop).reverse();
+			if (tabs.length > 0) {
+				// 判断是否已经到达滚轮底部
+				if (box + scrollTop + bottom >= e.detail.scrollHeight) {
+					this.currentId = this.flist[this.flist.length - 1].id;
+				} else {
+					this.currentId = tabs[0].id;
+				}
+			}
+		},
+		//计算右侧栏每个tab的高度等信息
+		calcSize() {
+			let h = 0;
+			this.flist.forEach(item => {
+				let view = uni.createSelectorQuery().select('#main-' + item.id);
+				view.fields(
+					{
+						size: true
+					},
+					data => {
+						item.top = h;
+						h += data.height;
+						item.bottom = h;
+					}
+				).exec();
+			});
+			this.sizeCalcState = true;
+		},
+		navToList(sid, tid) {
+			// 点击导航跳转到详细页面
+			uni.navigateTo({
+				url: '/pages/product/list?fid='+this.currentId+'&sid='+sid+'&tid='+tid
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page,
+.content {
+	height: 100%;
+	background-color: #f8f8f8;
+}
+
+.content {
+	display: flex;
+}
+.left-aside {
+	flex-shrink: 0;
+	width: 200rpx;
+	height: 100%;
+	background-color: #fff;
+}
+.f-item {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 100%;
+	height: 100rpx;
+	font-size: 28rpx;
+	color: $font-color-base;
+	position: relative;
+	&.active {
+		color: $base-color;
+		background: #f8f8f8;
+		&:before {
+			content: '';
+			position: absolute;
+			left: 0;
+			top: 50%;
+			transform: translateY(-50%);
+			height: 36rpx;
+			width: 8rpx;
+			background-color: $base-color;
+			border-radius: 0 4px 4px 0;
+			opacity: 0.8;
+		}
+	}
+}
+
+.right-aside {
+	flex: 1;
+	overflow: hidden;
+	padding-left: 20rpx;
+	padding-right: 20rpx;
+}
+.s-item {
+	display: flex;
+	align-items: center;
+	height: 70rpx;
+	padding-top: 8rpx;
+	font-size: 28rpx;
+	color: $font-color-dark;
+}
+.t-list {
+	display: flex;
+	flex-wrap: wrap;
+	border-radius: 15rpx;
+	width: 100%;
+	background: #fff;
+	padding-top: 12rpx;
+	&:after {
+		content: '';
+		flex: 99;
+		height: 0;
+	}
+}
+.t-item {
+	flex-shrink: 0;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	flex-direction: column;
+	width: 171rpx;
+	font-size: 26rpx;
+	color: #666;
+	padding-bottom: 20rpx;
+
+	image {
+		width: 140rpx;
+		height: 140rpx;
+	}
+}
+</style>

+ 161 - 208
pages/index/index.vue → pages/home/index.vue

@@ -1,13 +1,12 @@
 <template>
 	<view class="container">
-		<!-- <image src="" mode=""></image> -->
 		<!-- 顶部logo and 搜索 start-->
 		<view class="index-top-wrap">
-			<image src="../../static/index/index-top.png" mode="widthFix" class="index-top"></image>
+			<image src="../../static/image/index-top.png" mode="scaleToFill" class="index-top"></image>
 			<view class="status_bar fud"></view>
 			<view class="top-search flex fud">
 				<view class="search-box flex" @click="clickSearch()">
-					<image class="search" src="../../static/icon/search-h.png" mode=""></image>
+					<image class="search" src="../../static/icon/search.png" mode=""></image>
 					<view class="search-font">输入关键词搜索</view>
 				</view>
 			</view>
@@ -26,94 +25,79 @@
 		<view class="cate-section flex">
 			<view class="cate-item flex" @click="navto('/pages/category/category')">
 				<view class="img-wrapper flex">
-					<image src="../../static/index/in1.png" mode=""></image>
+					<image src="../../static/icon/index1.png" mode=""></image>
 				</view>
-				<view class="item-title">全部商品</view>
+				<view class="item-title">一键叫水</view>
 			</view>
 			<view class="cate-item flex" @click="navto('/pages/index/artDetail?id=1')">
 				<view class="img-wrapper flex">
-					<image src="../../static/index/in2.png" mode=""></image>
+					<image src="../../static/icon/index2.png" mode=""></image>
 				</view>
-				<view class="item-title">公司介绍</view>
+				<view class="item-title">附近门店</view>
 			</view>
 			<view class="cate-item flex" @click="openKf">
 				<view class="img-wrapper flex">
-					<image src="../../static/index/in3.png" mode=""></image>
+					<image src="../../static/icon/index3.png" mode=""></image>
 				</view>
-				<view class="item-title">联系客服</view>
+				<view class="item-title">新闻简介</view>
 			</view>
-			<view class="cate-item flex" @click="navto('/pages/index/storeList')">
+			<view class="cate-item flex" @click="openKf">
 				<view class="img-wrapper flex">
-					<image src="../../static/index/in6.png" mode=""></image>
+					<image src="../../static/icon/index4.png" mode=""></image>
 				</view>
-				<view class="item-title">本地门店</view>
+				<view class="item-title">联系客服</view>
 			</view>
 			<view class="cate-item flex" @click="navto('/pages/user/shareQrCode',1)">
 				<view class="img-wrapper flex">
-					<image src="../../static/index/in4.png" mode=""></image>
+					<image src="../../static/icon/index5.png" mode=""></image>
 				</view>
-				<view class="item-title">邀请好友</view>
-			</view>
-			<view class="cate-item flex" @click="navto('/pages/index/artDetail?id=2')">
-				<view class="img-wrapper flex">
-					<image src="../../static/index/in7.png" mode=""></image>
-				</view>
-				<view class="item-title">加入我们</view>
+				<view class="item-title">充水票</view>
 			</view>
 		</view>
-		<!-- 分类 ed -->
-		<view class="jg">
-
-		</view>
-		<view class="hdlist" >
-			<image src="../../static/index/ryc.png" @click="navTo('/pages/index/actionDetail?id=1')" mode="widthFix"></image>
-			<image src="../../static/index/xny.png" @click="navTo('/pages/index/actionDetail?id=2')" mode="widthFix"></image>
-		</view>
 		<!-- 商品列表 start -->
-		<view class="product-box">
+		<view class="product-box flex">
 			<view class="product-tit flex">
-				<view class="hx">
-			
-				</view>
-				<view class="tit">
+				<text class="left-icon"></text>
+				<text class="tit">
 					热销推荐
-				</view>
-				<view class="hx">
-			
-				</view>
+				</text>
+				<text class="bottom-text">在售精品</text>
 			</view>
+			<view></view>
 		</view>
 		<view class="good-list">
-			<view class="good" v-for="item in goodList" @click="navTo('/pages/product/product?id=' + item.id)">
+			<view class="good flex" v-for="item in goodList" @click="navTo('/pages/product/product?id=' + item.id)">
 				<image :src="item.image" mode="" class="good-image"></image>
-				<view class="good-name ">
-					<view class="clamp">
-						{{item.store_name}}
+				<view class="right">
+					<view class="good-name ">
+						<view class="clamp2">
+							{{item.store_name}}
+						</view>
 					</view>
-				</view>
-				<view class="good-key">
-					鸿运开来 为成功喝彩
-				</view>
-				<view class="good-price">
-					<view class="price">
-						¥{{item.price}}
+					<view class="good-key">
+						鸿运开来 为成功喝彩
 					</view>
-					<view class="xl">
-						销量:{{item.sales}}
+					<view class="good-price flex">
+						<view class="price">
+							¥{{item.price}}/{{item.unit_name}}
+						</view>
+						<view class="xl" @click="navto('/pages/product/product?id='+item.id)">
+							立即购买
+						</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		<!-- 商品列表 ed-->
+		<!-- 客服 ed-->
 		<uni-popup ref="popupkf" type="center">
 			<view class="popup-box">
 				<view class="img">
-					<image src="../../static/img/img009.png" mode=""></image>
+					<image src="../../static/image/img009.png" mode=""></image>
 				</view>
 				<view class="mian">
 					<view class="delivery">
 						<view class="title">已经为您定制专属客服</view>
-						<image src="../../static/img/img010.png" mode=""></image>
+						<image src="../../static/image/img010.png" mode=""></image>
 					</view>
 					<view class="nocancel">客服VX:{{ text }}</view>
 					<view class="comfirm-box">
@@ -134,12 +118,12 @@
 		getUserInfo,
 		spread
 	} from '@/api/user.js';
-	import {
-		getBargainList,
-		getProducts,
-		goodsDetail,
-		poster
-	} from '@/api/product.js';
+	// import {
+	// 	getBargainList,
+	// 	getProducts,
+	// 	goodsDetail,
+	// 	poster
+	// } from '@/api/product.js';
 	import {
 		saveUrl,
 		interceptor
@@ -150,7 +134,6 @@
 	} from 'vuex';
 	// #ifdef H5
 	import {
-		weixindata,
 		shareLoad
 	} from '@/utils/wxAuthorized';
 	// #endif
@@ -158,30 +141,15 @@
 		data() {
 			return {
 				text: 'shxsophina', //客服微信
-				page: 1,
-				limitt: 20,
-				loadingType: 'more',
-				current: 0,
-				shareShow: false, //分享海报
 				pageProportion: 0, //保存页面基于750宽度的比例
-				swiperHeight: 0,
-				checkid: 0,
-				titleNViewBackground: '',
-				swiperCurrent: 0,
-				swiperLength: 0,
 				carouselList: [], //轮播列表
-				page: 1,
-				limit: 5,
-				firstList: [],
-				goodList: [], //商品列表
-				shopList: [],
-				period: 1,
-				shareImage: '',
+				goodList: [], //精选商品列表
 			};
 		},
 		computed: {
 			...mapState('user', ['hasLogin', 'userInfo'])
 		},
+		//#ifdef
 		onShareAppMessage(options) {
 			// 设置菜单中的转发按钮触发转发事件时的转发内容
 			let pages = getCurrentPages(); //获取加载的页面
@@ -191,7 +159,7 @@
 			let shareObj = {}
 			if (this.userInfo.uid) {
 				shareObj = {
-					title: this.userInfo.nickname + '邀请您加入顺肠清', // 默认是小程序的名称(可以写slogan等)
+					title: this.userInfo.nickname + '邀请您加入小井康泉', // 默认是小程序的名称(可以写slogan等)
 					path: url + '?scene=' + this.userInfo.uid, // 默认是当前页面,必须是以‘/’开头的完整路径
 					imageUrl: '',
 					success: function(res) {
@@ -209,7 +177,7 @@
 				};
 			} else {
 				shareObj = {
-					title: '顺肠清', // 默认是小程序的名称(可以写slogan等)
+					title: '小井康泉', // 默认是小程序的名称(可以写slogan等)
 					path: url, // 默认是当前页面,必须是以‘/’开头的完整路径
 					imageUrl: '',
 					success: function(res) {
@@ -226,12 +194,12 @@
 					}
 				};
 			}
-
 			return shareObj;
 		},
+		//#ifndef
 		onReachBottom() {
 			console.log('到底')
-			this.getGoodList()
+			// this.getGoodList()
 		},
 		onLoad: function(option) {
 			// #ifdef MP
@@ -243,9 +211,13 @@
 				});
 			}
 			// #endif
+			// #ifdef H5
+			// 加载公众号分享
+			shareLoad()
+			// #endif
 		},
 		onShow: function() {
-			this.getGoodList()
+			// this.getGoodList()
 			this.loadData();
 		},
 		methods: {
@@ -267,41 +239,15 @@
 					}
 				})
 			},
-			navto(url, type = 0) {
-				if (type == 1) {
-					if (!this.hasLogin) {
-						// 保存地址
-						saveUrl();
-						// 登录拦截
-						interceptor();
-					} else {
-						uni.navigateTo({
-							url,
-							fail() {
-								uni.switchTab({
-									url
-								})
-							}
+			navto(url) {
+				uni.navigateTo({
+					url,
+					fail() {
+						uni.switchTab({
+							url
 						})
 					}
-				} else {
-					uni.navigateTo({
-						url,
-						fail() {
-							uni.switchTab({
-								url
-							})
-						}
-					})
-				}
-
-			},
-			navTo(url) {
-				if (url == '') {
-					this.$api.msg('暂未开通,敬请期待');
-				} else {
-					this.navto(url)
-				}
+				})
 			},
 			// 點擊搜索框
 			clickSearch() {
@@ -315,31 +261,22 @@
 			},
 			// 请求载入数据
 			async loadData() {
+				const that = this;
+				console.log('商品信息');
 				loadIndexs({})
 					.then(({
 						data
 					}) => {
 						let goods = data.info;
-						console.log(goods, '商品信息');
-						this.carouselList = data.banner;
-						this.swiperLength = this.carouselList.length;
-						this.bastList = data.giftInfo; //会员礼包
-						data.info.firstList.forEach(e => {
-							e.isVip = e.store_type ? "3" : "0"
-						})
-						this.firstList = data.info.firstList //首页商品
+						that.carouselList = data.banner;
+						that.goodList = data.info.bastList;
+						console.log(that.carouselList)
 						uni.stopPullDownRefresh();
 					})
 					.catch(e => {
 						uni.stopPullDownRefresh();
 					});
 			},
-			//轮播图切换修改背景色
-			swiperChange(e) {
-				const index = e.detail.current;
-				this.swiperCurrent = index;
-				this.titleNViewBackground = this.carouselList[index].background;
-			},
 			// 轮播图跳转
 			bannerNavToUrl(item) {
 				// #ifdef H5
@@ -441,7 +378,7 @@
 
 		.search-box {
 			justify-content: center;
-			width: 698rpx;
+			width: 100%;
 			height: 60rpx;
 			background: #EEEEEE;
 			// box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
@@ -470,6 +407,7 @@
 		// margin: 20rpx 0 0;
 		border-radius: 20rpx;
 		margin: auto;
+
 		image {
 			width: 690rpx;
 			height: 365rpx;
@@ -498,11 +436,6 @@
 		}
 	}
 
-	.jg {
-		height: 20rpx;
-		background: #fff;
-	}
-
 	// 分类
 	.cate-section {
 		justify-content: space-around;
@@ -510,23 +443,25 @@
 		padding: 0rpx 0 10rpx;
 		margin-top: 20rpx;
 		flex-wrap: wrap;
+
 		.cate-item {
 			flex-grow: 0;
-			width: 33.3%;
+			width: 20%;
 			flex-direction: column;
 			text-align: center;
 			align-items: center;
 			justify-content: center;
 			padding-bottom: 20rpx;
+
 			.img-wrapper {
-				width: 90rpx;
-				height: 90rpx;
+				width: 140rpx;
+				height: 140rpx;
 				border-radius: 20rpx;
 				position: relative;
 
 				image {
-					width: 90rpx;
-					height: 90rpx;
+					width: 140rpx;
+					height: 140rpx;
 					position: absolute;
 					left: 50%;
 					top: 50%;
@@ -544,23 +479,32 @@
 	}
 
 	.product-box {
-		margin-top: 20rpx;
 		background: #ffffff;
-		padding: 26rpx 0 20rpx;
+		padding: 30rpx;
+		padding-top: 10rpx;
+
 		.product-tit {
 			justify-content: center;
-		
-			.hx {
-				width: 120rpx;
-				height: 1rpx;
-				background: #4A2723;
+
+			.left-icon {
+				width: 8rpx;
+				height: 38rpx;
+				background: linear-gradient(180deg, #3C82E6, #5395F5);
+				border-radius: 3px;
 			}
-		
+
 			.tit {
-				margin: 0 70rpx;
-				font-size: 30rpx;
-				font-weight: 500;
-				color: #4A2723;
+				padding-left: 15rpx;
+				font-size: 36rpx;
+				font-weight: bold;
+				color: #202739;
+			}
+
+			.bottom-text {
+				padding-left: 15rpx;
+				align-self: flex-end;
+				font-size: 20rpx;
+				color: #95A0B1;
 			}
 		}
 	}
@@ -672,15 +616,16 @@
 		background-color: #ffffff;
 		border-radius: 20rpx;
 		position: relative;
+
 		.product-tit {
 			justify-content: center;
-		
+
 			.hx {
 				width: 120rpx;
 				height: 1rpx;
 				background: #989898;
 			}
-		
+
 			.tit {
 				margin: 0 70rpx;
 				font-size: 30rpx;
@@ -688,6 +633,7 @@
 				color: #4A2723;
 			}
 		}
+
 		.img {
 			position: relative;
 			top: -56rpx;
@@ -768,61 +714,72 @@
 			}
 		}
 	}
+
 	.good-list {
-		display: flex;
-		justify-content: space-between;
-		flex-wrap: wrap;
 		padding: 20rpx 28rpx;
+		width: 750rpx;
 		.good {
-			width: 336rpx;
-			height: 482rpx;
 			background: #FFFFFF;
-			box-shadow: 0px 0px 6rpx 0px rgba(0, 0, 0, 0.1);
+			box-shadow: 0px 0px 20px 0px rgba(50,50,52,0.06);
+			width: 100%;
 			border-radius: 14rpx;
 			margin-bottom: 20rpx;
 			position: relative;
+			padding: 20rpx;
 			.good-image {
-				width: 336rpx;
-				height: 336rpx;
+				width: 170rpx;
+				height: 170rpx;
 				background-color: #eee;
-				border-radius: 14rpx 14rpx 0 0;
+				border-radius: 10rpx;
+				flex-shrink: 0;
+				
 			}
-	
-			.good-name {
-				font-size: 28rpx;
-				font-weight: bold;
-				color: #333333;
-				padding: 0 20rpx;
-			}
-			.good-key {
-				font-size: 22rpx;
-				font-weight: 500;
-				color: #999999;
-				padding-left: 20rpx
-			}
-			.good-price {
-				display: flex;
-				width: 336rpx;
-				justify-content: space-between;
-				font-size: 28rpx;
-				font-weight: bold;
-				color: #FF1A1A;
-				position: absolute;
-				bottom: 20rpx;
-				padding: 0 20rpx;
-				.xl{
-					font-size: 20rpx;
+			.right{
+				height: 170rpx;
+				position: relative;
+				
+				.good-name {
+					font-size: 28rpx;
 					font-weight: bold;
+					color: #333333;
+					padding-left: 20rpx;
+				}
+				
+				.good-key {
+					font-size: 22rpx;
+					font-weight: 500;
 					color: #999999;
+					padding-left: 20rpx
+				}
+				
+				.good-price {
+					display: flex;
+					justify-content: space-between;
+					align-items: flex-end;
+					font-size: 28rpx;
+					font-weight: bold;
+					color: #FF1A1A;
+					position: absolute;
+					bottom: 0rpx;
+					padding: 0 20rpx;
+					left: 0;
+					right:0rpx;
+					.xl {
+						background: linear-gradient(90deg, #3C82E6, #5395F5);
+						border-radius: $font-base;
+						padding: 10rpx 20rpx ;
+						color: #fff;
+					}
 				}
 			}
 		}
 	}
+
 	// .good-list {
 	// 	width: 750rpx;
 	// 	background:#fff;
 	// 	padding: 30rpx 0;
-	
+
 	// 	.good {
 	// 		width: 690rpx;
 	// 		height: 276rpx;
@@ -835,43 +792,43 @@
 	// 		&:last-of-type {
 	// 			margin-bottom: 0rpx;
 	// 		}
-	
+
 	// 		.good-img {
 	// 			flex-shrink: 0;
 	// 			width: 236rpx;
 	// 			height: 236rpx;
 	// 			border-radius: 10rpx;
 	// 			margin-right: 22rpx;
-	
+
 	// 			image {
 	// 				width: 236rpx;
 	// 				height: 236rpx;
 	// 				border-radius: 10rpx;
 	// 			}
 	// 		}
-	
+
 	// 		.good-info {
 	// 			flex-grow: 1;
 	// 			height: 100%;
 	// 			flex-direction: column;
 	// 			justify-content: space-between;
 	// 			align-items: flex-start;
-	
+
 	// 			.good-name {
 	// 				font-size: 32rpx;
 	// 				font-weight: bold;
 	// 				padding-top: 10rpx;
 	// 				color: #333333;
 	// 			}
-	
+
 	// 			.good-price {
 	// 				width: 100%;
-	
+
 	// 				image {
 	// 					width: 14rpx;
 	// 					margin: 0 6rpx 0 10rpx;
 	// 				}
-	
+
 	// 				.old-price {
 	// 					.old-left {
 	// 						font-size: 26rpx;
@@ -879,21 +836,21 @@
 	// 						text-decoration: line-through;
 	// 						color: #999999;
 	// 					}
-	
+
 	// 					.old-right {
 	// 						font-size: 24rpx;
 	// 						font-weight: bold;
 	// 						color: #B59467;
 	// 					}
 	// 				}
-	
+
 	// 				.new-price {
 	// 					width: 100%;
 	// 					font-size: 36rpx;
 	// 					font-weight: bold;
 	// 					color: #FF4C4C;
 	// 					justify-content: space-between;
-	
+
 	// 					.good-tip {
 	// 						width: 137rpx;
 	// 						height: 52rpx;
@@ -910,24 +867,20 @@
 	// 			}
 	// 		}
 	// 	}
-	
+
 	// }
 	.index-top-wrap {
 		position: relative;
+
 		.index-top {
 			width: 750rpx;
+			height: 288rpx;
 			position: absolute;
+
 		}
+
 		.fud {
 			position: relative;
 		}
 	}
-	.hdlist {
-		width: 100%;
-		image {
-			display: block;
-			width: 705rpx;
-			margin: 25rpx auto;
-		}
-	}
 </style>

+ 730 - 0
pages/home/order.vue

@@ -0,0 +1,730 @@
+<template>
+	<view class="content">
+		<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" class="swiper-box" 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="loadData">
+					<!-- 空白页 -->
+					<!-- #ifdef H5 -->
+					<empty src="../../static/error/emptyOrder.png"
+						v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+					<!-- #endif -->
+					<!-- #ifndef H5 -->
+					<empty src="../static/error/emptyOrder.png"
+						v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+					<!-- #endif -->
+					<!-- 订单列表 -->
+					<view @click="navTo('/pages/order/orderDetail?id=' + item.order_id)"
+						v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
+						<view class="i-top b-b">
+							<text class="time">{{ item._add_time }}</text>
+							<text class="state" :style="{ color: item.stateTipColor }">{{ item._status._title }}</text>
+							<text v-if="item.status === 4" class="del-btn iconfont icondelete"
+								@click="deleteOrder(index)"></text>
+						</view>
+
+						<scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
+							<view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
+								<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
+							</view>
+						</scroll-view>
+						<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo"
+							:key="goodsIndex">
+							<image class="goods-img" :src="goodsItem.productInfo.image" mode="scaleToFill"></image>
+							<view class="right">
+								<view class="flex flextop">
+									<text class="title clamp2">{{ goodsItem.productInfo.store_name }}</text>
+									<text class="price">{{ moneyNum(goodsItem.productInfo.price) }}</text>
+								</view>
+								<view class="row flex">
+									<text
+										class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
+									<text class="attr-box"> x {{ goodsItem.cart_num }}</text>
+								</view>
+								<view class="row flex">
+									<text class="attr-box">( 服务费:{{goodsItem.day_deducted}}
+										服务天数:{{goodsItem.day}})</text>
+								</view>
+							</view>
+						</view>
+						<!-- <view class="price-box">
+							共
+							<text class="num">{{ item.cartInfo.length }}</text>
+							件商品 邮费
+							<text class="price">{{ moneyNum(item.pay_postage)}}</text>
+							实付款
+							<text class="price">{{ moneyNum(item.pay_price)}}</text>
+						</view> -->
+						<view class="action-box b-t" v-if="tabItem.state != 4">
+							<button v-if="item._status._title == '未支付'" class="action-btn"
+								@click.stop="cancelOrder(item)">取消订单</button>
+							<button v-if="item._status._title == '未支付'"
+								@click.stop="navTo( '/pages/user/money/pay?type=1&ordid=' + item.order_id + '&money=' + item.pay_price)"
+								class="action-btn recom">前往支付</button>
+							<button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
+							<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)"
+								class="action-btn">确认收货</button>
+							<button v-if="item._status._title == '未发货'||item._status._title == '未领车'"
+								class="action-btn btn-red"
+								@click.stop="navTo('/pages/order/orderRefund?id=' + item.order_id)">申请退款</button>
+						</view>
+					</view>
+
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+	import {
+		orderList,
+		orderCancel,
+		orderDel,
+		orderTake
+	} from '@/api/order.js';
+	export default {
+		data() {
+			return {
+				tabCurrentIndex: 0,
+				navList: [{
+						state: 0,
+						text: '待付款',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					},
+					{
+						state: 1,
+						text: '待发货',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					},
+					{
+						state: 2,
+						text: '待收货',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					},
+					// {
+					// 	state: 3,
+					// 	text: '待评价',
+					// 	loadingType: 'more',
+					// 	orderList: [],
+					// 	page: 1, //当前页数
+					// 	limit: 10 //每次信息条数
+					// },
+					{
+						state: 4,
+						text: '已完成',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					}
+				]
+			};
+		},
+
+		onLoad(options) {
+			/**
+			 * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
+			 * 替换onLoad下代码即可
+			 */
+			this.tabCurrentIndex = +options.state;
+			// #ifndef MP
+			this.loadData();
+			// #endif
+			// #ifdef MP
+			if (options.state == 0) {
+				this.loadData();
+			}
+			// #endif
+		},
+		// #ifdef APP-PLUS || H5
+		onBackPress(e) {
+			uni.switchTab({
+				url: '/pages/user/user',
+			});
+			return true;
+		},
+		// #endif
+		methods: {
+			// 转换金额为数字
+			moneyNum(value) {
+				return +value;
+			},
+			// 确认收货
+			orderTake(item, index) {
+				let obj = this;
+				uni.showModal({
+					title: '是否确认收货?',
+					success: () => {
+						orderTake({
+								uni: item.order_id
+							})
+							.then(e => {
+								obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
+								uni.showToast({
+									title: '收货成功'
+								});
+							})
+							.catch(e => {
+								console.log(e);
+							});
+					}
+				});
+			},
+			// 跳转页面
+			navTo(url) {
+				uni.navigateTo({
+					url
+				});
+			},
+			//获取订单列表
+			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';
+
+				orderList({
+						type: state,
+						page: navItem.page,
+						limit: navItem.limit
+					})
+					.then(({
+						data
+					}) => {
+						let arr = data.map(e => {
+							let b = this.orderStateExp(e.status);
+							e.stateTip = b.stateTip;
+							e.stateTipColor = b.stateTipColor;
+							return e;
+						});
+						navItem.orderList = navItem.orderList.concat(arr);
+						// console.log(navItem.orderList);
+						navItem.page++;
+						if (navItem.limit == data.length) {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
+							return;
+						} else {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							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;
+			},
+			//删除订单
+			deleteOrder(index) {
+				uni.showLoading({
+					title: '请稍后',
+					mask: true
+				});
+				setTimeout(() => {
+					this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
+					uni.hideLoading();
+				}, 600);
+			},
+			//取消订单
+			cancelOrder(item) {
+				uni.showModal({
+					title: '订单取消',
+					content: '是否取消订单?',
+					success: e => {
+						if (e.confirm) {
+							uni.showLoading({
+								title: '请稍后',
+								mask: true
+							});
+							orderCancel({
+									id: item.order_id
+								})
+								.then(e => {
+									uni.showToast({
+										title: '取消成功',
+										duration: 2000,
+										position: 'top'
+									});
+								})
+								.catch(e => {
+									console.log(e);
+								});
+							//取消订单后删除待付款中该项
+							let list = this.navList[this.tabCurrentIndex].orderList;
+							let index = list.findIndex(val => val.id === item.id);
+							index !== -1 && list.splice(index, 1);
+							uni.hideLoading();
+						}
+					}
+				});
+			},
+
+			//订单状态文字和颜色
+			orderStateExp(state) {
+				let stateTip = '',
+					stateTipColor = '#fa436a';
+				switch (+state) {
+					case 0:
+						stateTip = '待付款';
+						break;
+					case 1:
+						stateTip = '待发货';
+						break;
+					case 2:
+						stateTip = '待收货';
+						break;
+					case 3:
+						stateTip = '待评价';
+						break;
+					case 4:
+						stateTip = '已完成';
+						stateTipColor = '#5dbc7c';
+						break;
+					case 9:
+						stateTip = '订单已关闭';
+						stateTipColor = '#909399';
+						break;
+
+						//更多自定义
+				}
+				return {
+					stateTip,
+					stateTipColor
+				};
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page,
+	.content {
+		background: $page-color-base;
+		height: 100%;
+	}
+
+	.swiper-box {
+		height: calc(100% - 40px);
+	}
+
+	.list-scroll-content {
+		height: 100%;
+		padding-top: 30rpx;
+	}
+
+	.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;
+				}
+			}
+		}
+	}
+
+	.uni-swiper-item {
+		height: auto;
+	}
+
+	.order-item {
+		display: flex;
+		flex-direction: column;
+		padding-left: 30rpx;
+		background: #fff;
+		margin: 0 $page-row-spacing;
+		margin-bottom: 30rpx;
+		border-radius: 20rpx;
+		padding-bottom: 10rpx;
+
+		.i-top {
+			display: flex;
+			align-items: center;
+			height: 80rpx;
+			padding-right: 30rpx;
+			font-size: $font-base;
+			color: $font-color-dark;
+			position: relative;
+
+			.time {
+				flex: 1;
+			}
+
+			.state {
+				color: $base-color;
+			}
+
+			.del-btn {
+				padding: 10rpx 0 10rpx 36rpx;
+				font-size: $font-lg;
+				color: $font-color-light;
+				position: relative;
+
+				&:after {
+					content: '';
+					width: 0;
+					height: 30rpx;
+					border-left: 1px solid $border-color-dark;
+					position: absolute;
+					left: 20rpx;
+					top: 50%;
+					transform: translateY(-50%);
+				}
+			}
+		}
+
+		/* 多条商品 */
+		.goods-box {
+			height: 160rpx;
+			padding: 20rpx 0;
+			white-space: nowrap;
+
+			.goods-item {
+				width: 120rpx;
+				height: 120rpx;
+				display: inline-block;
+				margin-right: 24rpx;
+			}
+
+			.goods-img {
+				display: block;
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		/* 单条商品 */
+		.goods-box-single {
+			display: flex;
+			padding: 20rpx 0;
+
+			.goods-img {
+				display: block;
+				width: 170rpx;
+				height: 170rpx;
+				border-radius: 20rpx;
+			}
+
+			.right {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				padding: 0 30rpx 0 24rpx;
+				overflow: hidden;
+
+				.flextop {
+					align-items: flex-start;
+					line-height: 1.3;
+				}
+
+				.row {
+					margin-top: 10rpx;
+				}
+
+				.row_title {
+					padding: 5rpx 10rpx;
+					background-color: #dddddd;
+					border-radius: 10rpx;
+					font-size: 22rpx;
+					color: #ffffff;
+				}
+
+				.title {
+					font-size: $font-base + 2rpx;
+					color: $font-color-dark;
+					width: 80%;
+					min-height: 2rem;
+				}
+
+				.attr-box {
+					display: flex;
+					justify-content: flex-end;
+					font-size: $font-sm + 2rpx;
+					color: $font-color-light;
+				}
+
+				.price {
+					display: inline;
+					font-size: $font-base + 2rpx;
+					color: $font-color-light;
+
+					&:before {
+						content: '¥';
+						font-size: $font-sm;
+
+					}
+				}
+			}
+		}
+
+		.price-box {
+			display: flex;
+			justify-content: flex-end;
+			align-items: baseline;
+			padding: 20rpx 30rpx;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-light;
+
+			.num {
+				margin: 0 8rpx;
+				color: $font-color-dark;
+			}
+
+			.price {
+				font-size: $font-lg;
+				color: $font-color-dark;
+
+				&:before {
+					content: '¥';
+					font-size: $font-sm;
+					margin: 0 2rpx 0 8rpx;
+				}
+			}
+		}
+
+		.action-box {
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+			height: 100rpx;
+			position: relative;
+			padding-right: 30rpx;
+		}
+
+		.action-btn {
+			width: 160rpx;
+			height: 60rpx;
+			margin: 0;
+			margin-left: 24rpx;
+			padding: 0;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-dark;
+			background: #fff;
+			border-radius: 100px;
+
+			&.btn-red {
+				color: $color-red;
+				border: 1px solid $color-red;
+			}
+
+			&:after {
+				border-radius: 100px;
+			}
+
+			&.recom {
+				color: $base-color;
+
+				&:after {
+					border-color: $base-color;
+				}
+			}
+
+			&.evaluate {
+				color: $color-yellow;
+
+				&:after {
+					border-color: $color-yellow;
+				}
+			}
+		}
+	}
+
+	/* load-more */
+	.uni-load-more {
+		display: flex;
+		flex-direction: row;
+		height: 80rpx;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.uni-load-more__text {
+		font-size: 28rpx;
+		color: #999;
+	}
+
+	.uni-load-more__img {
+		height: 24px;
+		width: 24px;
+		margin-right: 10px;
+	}
+
+	.uni-load-more__img>view {
+		position: absolute;
+	}
+
+	.uni-load-more__img>view view {
+		width: 6px;
+		height: 2px;
+		border-top-left-radius: 1px;
+		border-bottom-left-radius: 1px;
+		background: #999;
+		position: absolute;
+		opacity: 0.2;
+		transform-origin: 50%;
+		animation: load 1.56s ease infinite;
+	}
+
+	.uni-load-more__img>view view:nth-child(1) {
+		transform: rotate(90deg);
+		top: 2px;
+		left: 9px;
+	}
+
+	.uni-load-more__img>view view:nth-child(2) {
+		transform: rotate(180deg);
+		top: 11px;
+		right: 0;
+	}
+
+	.uni-load-more__img>view view:nth-child(3) {
+		transform: rotate(270deg);
+		bottom: 2px;
+		left: 9px;
+	}
+
+	.uni-load-more__img>view view:nth-child(4) {
+		top: 11px;
+		left: 0;
+	}
+
+	.load1,
+	.load2,
+	.load3 {
+		height: 24px;
+		width: 24px;
+	}
+
+	.load2 {
+		transform: rotate(30deg);
+	}
+
+	.load3 {
+		transform: rotate(60deg);
+	}
+
+	.load1 view:nth-child(1) {
+		animation-delay: 0s;
+	}
+
+	.load2 view:nth-child(1) {
+		animation-delay: 0.13s;
+	}
+
+	.load3 view:nth-child(1) {
+		animation-delay: 0.26s;
+	}
+
+	.load1 view:nth-child(2) {
+		animation-delay: 0.39s;
+	}
+
+	.load2 view:nth-child(2) {
+		animation-delay: 0.52s;
+	}
+
+	.load3 view:nth-child(2) {
+		animation-delay: 0.65s;
+	}
+
+	.load1 view:nth-child(3) {
+		animation-delay: 0.78s;
+	}
+
+	.load2 view:nth-child(3) {
+		animation-delay: 0.91s;
+	}
+
+	.load3 view:nth-child(3) {
+		animation-delay: 1.04s;
+	}
+
+	.load1 view:nth-child(4) {
+		animation-delay: 1.17s;
+	}
+
+	.load2 view:nth-child(4) {
+		animation-delay: 1.3s;
+	}
+
+	.load3 view:nth-child(4) {
+		animation-delay: 1.43s;
+	}
+
+	@-webkit-keyframes load {
+		0% {
+			opacity: 1;
+		}
+
+		100% {
+			opacity: 0.2;
+		}
+	}
+</style>

+ 0 - 0
pages/userhome/user.vue → pages/home/user.vue


+ 816 - 0
pages/order/createOrder.vue

@@ -0,0 +1,816 @@
+<template>
+	<view class="padding-t-30">
+		<view class="flex">
+			<view class="">
+				收货方式
+			</view>
+			<view class="flex">
+				<view class="">
+					配送
+				</view>
+				<view class="">
+					自提
+				</view>
+			</view>
+		</view>
+		<!-- 地址 -->
+		<navigator  v-if="tabCurrentIndex == 2" url="/pages/set/address?source=1" class="address-section">
+			<view class="order-content" v-if="addressData.real_name">
+				<view class="cen">
+					<view class="top">
+						<text class="name">{{ addressData.real_name }}</text>
+						<text class="mobile">{{ addressData.phone }}</text>
+					</view>
+					<text
+						class="address flex">{{ addressData.province + addressData.city + addressData.district }}{{ addressData.detail }}</text>
+				</view>
+				<text class="iconfont iconenter"></text>
+			</view>
+			<view class="order-content" v-if="!addressData.real_name">
+				<view class="addAddress">
+					<text class="iconfont iconaddition"></text>
+					<text>添加收货地址</text>
+				</view>
+			</view>
+		</navigator>
+		<navigator v-if="tabCurrentIndex == 1" url="/pages/order/shopList" class="address-section">
+			<view class="order-content" v-if="shopAddress.name">
+				<text class="iconfont iconlocation"></text>
+				<view class="cen">
+					<view class="top">
+						<text class="name">{{ shopAddress.name }}</text>
+						<text class="mobile">{{ shopAddress.phone }}</text>
+					</view>
+					<text class="address">{{ shopAddress.address }}</text>
+				</view>
+				<text class="iconfont iconenter"></text>
+			</view>
+			<view class="order-content" v-if="!shopAddress.name">
+				<view class="addAddress">
+					<text class="iconfont iconaddition"></text>
+					<text>添加收货地址</text>
+				</view>
+			</view>
+		
+			<image class="a-bg" :src="addressImg"></image>
+		</navigator>
+		<view class="goodsList">
+
+			<view class="goods-section" v-for="(ls, ind) in shopList" :key="ind">
+				<!-- 商品列表 -->
+				<view class="g-item">
+					<image :src="ls.productInfo.image"></image>
+					<view class="right">
+						<text class="title clamp">{{ ls.productInfo.store_name }}</text>
+						<text class="spec">{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.suk : '默认' }}</text>
+						<view class="price-box">
+							<text
+								class="price">¥{{ ls.productInfo.attrInfo ? ls.productInfo.attrInfo.price : ls.productInfo.price }}</text>
+							<text class="number">{{ 'x ' + ls.cart_num + (ls.productInfo.unit_name || '') }}</text>
+							<!-- <view class="number">
+							<uni-number-box class="step" :value="lss.number" :index="indx" @eventChange="numberChange"></uni-number-box>
+						</view> -->
+						</view>
+						<view class="serverSet" v-if="ls.day>0">
+							(<text>服务费:{{ls.day_deducted}}</text>
+							<text class="margin-l-10">服务天数:{{ls.day}}天</text>)
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 金额明细 -->
+		<view class="yt-list">
+			<view class="yt-list-cell b-b">
+				<text class="cell-tit clamp">运费</text>
+				<text class="cell-tip disabled">{{ Postage }}</text>
+			</view>
+			<view class="yt-list-cell b-b">
+				<text class="cell-tit clamp">备注</text>
+				<input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />
+			</view>
+		</view>
+
+
+		<view class="yt-list">
+			<view class="yt-list-cell b-b" v-if="fx" @click="payType='weixin'">
+				<view class="cell-tit flex">
+					<image class="orderIcon" src="../../static/icon/orderWx.png" mode="widthFix"></image>
+					<text class="margin-l-10">微信支付</text>
+				</view>
+				<image class="checked" v-if="payType=='weixin'" src="../../static/icon/addressIconXz.png"
+					mode="widthFix"></image>
+				<view v-else class="noChecked"></view>
+			</view>
+			<!-- #ifdef APP-PLUS -->
+			<view class="yt-list-cell b-b" @click="payType='ali'">
+				<view class="cell-tit flex">
+					<image class="orderIcon" src="../../static/icon/orderAli.png" mode="widthFix"></image>
+					<text class="margin-l-10">支付宝</text>
+				</view>
+				<image class="checked" v-if="payType=='ali'" src="../../static/icon/addressIconXz.png" mode="widthFix">
+				</image>
+				<view v-else class="noChecked"></view>
+			</view>
+			<!-- #endif -->
+			<view class="yt-list-cell b-b" @click="payType='yue'">
+				<view class="cell-tit flex">
+					<image class="orderIcon" src="../../static/icon/ye.png" mode="widthFix"></image>
+					<text class="margin-l-10">余额({{now_money}})</text>
+				</view>
+				<image class="checked" v-if="payType=='yue'" src="../../static/icon/addressIconXz.png" mode="widthFix">
+				</image>
+				<view v-else class="noChecked"></view>
+			</view>
+		</view>
+
+
+		<!-- 底部 -->
+		<view class="footer">
+			<view class="price-content">
+				<text>实付款</text>
+				<text class="price-tip">¥</text>
+				<text class="price">{{ payPrice }}</text>
+			</view>
+			<text class="submit" :class="{submitNo:payLoding}" @click="payLoding?'':submit()">提交订单</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	import {
+		confirm,
+		computedOrderkey,
+		createOrderkey,
+		orderPay
+	} from '@/api/order.js';
+	import {
+		getUserInfo
+	} from '@/api/user.js';
+	// #ifdef H5
+	import weixinObj from "@/plugin/jweixin-module/index.js";
+	// #endif
+	export default {
+		data() {
+			return {
+				tabCurrentIndex:2,//1为自提2为配送
+				// #ifdef APP
+				payType: 'ali',
+				// #ifndef
+				// #ifndef APP
+				payType: 'weixin',
+				// #ifndef
+				desc: '', //备注
+				// 收货地址
+				addressData: {},
+				// 店铺地址
+				shopAddress: {
+					name: '',
+					mobile: '',
+					addressName: '',
+					address: '',
+					area: '',
+					default: false,
+					id: ''
+				},
+				// 商品列表
+				shopList: [],
+				// 购物车id
+				cartId: '',
+				//购物金额详情
+				moneyAll: {
+					storeFreePostage: 0, //邮费优惠
+					storePostage: 0, //邮费
+					totalPrice: 0, //总支付金额
+					vipPrice: 0 //vip优惠价
+				},
+				payPrice: 0, //总支付金额
+				orderKey: '', //订单id
+				payLoding: false, //判断是否支付中
+				orderId: '', //订单id
+				now_money: 0, //余额
+				onShopId: -1, //默认-1为不存在商家id
+				system_store: [], //到店自提列表仓库
+			};
+		},
+		onLoad(option) {
+			// 保存当前商品在购物车中的id
+			this.cartId = option.id;
+			// 判断是否要读取商家id
+			if (option.shopId) {
+				this.onShopId = option.shopId;
+			}
+			this.loadData();
+			this.userinfo();
+		},
+		computed: {
+			Postage() {
+				let money = +this.moneyAll.storePostage;
+				if (money == 0) {
+					return '免运费';
+				} else {
+					return '¥' + money;
+				}
+			},
+			payAllMoney() {
+				return +this.moneyAll.totalPrice + +this.moneyAll.vipPrice;
+			},
+			...mapState('shop', ['shopDetail']),
+			...mapState(['fx'])
+		},
+		methods: {
+			// 加载用户基础信息
+			userinfo() {
+				getUserInfo({}).then(({
+					data
+				}) => {
+					this.now_money = data.now_money;
+				});
+			},
+			// 计算支付金额
+			payMoneyNub() {
+				computedOrderkey({
+						orderkey: this.orderKey,
+						useIntegral: 0, //是否积分抵扣
+						addressId: this.addressData.id //地址编号
+					})
+					.then(({
+						data
+					}) => {
+						this.integralShow = true;
+						// 获取支付金额
+						this.payPrice = +data.result.pay_price;
+						this.integralMoney = data.result.deduction_price;
+					})
+					.catch(e => {
+						console.log(e);
+						this.integralShow = false;
+					});
+			},
+			// 加载基础数据
+			loadData() {
+				let obj = this;
+				confirm({
+					cartId: obj.cartId + ''
+				}).then(({
+					data
+				}) => {
+					obj.addressData = data.addressInfo || {};
+					obj.shopList = data.cartInfo; //商品列表
+					obj.moneyAll = data.priceGroup; //金额数据
+					obj.orderKey = data.orderKey; //订单key
+					obj.system_store = data.system_store;//到店自提列表
+					obj.shopAddress = data.system_store[0]; //选中的地址
+					// 计算金额
+					this.payMoneyNub();
+				});
+			},
+			// 提交订单
+			submit() {
+				let obj = this;
+				if (!this.addressData.real_name) {
+					this.$api.msg('请选择收货地址');
+					return false;
+				}
+				// 判断是否余额不足
+				if (obj.payType == 'yue' && +obj.now_money < obj.payPrice) {
+					uni.showModal({
+						title: '提示',
+						content: '账户余额不足!',
+						showCancel: false,
+					});
+					return;
+				}
+
+				uni.showLoading({
+					title: '支付中',
+					mask: true
+				})
+				// 支付中
+				obj.payLoding = true;
+				// 判断是否为未支付订单中跳转进入
+				obj.firstCreateOrder();
+			},
+			// 订单金额支付
+			orderMoneyPay() {
+				let obj = this;
+				orderPay({
+						uni: obj.orderId,
+						// #ifdef H5
+						from: 'weixin', //来源
+						// #endif
+						// #ifdef MP-WEIXIN
+						from: 'routine', //来源
+						// #endif
+						// #ifdef APP-PLUS
+						from: 'app', //来源
+						// #endif
+						paytype: obj.payType //支付类型  weixin-微信 yue-余额
+					})
+					.then(e => {
+						// 判断是否微信小程序支付
+						if (obj.payType == 'weixin') {
+							// #ifdef H5 || MP
+							let da = e.data.result.jsConfig;
+							let data = {
+								nonceStr: da.nonceStr,
+								package: da.package,
+								signType: da.signType,
+								paySign: da.paySign,
+								success: function(res) {
+									obj.paySuccessTo();
+								},
+								fail: () => {
+									uni.navigateTo({
+										url: '/pages/order/order?state=0'
+									});
+								}
+							};
+							// #endif
+							// #ifdef H5
+							data.timestamp = da.timestamp;
+							weixinObj.chooseWXPay(data);
+							// #endif
+							// #ifdef MP-WEIXIN
+							data.timeStamp = da.timestamp;
+							wx.requestPayment(data);
+							// #endif
+							// #ifdef APP
+							console.log( e.data.result.jsConfig,'返回数值');
+							uni.requestPayment({
+								provider: 'wxpay',
+								orderInfo: e.data.result.jsConfig,
+								success(e) {
+									obj.paySuccessTo();
+								},
+								fail: (e) => {
+									console.log(e,'支付失败');
+									uni.navigateTo({
+										url: '/pages/order/order?state=0'
+									});
+								}
+							})
+							// #endif
+						}
+						// #ifdef APP
+						if(obj.payType == 'ali'){
+							uni.requestPayment({
+								provider: 'alipay',
+								orderInfo: e.data.result.jsConfig,
+								success(e) {
+									obj.paySuccessTo();
+								},
+								fail: (e) => {
+									console.log(e,'支付失败');
+									uni.navigateTo({
+										url: '/pages/order/order?state=0'
+									});
+								}
+							})
+						}
+						// #endif
+						uni.hideLoading();
+						obj.payLoding = false;
+					})
+					.catch(e => {
+						// 支付完成
+						uni.hideLoading();
+						obj.payLoding = false;
+						console.log(e);
+					});
+			},
+			// 支付成功跳转
+			paySuccessTo() {
+				uni.hideLoading();
+				uni.redirectTo({
+					url: '/pages/user/money/paySuccess?orderid=' + this.orderId,
+				});
+			},
+			// 初次订单创建
+			firstCreateOrder() {
+				let obj = this;
+				// 获取下单页面数据
+				let prepage = obj;
+				let data = {
+					real_name: prepage.addressData.real_name, //联系人名称
+					phone: prepage.addressData.phone, //联系人号码
+					addressId: prepage.addressData.id, //支付地址id
+					useIntegral: 0, //是否积分抵扣1为是0为否
+					payType: obj.payType, //支付类型  weixin-微信 yue-余额
+					mark: prepage.desc, //备注
+					// #ifdef H5
+					from: 'weixin', //来源
+					// #endif
+					// #ifdef MP-WEIXIN
+					from: 'routine', //来源
+					// #endif
+					// #ifdef APP-PLUS
+					from: 'app', //来源
+					// #endif
+					shipping_type: 1, //提货方式 1 快递 2自提
+				};
+				// 判断是否需要读取非默认商家id
+				if (obj.onShopId != -1) {
+					data.store_id = obj.onShopId;
+				} else {
+					data.store_id = obj.shopDetail.id;
+				}
+				// 生成订单
+				createOrderkey(data, obj.orderKey)
+					.then(({
+						data,
+						status,
+						msg
+					}) => {
+						// 判断是否支付失败
+						if (data.status == 'ORDER_EXIST') {
+							uni.showModal({
+								title: '提示',
+								content: msg,
+								showCancel: false
+							});
+							uni.hideLoading();
+							obj.payLoding = false;
+							return;
+						}
+						// 保存订单号
+						obj.orderId = data.result.orderId;
+						// 判断是否为余额支付
+						if (obj.payType == 'yue') {
+							console.log('余额支付', status == 200 && data.status == 'SUCCESS');
+							if (status == 200 && data.status == 'SUCCESS') {
+								obj.paySuccessTo();
+							} else {
+								obj.$api.msg(msg);
+							}
+						} else {
+							// 立即支付
+							obj.orderMoneyPay();
+						}
+					})
+					.catch(e => {
+						uni.hideLoading();
+						obj.payLoding = false;
+						console.log(e);
+					});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background: $page-color-base;
+		padding-bottom: 100rpx;
+	}
+
+	.address-section {
+		border-radius: 20rpx;
+		padding: 30rpx;
+		margin: 0 $page-row-spacing;
+		background: #fff;
+		position: relative;
+
+		.order-content {
+			min-height: 100rpx;
+			display: flex;
+			align-items: center;
+
+			.leftIcon {
+				width: 36rpx;
+				margin: 0 30rpx;
+			}
+
+			.addAddress {
+				text-align: center;
+				width: 100%;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+
+				.iconaddition {
+					font-size: 55rpx;
+					line-height: 1;
+					border-radius: 100rpx;
+					margin-right: 20rpx;
+				}
+			}
+		}
+
+		.iconlocation {
+			flex-shrink: 0;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 90rpx;
+			color: #888;
+			font-size: 44rpx;
+		}
+
+		.cen {
+			display: flex;
+			flex-direction: column;
+			flex: 1;
+			font-size: 28rpx;
+			color: $font-color-dark;
+		}
+
+		.name {
+			font-size: 34rpx;
+			margin-right: 24rpx;
+		}
+
+		.address {
+			margin-top: 16rpx;
+			margin-right: 20rpx;
+			color: $font-color-light;
+		}
+
+		.icon-you {
+			font-size: 32rpx;
+			color: $font-color-light;
+			margin-right: 30rpx;
+		}
+
+		.a-bg {
+			position: absolute;
+			left: 0;
+			bottom: 0;
+			display: block;
+			width: 100%;
+			height: 5rpx;
+		}
+	}
+
+	.goodsList {
+		margin: 0 $page-row-spacing;
+		padding: 30rpx;
+		background: #fff;
+		border-radius: 20rpx;
+		margin-top: 30rpx;
+	}
+
+	.goods-section {
+		.logo {
+			display: block;
+			width: 50rpx;
+			height: 50rpx;
+			border-radius: 100px;
+		}
+
+		.name {
+			font-size: 30rpx;
+			color: $font-color-base;
+			margin-left: 24rpx;
+		}
+
+		.g-item {
+			display: flex;
+
+			image {
+				flex-shrink: 0;
+				display: block;
+				width: 170rpx;
+				height: 170rpx;
+				border-radius: 4rpx;
+			}
+
+			.right {
+				flex: 1;
+				padding-left: 24rpx;
+				overflow: hidden;
+
+				.serverSet {
+					font-size: 22rpx;
+					color: $font-color-light;
+				}
+			}
+
+			.title {
+				font-size: 30rpx;
+				color: $font-color-dark;
+			}
+
+			.spec {
+				font-size: 26rpx;
+				color: $font-color-light;
+			}
+
+			.price-box {
+				display: flex;
+				align-items: center;
+				font-size: 32rpx;
+				padding-top: 10rpx;
+				color: $font-color-light;
+
+				.price {
+					margin-bottom: 4rpx;
+				}
+
+				.number {
+					font-size: 26rpx;
+					margin-left: 20rpx;
+				}
+			}
+
+			.step-box {
+				position: relative;
+			}
+		}
+	}
+
+	.yt-list {
+		background: #fff;
+		margin: 0 $page-row-spacing;
+		margin-top: 30rpx;
+		border-radius: 20rpx;
+	}
+
+	.yt-list-cell {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 10rpx 30rpx 10rpx 40rpx;
+		line-height: 70rpx;
+		position: relative;
+
+		.checked,
+		.noChecked {
+			width: 36rpx;
+			height: 36rpx;
+		}
+
+		.noChecked {
+			border: 1px solid $font-color-light;
+			border-radius: 100rpx;
+		}
+
+		&.cell-hover {
+			background: #fafafa;
+		}
+
+		&.b-b:after {
+			left: 30rpx;
+		}
+
+		.cell-icon {
+			height: 32rpx;
+			width: 32rpx;
+			font-size: 22rpx;
+			color: #fff;
+			text-align: center;
+			line-height: 32rpx;
+			background: #f85e52;
+			border-radius: 4rpx;
+			margin-right: 12rpx;
+
+			&.hb {
+				background: #ffaa0e;
+			}
+
+			&.lpk {
+				background: #3ab54a;
+			}
+		}
+
+		.cell-more {
+			align-self: center;
+			font-size: 24rpx;
+			color: $font-color-light;
+			margin-left: 8rpx;
+			margin-right: -10rpx;
+		}
+
+		.cell-tit {
+			font-size: 26rpx;
+			color: $font-color-light;
+			margin-right: 10rpx;
+
+			.orderIcon {
+				width: 48rpx;
+			}
+		}
+
+		.cell-tip {
+			font-size: 26rpx;
+			color: $font-color-dark;
+
+			&.disabled {
+				color: $font-color-light;
+			}
+
+			&.active {
+				color: $base-color;
+			}
+
+			&.red {
+				color: $base-color;
+			}
+		}
+
+		&.desc-cell {
+			.cell-tit {
+				max-width: 90rpx;
+			}
+		}
+
+		.desc {
+			text-align: right;
+			font-size: $font-base;
+			color: $font-color-light;
+		}
+	}
+
+	/* 支付列表 */
+	.pay-list {
+		padding-left: 40rpx;
+		margin-top: 16rpx;
+		background: #fff;
+
+		.pay-item {
+			display: flex;
+			align-items: center;
+			padding-right: 20rpx;
+			line-height: 1;
+			height: 110rpx;
+			position: relative;
+		}
+
+		.icon-weixinzhifu {
+			width: 80rpx;
+			font-size: 40rpx;
+			color: #6bcc03;
+		}
+
+		.icon-alipay {
+			width: 80rpx;
+			font-size: 40rpx;
+			color: #06b4fd;
+		}
+
+		.icon-xuanzhong2 {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 60rpx;
+			height: 60rpx;
+			font-size: 40rpx;
+			color: $base-color;
+		}
+
+		.tit {
+			font-size: 32rpx;
+			color: $font-color-dark;
+			flex: 1;
+		}
+	}
+
+	.footer {
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		z-index: 995;
+		display: flex;
+		align-items: center;
+		width: 100%;
+		height: 90rpx;
+		justify-content: space-between;
+		font-size: 30rpx;
+		background-color: #fff;
+		z-index: 998;
+		color: $font-color-base;
+		box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
+
+		.price-content {
+			padding-left: 30rpx;
+		}
+
+		.price-tip {
+			color: $font-color-base;
+			margin-left: 8rpx;
+		}
+
+		.price {
+			font-size: 36rpx;
+			color: $font-color-base;
+		}
+
+		.submit {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 280rpx;
+			height: 100%;
+			color: #fff;
+			font-size: 32rpx;
+			background-color: $base-color;
+
+			&.submitNo {
+				background-color: $font-color-disabled;
+			}
+		}
+	}
+</style>

+ 405 - 0
pages/order/evaluate.vue

@@ -0,0 +1,405 @@
+<template>
+	<view class="content">
+		<view class="order-item">
+			<view class="goods-box-single">
+				<image class="goods-img" :src="productInfo.image" mode="aspectFill"></image>
+				<view class="right position-relative">
+					<view class="flex">
+						<text class="title">{{ productInfo.store_name }}</text>
+						<view class="title-right">
+							<view class="price">{{ productInfo.price }}</view>
+							<view class="attr-box">x{{ list.cart_num }}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view>
+				<view class="flex_item zhil">
+					<view>商品质量</view>
+					<view><uniRate text="1" size="20" margin="10" :value="rateValue1" @change="rateChange1"></uniRate></view>
+				</view>
+				<view class="flex_item zhil">
+					<view>服务态度</view>
+					<view><uniRate text="1" size="20" margin="10" :value="rateValue2" @change="rateChange2"></uniRate></view>
+				</view>
+				<view class="equity_box">
+					<view class="text-box uni-textarea">
+						<textarea placeholder-style="color:#999" :placeholder="placeholder" @blur="bindTextAreaBlur"></textarea>
+					</view>
+					<view class="">
+						<view class="add-img-box flex_item">
+							<view class="add-img-item" v-for="(item, index) in imgList" :key="index">
+								<image class="add-img" @click.stop="imgInfo(index)" :src="item.url" mode="aspectFill"></image>
+								<image class="add-img-del" @click.stop="delImg(index)" src="/static/img/delete.png"></image>
+							</view>
+							<view v-if="imgList.length < 9" class="add-img-item" @click.stop="scImg()">
+								<image class="add-img" src="/static/img/add.png"></image>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view @click.stop="submit" class="address-box submit-box"><text class="submit-btn">提交评论</text></view>
+	</view>
+</template>
+
+<script>
+import { product, upload, order_comment } from '@/api/order.js';
+import uniRate from '@/components/uni-rate/uni-rate.vue';
+export default {
+	components: {
+		uniRate
+	},
+	data() {
+		return {
+			list: '', //订单详情
+			productInfo: '',
+			text: '', //评论内容
+			placeholder: '商品满足你的期待么?说说你的想法,分享给想买的他们吧~',
+			imgList: [],
+			unique: '', //商品唯一标识码
+			cloudimgList: [],
+			rateValue1: '', //商品质量
+			rateValue2: '', //服务态度
+			imgCount: 6 //最多支持9张上传,可以修改
+		};
+	},
+	onLoad(option) {
+		this.unique = option.unique;
+		this.loadOrder();
+	},
+	onShow() {},
+	methods: {
+		//text
+		bindTextAreaBlur: function(e) {
+			this.text = e.detail.value;
+		},
+		//获取收入支出信息
+		async loadOrder() {
+			product({
+				unique: this.unique
+			}).then(e => {
+				this.list = e.data;
+				this.productInfo = e.data.productInfo;
+			});
+		},
+		//商品质量评分
+		rateChange1(val) {
+			this.rateValue1 = val.value;
+		},
+		//服务态度评分
+		rateChange2(val) {
+			this.rateValue2 = val.value;
+		},
+		//单张上传图片
+		scImg() {
+			let obj = this;
+			console.log(obj.imgCount, 11);
+			if (obj.imgCount == 0) {
+				uni.showToast({
+					title: '最多添加6张图片',
+					icon: 'none'
+				});
+				return;
+			}
+			upload({
+				file: ''
+			})
+				.then(e => {
+					console.log(e,'e')
+					obj.imgList = [...obj.imgList, ...e];
+					console.log(obj.imgList,'imgList')
+					obj.imgCount = 10 - obj.imgList.length;
+					console.log(obj.imgCount ,'imgCount ')
+				})
+				.catch(e => {});
+		},
+		//提交评论
+		submit(e) {
+			let obj = this;
+			if (obj.imgList.length < 1) {
+				uni.showToast({
+					title: '请添加图片',
+					icon: 'none'
+				});
+				return;
+			}
+			for (let i = 0; i < obj.imgList.length; i++) {
+				obj.cloudimgList.push(obj.imgList[i].url);
+			}
+			let arr = obj.cloudimgList.join(',');
+			order_comment({
+				pics: arr,
+				comment: obj.text,
+				product_score: obj.rateValue1,
+				service_score: obj.rateValue2,
+				unique: obj.unique,
+				
+			})
+				.then(e => {
+					uni.navigateTo({
+						url: '/pages/order/order?state=4'
+					});
+				})
+				.catch(e => {
+					uni.navigateTo({
+						url: '/pages/order/order?state=4'
+					});
+				});
+		},
+		//点击图片显示大图
+		imgInfo(i) {
+			let tempList = [];
+			console.log(111);
+			this.imgList.forEach(e => {
+				tempList.push(e.url);
+			});
+			console.log(tempList);
+			//显示图片
+			uni.previewImage({
+				current: i,
+				loop: false,
+				urls: tempList,
+				indicator: 'default'
+			});
+		},
+		//删除图片
+		delImg(i) {
+			uni.showModal({
+				content: '确定删除这张吗',
+				success: res => {
+					if (res.confirm) {
+						this.imgList.splice(i, 1);
+						this.imgCount++;
+					} else if (res.cancel) {
+					}
+				}
+			});
+		},
+		// 页面跳转
+		navto(e) {
+			uni.navigateTo({
+				url: e
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: #ffffff;
+	height: 100%;
+	.content {
+		background: #ffffff;
+		height: 100%;
+	}
+}
+/* 多条商品 */
+.order-item {
+	display: flex;
+	flex-direction: column;
+	padding: 0rpx 30rpx;
+	background: #fff;
+	margin-top: 20rpx;
+	/* 单条商品 */
+	.goods-box-single {
+		display: flex;
+		padding: 20rpx 0;
+		.goods-img {
+			display: block;
+			width: 120rpx;
+			height: 120rpx;
+		}
+		.right {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			padding: 0 30rpx 0 24rpx;
+			overflow: hidden;
+			height: 100%;
+			.title {
+				align-self: flex-start;
+				font-size: $font-base + 2rpx;
+				color: $font-color-dark;
+				height: 80rpx;
+				overflow:hidden; 
+				text-overflow:ellipsis;
+				display:-webkit-box; 
+				-webkit-box-orient:vertical;
+				-webkit-line-clamp:2; 
+			}
+			.title-right {
+				flex-shrink: 0;
+				text-align: right;
+				align-self: flex-start;
+			}
+			.attr-box {
+				font-size: $font-sm + 2rpx;
+				color: $font-color-light;
+			}
+			.price {
+				font-size: $font-base + 2rpx;
+				color: $font-color-dark;
+				&:before {
+					content: '¥';
+					font-size: $font-sm;
+					margin: 0 2rpx 0 8rpx;
+				}
+			}
+		}
+	}
+}
+.equity_box {
+	background-color: #fafafa;
+	border-radius: 10rpx;
+	padding: 25rpx 25rpx;
+	margin: 25rpx 0rpx;
+	.text-box {
+		height: 200rpx;
+		textarea {
+			font-size: 25rpx;
+			width: 100%;
+			height: 100%;
+			overflow: hidden;
+			text-overflow: ellipsis;
+			display: -webkit-box;
+			-webkit-box-orient: vertical;
+			-webkit-line-clamp: 5;
+		}
+	}
+}
+.zhil {
+	font-size: 28rpx !important;
+	padding: 15rpx 15rpx;
+}
+.submit-box {
+	bottom: 0;
+	left: 0;
+	width: 750rpx;
+}
+.submit-btn {
+	margin-top: 10px;
+	display: inline-block;
+	width: 670rpx;
+	height: 96rpx;
+	line-height: 96rpx;
+	text-align: center;
+	background-color: #1BCC26 !important;
+	opacity: 1;
+	border-radius: 32rpx;
+	border-width: 8rpx;
+	border-color: rgba(255, 255, 255, 1);
+	box-shadow: 0rpx 8rpx 12rpx rgba(0, 0, 0, 0.16);
+	border-radius: 56rpx;
+	font-size: 39rpx;
+	font-weight: bold;
+	color: rgba(255, 255, 255, 1);
+}
+.submit-btn-txt {
+	font-size: 39rpx;
+	font-weight: bold;
+	line-height: 47rpx;
+	color: rgba(255, 255, 255, 1);
+	opacity: 1;
+}
+.map-box {
+	width: 484rpx;
+	height: 256rpx;
+	border-width: 4rpx;
+	border-color: rgba(255, 255, 255, 1);
+	box-shadow: 0rpx 0rpx 24rpx rgba(0, 0, 0, 0.16);
+	/* border-radius: 12rpx; */
+	position: relative;
+}
+.map {
+	position: absolute;
+	top: 0;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	width: 476rpx;
+	height: 250rpx;
+}
+.map-img {
+	position: absolute;
+	top: 90rpx;
+	left: 156rpx;
+	width: 230rpx;
+	height: 68rpx;
+	background-color: rgba(51, 51, 51, 0.64);
+	border-width: 1rpx;
+	border-color: rgba(0, 0, 0, 0);
+	border-radius: 34px;
+
+	font-size: 28rpx;
+	font-weight: bold;
+	line-height: 66rpx;
+	color: rgba(255, 255, 255, 1);
+	text-align: center;
+}
+.address-box {
+	padding: 15rpx 40rpx;
+	margin-bottom: 10px;
+}
+.label {
+	font-size: 36rpx;
+	font-weight: bold;
+	line-height: 50rpx;
+	color: #222222;
+}
+.label-img {
+	padding-left: 40rpx;
+}
+
+.add-img-box {
+	width: 100%;
+	flex-direction: row;
+	flex-wrap: wrap;
+	margin-top: 50rpx;
+}
+.add-img-item {
+	width: 180rpx;
+	height: 180rpx;
+	border-radius: 24rpx;
+	position: relative;
+	margin: 0rpx 20rpx;
+	margin-bottom: 25rpx;
+	.add-img {
+		width: 100%;
+		height: 100%;
+		border-radius: 24rpx;
+	}
+}
+.add-img-camera {
+	flex: 1;
+}
+.add-img-del {
+	position: absolute;
+	width: 40rpx;
+	height: 40rpx;
+	left: 155rpx;
+	bottom: 155rpx;
+	//background-color: rgba(238, 0, 0, 1);
+	border-radius: 20rpx;
+}
+.address-time {
+	width: 484rpx;
+	height: 88rpx;
+	background-color: rgba(245, 245, 245, 1);
+	opacity: 1;
+	border-radius: 24rpx;
+	text-align: center;
+
+	font-size: 35rpx;
+	font-weight: 500;
+	color: rgba(51, 51, 51, 1);
+}
+.line {
+	width: 750rpx;
+	height: 1px;
+	transform: scaleY(0.3);
+	background-color: rgba(0, 0, 0, 0.5);
+}
+</style>

+ 633 - 0
pages/order/orderAfter.vue

@@ -0,0 +1,633 @@
+<template>
+	<view class="content">
+		<!-- <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" class="swiper-box" 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="loadData">
+					<!-- 空白页 -->
+					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
+					<!-- 订单列表 -->
+					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index"
+						class="order-item">
+						<view class="i-top b-b">
+							<text class="time">{{ item._add_time }}</text>
+							<text class="state" :style="{ color: item.stateTipColor }">{{ item._status._title }}</text>
+						</view>
+						<scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
+							<view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
+								<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
+							</view>
+						</scroll-view>
+						<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo"
+							:key="goodsIndex">
+							<image class="goods-img" :src="goodsItem.productInfo.image" mode="scaleToFill"></image>
+							<view class="right">
+								<view class="flex flextop">
+									<text class="title clamp2">{{ goodsItem.productInfo.store_name }}</text>
+									<text class="price">{{ moneyNum(goodsItem.productInfo.price) }}</text>
+								</view>
+								<view class="row flex">
+									<text
+										class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
+									<text class="attr-box"> x {{ goodsItem.cart_num }}</text>
+								</view>
+								<view class="row flex">
+									<text class="attr-box">( 服务费:{{goodsItem.day_deducted}} 服务天数:{{goodsItem.day}}
+										)</text>
+								</view>
+							</view>
+						</view>
+						<view class="action-box b-t">
+							<button v-if="item._status._title == '已退款'" @click.stop="deleteOrder(item,index)"
+								class="action-btn recom">删除订单</button>
+							<button @click.stop="goToOrderDetail(item)" class="action-btn evaluate">查看详情</button>
+						</view>
+					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+	import {
+		orderList,
+		orderDel
+	} from '@/api/order.js';
+	export default {
+		data() {
+			return {
+				tabCurrentIndex: 0,
+				navList: [{
+						state: -1,
+						text: '退款中',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					},
+					{
+						state: -2,
+						text: '已退款',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					},
+					{
+						state: -3,
+						text: '全部',
+						loadingType: 'more',
+						orderList: [],
+						page: 1, //当前页数
+						limit: 10 //每次信息条数
+					}
+				]
+			};
+		},
+
+		onLoad(options) {
+			/**
+			 * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
+			 * 替换onLoad下代码即可
+			 */
+			this.tabCurrentIndex = +options.state;
+			// #ifndef MP
+			this.loadData();
+			// #endif
+			// #ifdef MP
+			if (options.state == 0) {
+				this.loadData();
+			}
+			// #endif
+		},
+		// #ifdef APP-PLUS || H5
+		onBackPress(e) {
+			uni.switchTab({
+				url: '/pages/user/user',
+			});
+			return true;
+		},
+		// #endif
+		methods: {
+			// 转换金额为数字
+			moneyNum(value) {
+				return +value;
+			},
+			// 确认收货
+			//跳转到订单详情
+			goToOrderDetail(e) {
+				uni.navigateTo({
+					url: '/pages/order/orderDetail?id=' + e.order_id
+				});
+			},
+			//获取订单列表
+			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';
+
+				orderList({
+						type: state,
+						page: navItem.page,
+						limit: navItem.limit
+					})
+					.then(({
+						data
+					}) => {
+						let arr = data.map(e => {
+							let b = this.orderStateExp(e.status);
+							e.stateTip = b.stateTip;
+							e.stateTipColor = b.stateTipColor;
+							return e;
+						});
+						navItem.orderList = navItem.orderList.concat(arr);
+						// console.log(navItem.orderList);
+						navItem.page++;
+						if (navItem.limit == data.length) {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
+							return;
+						} else {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							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;
+			},
+			//删除订单
+			deleteOrder(item, index) {
+				let that = this;
+				uni.showLoading({
+					title: '请稍后',
+					mask:true
+				});
+				uni.showModal({
+					title: '删除订单',
+					content: '删除订单后不可恢复,是否删除?',
+					success: res => {
+						uni.showLoading({
+							title: '请稍后'
+						});
+						if (res.confirm) {
+							orderDel({
+								uni: item.order_id
+							}).then(() => {
+								that.navList[that.tabCurrentIndex].orderList.splice(index, 1);
+								uni.hideLoading();
+							}).catch((e) => {
+								uni.hideLoading();
+								console.log(e);
+							})
+						}
+					},
+				});
+			},
+			//订单状态文字和颜色
+			orderStateExp(state) {
+				let stateTip = '',
+					stateTipColor = '#fa436a';
+				switch (+state) {
+					case 0:
+						stateTip = '待付款';
+						break;
+					case 1:
+						stateTip = '待发货';
+						break;
+					case 2:
+						stateTip = '待收货';
+						break;
+					case 3:
+						stateTip = '待评价';
+						break;
+					case 4:
+						stateTip = '已完成';
+						stateTipColor = '#5dbc7c';
+						break;
+					case 9:
+						stateTip = '订单已关闭';
+						stateTipColor = '#909399';
+						break;
+
+						//更多自定义
+				}
+				return {
+					stateTip,
+					stateTipColor
+				};
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page,
+	.content {
+		background: $page-color-base;
+		height: 100%;
+	}
+
+	.swiper-box {
+		height:100%;
+	}
+
+	.list-scroll-content {
+		height: 100%;
+		padding-top: 30rpx;
+	}
+
+	.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;
+				}
+			}
+		}
+	}
+
+	.uni-swiper-item {
+		height: auto;
+	}
+
+	.order-item {
+		display: flex;
+		flex-direction: column;
+		padding-left: 30rpx;
+		background: #fff;
+		margin: 0 $page-row-spacing;
+		margin-bottom: 30rpx;
+		border-radius: 20rpx;
+		padding-bottom: 10rpx;
+
+		.i-top {
+			display: flex;
+			align-items: center;
+			height: 80rpx;
+			padding-right: 30rpx;
+			font-size: $font-base;
+			color: $font-color-dark;
+			position: relative;
+
+			.time {
+				flex: 1;
+			}
+
+			.state {
+				color: $base-color;
+			}
+
+			.del-btn {
+				padding: 10rpx 0 10rpx 36rpx;
+				font-size: $font-lg;
+				color: $font-color-light;
+				position: relative;
+
+				&:after {
+					content: '';
+					width: 0;
+					height: 30rpx;
+					border-left: 1px solid $border-color-dark;
+					position: absolute;
+					left: 20rpx;
+					top: 50%;
+					transform: translateY(-50%);
+				}
+			}
+		}
+
+		/* 多条商品 */
+		.goods-box {
+			height: 160rpx;
+			padding: 20rpx 0;
+			white-space: nowrap;
+
+			.goods-item {
+				width: 120rpx;
+				height: 120rpx;
+				display: inline-block;
+				margin-right: 24rpx;
+			}
+
+			.goods-img {
+				display: block;
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		/* 单条商品 */
+		.goods-box-single {
+			display: flex;
+			padding: 20rpx 0;
+
+			.goods-img {
+				display: block;
+				width: 170rpx;
+				height: 170rpx;
+				border-radius: 20rpx;
+			}
+
+			.right {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				padding: 0 30rpx 0 24rpx;
+				overflow: hidden;
+
+				.flextop {
+					align-items: flex-start;
+					line-height: 1.3;
+				}
+
+				.row {
+					margin-top: 10rpx;
+				}
+
+				.row_title {
+					padding: 5rpx 10rpx;
+					background-color: #dddddd;
+					border-radius: 10rpx;
+					font-size: 22rpx;
+					color: #ffffff;
+				}
+
+				.title {
+					font-size: $font-base + 2rpx;
+					color: $font-color-dark;
+					width: 80%;
+					min-height: 2.5rem;
+				}
+
+				.attr-box {
+					display: flex;
+					justify-content: flex-end;
+					font-size: $font-sm + 2rpx;
+					color: $font-color-light;
+				}
+
+				.price {
+					display: inline;
+					font-size: $font-base + 2rpx;
+					color: $font-color-light;
+
+					&:before {
+						content: '¥';
+						font-size: $font-sm;
+
+					}
+				}
+			}
+		}
+
+		.price-box {
+			display: flex;
+			justify-content: flex-end;
+			align-items: baseline;
+			padding: 20rpx 30rpx;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-light;
+
+			.num {
+				margin: 0 8rpx;
+				color: $font-color-dark;
+			}
+
+			.price {
+				font-size: $font-lg;
+				color: $font-color-dark;
+
+				&:before {
+					content: '¥';
+					font-size: $font-sm;
+					margin: 0 2rpx 0 8rpx;
+				}
+			}
+		}
+
+		.action-box {
+			display: flex;
+			justify-content: flex-end;
+			align-items: center;
+			height: 100rpx;
+			position: relative;
+			padding-right: 30rpx;
+		}
+
+		.action-btn {
+			width: 160rpx;
+			height: 60rpx;
+			margin: 0;
+			margin-left: 24rpx;
+			padding: 0;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: $font-sm + 2rpx;
+			color: $color-red;
+			border-radius: 100px;
+			border: 1px solid $color-red;
+			background-color: #FFFFFF;
+
+			&.recom {
+				color: $font-color-light;
+				border: 1px solid $font-color-light;
+			}
+
+			&.evaluate {
+				color: $color-yellow;
+				border: 1px solid $color-yellow;
+			}
+		}
+	}
+
+	/* load-more */
+	.uni-load-more {
+		display: flex;
+		flex-direction: row;
+		height: 80rpx;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.uni-load-more__text {
+		font-size: 28rpx;
+		color: #999;
+	}
+
+	.uni-load-more__img {
+		height: 24px;
+		width: 24px;
+		margin-right: 10px;
+	}
+
+	.uni-load-more__img>view {
+		position: absolute;
+	}
+
+	.uni-load-more__img>view view {
+		width: 6px;
+		height: 2px;
+		border-top-left-radius: 1px;
+		border-bottom-left-radius: 1px;
+		background: #999;
+		position: absolute;
+		opacity: 0.2;
+		transform-origin: 50%;
+		animation: load 1.56s ease infinite;
+	}
+
+	.uni-load-more__img>view view:nth-child(1) {
+		transform: rotate(90deg);
+		top: 2px;
+		left: 9px;
+	}
+
+	.uni-load-more__img>view view:nth-child(2) {
+		transform: rotate(180deg);
+		top: 11px;
+		right: 0;
+	}
+
+	.uni-load-more__img>view view:nth-child(3) {
+		transform: rotate(270deg);
+		bottom: 2px;
+		left: 9px;
+	}
+
+	.uni-load-more__img>view view:nth-child(4) {
+		top: 11px;
+		left: 0;
+	}
+
+	.load1,
+	.load2,
+	.load3 {
+		height: 24px;
+		width: 24px;
+	}
+
+	.load2 {
+		transform: rotate(30deg);
+	}
+
+	.load3 {
+		transform: rotate(60deg);
+	}
+
+	.load1 view:nth-child(1) {
+		animation-delay: 0s;
+	}
+
+	.load2 view:nth-child(1) {
+		animation-delay: 0.13s;
+	}
+
+	.load3 view:nth-child(1) {
+		animation-delay: 0.26s;
+	}
+
+	.load1 view:nth-child(2) {
+		animation-delay: 0.39s;
+	}
+
+	.load2 view:nth-child(2) {
+		animation-delay: 0.52s;
+	}
+
+	.load3 view:nth-child(2) {
+		animation-delay: 0.65s;
+	}
+
+	.load1 view:nth-child(3) {
+		animation-delay: 0.78s;
+	}
+
+	.load2 view:nth-child(3) {
+		animation-delay: 0.91s;
+	}
+
+	.load3 view:nth-child(3) {
+		animation-delay: 1.04s;
+	}
+
+	.load1 view:nth-child(4) {
+		animation-delay: 1.17s;
+	}
+
+	.load2 view:nth-child(4) {
+		animation-delay: 1.3s;
+	}
+
+	.load3 view:nth-child(4) {
+		animation-delay: 1.43s;
+	}
+
+	@-webkit-keyframes load {
+		0% {
+			opacity: 1;
+		}
+
+		100% {
+			opacity: 0.2;
+		}
+	}
+</style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 185 - 0
pages/order/orderDetail.vue


+ 296 - 0
pages/order/orderRefund.vue

@@ -0,0 +1,296 @@
+<template>
+	<view class="content">
+		<view class="order-item">
+			<view class="titleGoods">
+				退款商品
+			</view>
+			<scroll-view v-if="listStyle == 1" class="goods-box" scroll-x>
+				<view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
+					<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
+				</view>
+			</scroll-view>
+			<view v-if="listStyle == 2" class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo"
+				:key="goodsIndex">
+				<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
+				<view class="right">
+					<text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
+
+					<view v-if="goodsItem.productInfo.attrInfo">
+						<view class="attr-box">{{ goodsItem.productInfo.attrInfo.suk}} x {{ goodsItem.cart_num }}</view>
+						<view class="price">{{ goodsItem.productInfo.attrInfo.price }}</view>
+					</view>
+					<view v-else>
+
+						<view class="attr-box">{{ goodsItem.attrInfo ? goodsItem.attrInfo.suk : '' }} x
+							{{ goodsItem.cart_num }}</view>
+						<view class="price">{{ goodsItem.productInfo.price }}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="orderDetial">
+			<view class="row b-b flex">
+				<text class="tit">订单总价</text>
+				<view class="input">¥{{ item.total_price }}</view>
+			</view>
+			<view class="row b-b flex">
+				<text class="tit">邮费</text>
+				<view class="input">{{ item.pay_postage > 0 ? '¥' +item.pay_postage : '免邮费' }}</view>
+			</view>
+			<view class="row flex">
+				<text class="tit ">退款金额</text>
+				<view class="input payColor">¥{{ item.pay_price }}</view>
+			</view>
+		</view>
+		<view class="orderDetial">
+
+			<view class="row b-b flex">
+				<text class="tit">退款理由</text>
+				<picker mode="selector" :range="value" @change="bindChange">
+					<view class="refund" v-if="refund">{{ refund || '请选择退款理由' }}</view>
+					<view class="noRefund" v-else>请选择退款理由</view>
+				</picker>
+			</view>
+			<view class="row">
+				<text class="tit">备注说明</text>
+				<input class="input" type="text" v-model="reason" placeholder="请填写备注" placeholder-class="placeholder" />
+			</view>
+		</view>
+		<view class="base-buttom" @click="confirm">提交</view>
+	</view>
+</template>
+
+<script>
+	import {
+		refund,
+		refundReason,
+		orderDetail
+	} from '@/api/order.js';
+	export default {
+		data() {
+			return {
+				refund: '', //退款理由
+				reason: '', //备注
+				value: ['1', '2', '3', '4', '5', '6', '7', '8', 9, 10, 11, 12, 13],
+				orderId: '',
+				item: {},
+				listStyle: 2
+			};
+		},
+		onLoad(option) {
+			this.orderId = option.id;
+			this.refundReason();
+			this.loadOrder();
+		},
+		methods: {
+			// 切换选中事件
+			bindChange(e) {
+				this.refund = this.value[e.detail.value];
+			},
+			// 加载退款理由
+			refundReason() {
+				refundReason({}).then(e => {
+					this.value = e.data;
+				});
+			},
+			loadOrder() {
+				orderDetail({}, this.orderId).then(e => {
+					this.item = e.data;
+				});
+			},
+			//提交
+			confirm() {
+				let obj = this;
+				if (!obj.refund) {
+					uni.showModal({
+						title: '错误',
+						content: '请填写退货理由',
+						showCancel: false
+					});
+					return false;
+				}
+				uni.showLoading({
+					title: '提交中...',
+					mask: true
+				});
+				refund({
+					text: obj.refund,
+					uni: obj.orderId,
+					refund_reason_wap_explain: obj.reason
+				}).then(function(e) {
+					uni.hideLoading()
+					uni.showModal({
+						title: '提示',
+						content: '已提交成功是否返回?',
+						success: res => {
+							if(res.confirm){
+								uni.switchTab({
+									url:'/pages/user/user'
+								})
+							}
+						},
+					});
+				}).catch(() => {
+					uni.hideLoading()
+				});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background: $page-color-base;
+		padding-top: 30rpx;
+	}
+
+	.orderDetial {
+		margin: 0 $page-row-spacing;
+		margin-bottom: 30rpx;
+		border-radius: 20rpx;
+		overflow: hidden;
+
+		.row {
+			.input {
+				text-align: right;
+				color: $font-color-light;
+			}
+		}
+	}
+
+	.row {
+		display: flex;
+		align-items: center;
+		position: relative;
+		padding: 0 30rpx;
+		height: 110rpx;
+		background: #fff;
+
+		.refund {
+			font-size: 30rpx;
+			color: $font-color-light;
+		}
+
+		.noRefund {
+			font-size: 30rpx;
+			color: $font-color-light;
+			padding-left: 20rpx;
+		}
+
+		.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: 20rpx;
+
+			&.payColor {
+				color: $color-red;
+			}
+		}
+
+		.iconlocation {
+			font-size: 36rpx;
+			color: $font-color-light;
+		}
+	}
+
+	.add-btn {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 690rpx;
+		height: 80rpx;
+		margin: 60rpx auto;
+		font-size: $font-lg;
+		color: #fff;
+		background-color: $base-color;
+		border-radius: 10rpx;
+		// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+	}
+
+	/* 多条商品 */
+	.order-item {
+		display: flex;
+		flex-direction: column;
+		padding-left: 30rpx;
+		background: #fff;
+		margin-top: 16rpx;
+		margin: 0 $page-row-spacing;
+		border-radius: 20rpx;
+		padding-top: 30rpx;
+		margin-bottom: 30rpx;
+
+		.titleGoods {
+			font-size: $font-lg;
+		}
+
+		.goods-box {
+			height: 160rpx;
+			padding: 20rpx 0;
+			white-space: nowrap;
+
+			.goods-item {
+				width: 120rpx;
+				height: 120rpx;
+				display: inline-block;
+				margin-right: 24rpx;
+			}
+
+			.goods-img {
+				display: block;
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		/* 单条商品 */
+		.goods-box-single {
+			display: flex;
+			padding: 20rpx 0;
+
+			.goods-img {
+				display: block;
+				width: 120rpx;
+				height: 120rpx;
+			}
+
+			.right {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				padding: 0 30rpx 0 24rpx;
+				overflow: hidden;
+
+				.title {
+					font-size: $font-base + 2rpx;
+					color: $font-color-dark;
+					line-height: 1;
+				}
+
+				.attr-box {
+					font-size: $font-sm + 2rpx;
+					color: $font-color-light;
+					padding: 10rpx 12rpx;
+				}
+
+				.price {
+					font-size: $font-base + 2rpx;
+					color: $font-color-dark;
+
+					&:before {
+						content: '¥';
+						font-size: $font-sm;
+						margin: 0 2rpx 0 8rpx;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 172 - 0
pages/order/shopList.vue

@@ -0,0 +1,172 @@
+<template>
+	<view class="content b-t">
+		<view class="list" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)">
+			<view class="wrapper">
+				<view class="address-box">
+					<text class="name">{{ item.name }}</text>
+					<text class="mobile">{{ item.phone }}</text>
+				</view>
+				<view class="u-box">
+					<view class="address">{{ item.address }}</view>
+					<view class="address">{{ item.detailed_address }}</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			source: 0,
+			addressList: [], //显示的地址数据
+			value: '', //保存查询值
+			addressListAll: [] //保存地址数据
+		};
+	},
+	// #ifdef APP-PLUS || H5
+	onNavigationBarButtonTap(e) {
+		if (e.text === '搜索') {
+			this.searchAddressList();
+		}
+	},
+	// 监听原生标题栏搜索输入框输入内容变化事件
+	onNavigationBarSearchInputChanged(e) {
+		this.value = e.text;
+	},
+	// 监听原生标题栏搜索输入框搜索事件,用户点击软键盘上的“搜索”按钮时触发
+	onNavigationBarSearchInputConfirmed() {
+		this.searchAddressList();
+	},
+	// #endif
+	onLoad(option) {
+		this.addressListAll = this.addressList = this.$api.prePage().system_store;
+		console.log(this.addressListAll);
+	},
+	methods: {
+		// 地址查询功能
+		searchAddressList() {
+			let obj = this;
+			obj.addressList = obj.addressListAll.filter(e => {
+				// 判断客户是否有输入值并且能查询到
+				if (e.name.indexOf(obj.value) >= 0 && obj.value) {
+					return true;
+				} else if (obj.value.length == 0) {
+					return true;
+				}
+			});
+			console.log(obj.addressList);
+		},
+		//选择地址
+		checkAddress(item) {
+			// 设置商品页面地址
+			this.$api.prePage().shopAddress = item;
+			uni.navigateBack();
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	padding-bottom: 120rpx;
+	padding-top: 20rpx;
+}
+.content {
+	position: relative;
+}
+.list {
+	align-items: center;
+	padding: 20rpx 30rpx;
+	background: #fff;
+	margin: 20rpx;
+	margin-top: 0;
+	.buttom {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding-top: 10rpx;
+		.checkbox {
+			font-size: 44rpx;
+			line-height: 1;
+			padding: 4rpx;
+			color: $font-color-disabled;
+			background: #fff;
+			border-radius: 50px;
+		}
+		.checkbox.checked {
+			color: $base-color;
+		}
+		.default-buttom {
+			display: flex;
+			align-items: center;
+		}
+		.operation {
+			display: flex;
+			align-items: center;
+			.blank {
+				width: 30rpx;
+			}
+		}
+		.text {
+			padding-left: 10rpx;
+			font-size: 24rpx;
+			color: #666666;
+		}
+	}
+}
+.wrapper {
+	display: flex;
+	flex-direction: column;
+	flex: 1;
+	// border-bottom: 1px solid #f0f0f0;
+	// padding-bottom: 20rpx;
+}
+.address-box {
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	.address {
+		font-size: $font-base + 2rpx;
+		color: $font-color-dark;
+	}
+	.mobile {
+		font-size: $font-base;
+		color: rgba(51, 51, 51, 1);
+	}
+}
+.u-box {
+	font-size: $font-base;
+	color: $font-color-light;
+	margin-top: 16rpx;
+	.name {
+		margin-right: 30rpx;
+	}
+}
+.icon-bianji {
+	display: flex;
+	align-items: center;
+	height: 80rpx;
+	font-size: 40rpx;
+	color: $font-color-light;
+	padding-left: 30rpx;
+}
+
+.add-btn {
+	position: fixed;
+	left: 30rpx;
+	right: 30rpx;
+	bottom: 16rpx;
+	z-index: 95;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	font-size: $font-lg;
+	color: #fff;
+	background-color: $base-color;
+	border-radius: 10rpx;
+}
+</style>

+ 204 - 0
pages/product/classify.vue

@@ -0,0 +1,204 @@
+<template>
+	<view class="container">
+		<!-- 头部轮播 -->
+		<view class="carousel-section">
+			<swiper class="carousel" autoplay="true" duration="400" interval="5000">
+				<swiper-item v-for="(item, index) in bannerImg" :key="index" class="carousel-item" @click="bannerNavToUrl(item)">
+					<image :src="item.img" mode=" scaleToFill" />
+				</swiper-item>
+			</swiper>
+		</view>
+		<view class="type-title-box flex">
+			<view class="title-border"></view>
+			<view class="title-content">
+				<text v-if="type == 1">精品推荐</text>
+				<text v-if="type == 2">热门榜单</text>
+				<text v-if="type == 3">首发新品</text>
+				<text v-if="type == 4">促销单品</text>
+			</view>
+			<view class="title-border"></view>
+		</view>
+
+		<view class="goodsList-box">
+			<view class="goodsList-item flex" :key="ind" v-for="(ls, ind) in list">
+				<image :src="ls.image" mode=" scaleToFill"></image>
+				<view class="goodsList-content">
+					<view class="title">
+						<text>{{ ls.store_name }}</text>
+					</view>
+					<view class="goods-money flex">
+						<view class="money-box">
+							<view class="money">
+								<text class="font-size-sm">¥</text>
+								{{ ls.price }}
+							</view>
+							<view class="otMoney-box">
+								<text class="otMoney">¥{{ ls.ot_price }}</text>
+								<text class="sales">已售{{ ls.sales }}件</text>
+							</view>
+						</view>
+						<view @click="navTo(ls)" class="cart iconfont iconcart"></view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import { groomList } from '@/api/product.js';
+export default {
+	data() {
+		return {
+			list: [],
+			bannerImg: []
+		};
+	},
+	onLoad(option) {
+		// 获取查询对象
+		this.type = option.type;
+		// 加载基础数据
+		this.loadData();
+	},
+	methods: {
+		navTo: function(ls) {
+			uni.navigateTo({
+				url: '/pages/product/product?id=' + ls.id
+			});
+		},
+		// 请求载入数据
+		async loadData() {
+			groomList({}, this.type)
+				.then(({ data }) => {
+					// 保存轮播图
+					this.bannerImg = data.banner;
+					// 保存商品信息
+					this.list = data.list;
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		// 轮播图跳转
+		bannerNavToUrl(item) {
+			// #ifdef H5
+			if (item.wap_link.indexOf('http') > 0) {
+				window.location.href = item.wap_link;
+			}
+			// #endif
+			if (item.wap_link) {
+				uni.navigateTo({
+					url: item.wap_link
+				});
+			}
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: $page-color-base;
+}
+.carousel-section {
+	padding: 0;
+	.titleNview-placing {
+		padding-top: 0;
+		height: 0;
+	}
+	.swiper-dots {
+		left: 45rpx;
+		bottom: 40rpx;
+	}
+	.carousel {
+		width: 100%;
+		height: 360rpx;
+		.carousel-item {
+			width: 100%;
+			height: 100%;
+			overflow: hidden;
+		}
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+}
+// 中间标题样式
+.type-title-box {
+	padding: 40rpx;
+	.title-content {
+		height: 100%;
+		width: 200rpx;
+		text-align: center;
+		font-size: $font-lg;
+		font-weight: 500;
+		color: $font-color-dark;
+	}
+	.title-border {
+		width: 250rpx;
+		height: 2rpx;
+		background-color: #e9e9e9;
+	}
+}
+// 商品列表
+.goodsList-box {
+	.goodsList-item {
+		margin-bottom: 40rpx;
+		background-color: #ffffff;
+		padding: 30rpx;
+		image {
+			flex-shrink: 0;
+			border-radius: $border-radius-sm;
+			height: 180rpx;
+			width: 180rpx;
+		}
+		.goodsList-content {
+			margin-left: 20rpx;
+			flex-grow: 1;
+			height: 180rpx;
+			position: relative;
+			.title {
+				font-size: $font-base;
+				color: $font-color-dark;
+				font-weight: 500;
+			}
+			.goods-money {
+				position: absolute;
+				left: 0;
+				bottom: 0;
+				width:100%;
+				.money-box {
+					.money {
+						font-size: $font-lg;
+						color: $color-red;
+						font-weight: bold;
+					}
+					.otMoney-box {
+						font-size: $font-sm;
+						.otMoney {
+							color: $font-color-dark;
+							padding-right: 20rpx;
+						}
+						.sales {
+							color: $font-color-light;
+						}
+					}
+				}
+				.cart {
+					border: 1px solid $color-red;
+					color: $color-red;
+					font-size: $font-base;
+					font-weight: bold;
+					border-radius: 99px;
+					width: 55rpx;
+					height: 55rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+				}
+			}
+		}
+	}
+}
+</style>

+ 68 - 0
pages/product/common/contentText.vue

@@ -0,0 +1,68 @@
+<template>
+	<view class="detail-desc">
+		<view class="d-header"><text>图文详情</text></view>
+		<rich-text class="detail-centent" :nodes="description"></rich-text>
+		<!-- 底部高度撑开 -->
+	</view>
+</template>
+
+<script>
+export default {
+	props: {
+		description: {
+			default: ''
+		},
+	},
+	data() {
+		return {
+			
+		};
+	},
+};
+</script>
+
+<style lang="scss">
+	/*  详情 */
+	.detail-desc {
+		margin-top: 14rpx;
+		background: #fff;
+		/deep/ img {
+			max-width: 100% !important;
+			display: inline !important;
+		}
+		/deep/ div {
+			max-width: 100% !important;
+		}
+		.d-header {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 80rpx;
+			font-size: $font-base + 2rpx;
+			color: $font-color-dark;
+			position: relative;
+	
+			text {
+				padding: 0 20rpx;
+				background: #fff;
+				position: relative;
+				z-index: 1;
+			}
+			&:after {
+				position: absolute;
+				left: 50%;
+				top: 50%;
+				transform: translateX(-50%);
+				width: 300rpx;
+				height: 0;
+				content: '';
+				border-bottom: 1px solid #ccc;
+			}
+		}
+	}
+	/* 商品详情中限制图片大小 */
+	/deep/ .rich-img {
+		width: 100% !important;
+		height: auto;
+	}
+</style>

+ 139 - 0
pages/product/common/discounts.vue

@@ -0,0 +1,139 @@
+<template>
+	<view class="c-list">
+		<view class="c-row b-b">
+			<text class="tit">配送</text>
+			<view class="bz-list con" v-if="!mark">立即下单 ,预计最快第二天8.30-9:30送达</view>
+			<view class="bz-list con reding" v-else>{{mark}}</view>
+		</view>
+		<view v-if="showCoupon" class="c-row b-b" @click="Getcoupon">
+			<text class="tit">优惠券</text>
+			<text class="con t-r red">领取优惠券</text>
+			<text class="iconfont iconenter"></text>
+		</view>
+		<view class="c-row b-b">
+			<text class="tit">简介</text>
+			<view class="bz-list con">
+				<text>{{ Info }}</text>
+				<!-- <text>{{ copy2 }}</text> -->
+
+			</view>
+			<view class="copy-btn" @click="copy">一键复制</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			showCoupon: {
+				type: Boolean,
+				default: false
+			},
+			mark: {
+				default: ''
+			},
+			Info: {
+				default: ''
+			},
+		},
+		data() {
+			return {
+				copy1: '食材质检 ·',
+				copy2: '无接触配送到门口'
+			};
+		},
+		methods: {
+			Getcoupon() {
+				this.$emit('clickCoupon')
+			},
+			copy() {
+				// let copyText = this.copy1 + ' ' + this.copy2;
+				console.log(this.Info)
+				uni.setClipboardData({
+					//去找上面的数据
+					data: this.Info,
+					success: function(res) {
+						uni.showToast({
+							title: '复制成功',
+						});
+					},
+					fail: function(res) {
+					}
+				});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	.c-list {
+		font-size: $font-sm + 2rpx;
+		color: $font-color-base;
+		background: #fff;
+
+		.title {
+			color: #333333;
+			font-size: 32rpx;
+			font-weight: bold;
+		}
+
+		.c-row {
+			display: flex;
+			align-items: center;
+			padding: 20rpx 30rpx;
+			position: relative;
+		}
+
+		.tit {
+			width: 140rpx;
+		}
+
+		.con {
+			flex: 1;
+			color: $font-color-dark;
+
+			.selected-text {
+				margin-right: 10rpx;
+			}
+		}
+
+		.reding {
+			color: #FF0815 !important;
+		}
+
+		.bz-list {
+			height: 40rpx;
+			font-size: $font-sm + 2rpx;
+			color: $font-color-dark;
+			overflow: hidden;
+			text-overflow: ellipsis;
+			white-space: nowrap;
+			
+			text {
+				display: inline-block;
+				margin-right: 30rpx;
+				overflow: hidden;
+				text-overflow: ellipsis;
+				white-space: nowrap;
+				width: 100%;
+			}
+		}
+
+		.copy-btn {
+			background-color: #F3F3F2;
+			padding: 8rpx 20rpx;
+			border-radius: 10rpx;
+			color: #040406;
+		}
+
+		.red {
+			color: #fb6d24;
+		}
+	}
+
+	/* 商品详情中限制图片大小 */
+	.rich-img {
+		width: 100% !important;
+		height: auto;
+	}
+</style>

+ 115 - 0
pages/product/common/estimate.vue

@@ -0,0 +1,115 @@
+<template>
+	<view class="eva-section" @click="navTo">
+		<view class="e-header">
+			<text class="tit">评价</text>
+			<text>({{ list.replyCount }})</text>
+			<text class="tip">好评率 {{ list.replyChance }}%</text>
+			<text class="iconfont iconenter"></text>
+		</view>
+		<view class="eva-box">
+			<image class="portrait" :src="reply.avatar" mode="aspectFill"></image>
+			<view class="right">
+				<text class="name">{{ reply.nickname }}</text>
+				<text class="con">{{ reply.comment }}</text>
+				<view class="con_box">
+					<view class="con_image" v-for="item in reply.pics"><image :src="item"></image></view>
+				</view>
+				<view class="bot">
+					<text class="attr"></text>
+					<text class="stime">{{ reply.add_time }}</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	props: {
+		list: {
+			default: ''
+		},
+		reply: {
+			default: ''
+		},
+	},
+	data() {
+		return {
+		};
+	},
+	methods: {
+		navTo() {
+			this.$emit('navTo')
+		}
+	},
+};
+</script>
+
+<style lang="scss">
+/* 评价 */
+.eva-section {
+	display: flex;
+	flex-direction: column;
+	padding: 20rpx 30rpx;
+	background: #fff;
+	margin-top: 16rpx;
+	.e-header {
+		display: flex;
+		align-items: center;
+		height: 70rpx;
+		font-size: $font-sm + 2rpx;
+		color: $font-color-light;
+		.tit {
+			font-size: $font-base + 2rpx;
+			color: $font-color-dark;
+			margin-right: 4rpx;
+		}
+		.tip {
+			flex: 1;
+			text-align: right;
+		}
+		.iconenter {
+			margin-left: 10rpx;
+		}
+	}
+	.eva-box {
+		display: flex;
+		padding: 20rpx 0;
+		.portrait {
+			flex-shrink: 0;
+			width: 80rpx;
+			height: 80rpx;
+			border-radius: 100px;
+		}
+		.right {
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			font-size: $font-base;
+			color: $font-color-base;
+			padding-left: 26rpx;
+			.con {
+				font-size: $font-base;
+				color: $font-color-dark;
+				padding: 20rpx 0;
+			}
+			.bot {
+				display: flex;
+				justify-content: space-between;
+				font-size: $font-sm;
+				color: $font-color-light;
+			}
+		}
+	}
+	.con_image {
+		width: 130rpx;
+		height: 130rpx;
+		display: inline-block;
+		padding: 15rpx;
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+}
+</style>

+ 78 - 0
pages/product/common/freshDetail.vue

@@ -0,0 +1,78 @@
+<template>
+	<view class="listBox" @click="onClick">
+		<view class="list">
+			<view class="flex listItem">
+				<view class="flex titleBox">
+					<text class="title">当前选中:</text>
+					<text v-for="(item,index) in specSelected" class="margin-l-10">
+						<text v-if="index>0">,</text>
+						<text>
+							{{item}}
+						</text>
+					</text>
+				</view>
+				<view class="right flex">
+					<text></text>
+					<image class="img" src="../../../static/icon/next1.png" mode="widthFix"></image>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			specSelected: {
+				type: Array,
+				default: function() {
+					return []
+				}
+			},
+		},
+		data() {
+			return {
+
+			};
+		},
+		methods: {
+			onClick() {
+				this.$emit('click')
+			}
+		},
+	};
+</script>
+
+<style lang="scss">
+	.listBox {
+		background-color: #FFFFFF;
+		overflow: hidden;
+	}
+
+	.list {
+		.listItem {
+			padding: 30rpx 40rpx;
+			padding-top: 0;
+			border-bottom: 1px solid $page-color-light;
+		}
+
+		.listIconImg {
+			width: 36rpx;
+		}
+
+		.right {
+			color: $font-color-light;
+			font-size: $font-base;
+			flex-grow: 1;
+
+			.img {
+				width: 26rpx;
+			}
+		}
+
+		.titleBox {
+			color: $font-color-light;
+			font-size: $font-base;
+		}
+	}
+</style>

+ 120 - 0
pages/product/common/guessLike.vue

@@ -0,0 +1,120 @@
+<template>
+	<view class="guess-item">
+		<view class="guess">猜你喜欢</view>
+		<view class="guess-scroll flex_item" scroll-x>
+			<view class="scroll-list" v-for="ls in goodList" @click="navToDetailPage(ls)">
+				<view class="scoll-img"><image :src="ls.image"></image></view>
+				<view class="scoll-name ellipsis">{{ ls.store_name }}</view>
+				<view class="price-list flex">
+					<view class="tpl">
+						<view class="red-price">
+							¥
+							<text>{{ ls.price }}</text>
+						</view>
+						<view class="grey-price">¥{{ ls.ot_price }}</view>
+					</view>
+					<view class="img position-relative" @click.stop="Addcar(ls)">
+						<image src="/static/img/img13.png"></image>
+						<view class="corner" v-if="ls.cart_num > 0">
+							<text>{{ ls.cart_num }}</text>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	props: {
+		goodList: {
+			type: Array,
+			default: function () {
+				return []
+			}
+		},
+	},
+	methods: {
+		// 跳转到详情页
+		navToDetailPage(ls){
+			this.$emit('clickNavTo',ls)
+		},
+		// 加入购物车
+		Addcar(ls){
+			this.$emit('Addcar',ls)
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+//猜你喜欢
+.guess-item {
+	padding: 25rpx 25rpx;
+	background: #ffffff;
+	margin-bottom: 15rpx;
+	padding-bottom: 45rpx !important;
+	.guess {
+		color: #000000;
+		font-size: 35rpx;
+		font-weight: 500;
+		padding-bottom: 25rpx;
+	}
+	.guess-scroll {
+		width: 100%;
+		font-size: 24rpx;
+		overflow: hidden;
+		overflow-x: auto;
+		justify-content: flex-start;
+		.scroll-list {
+			border: 2rpx solid #f0f0f0;
+			border-radius: 25rpx;
+			margin-right: 15rpx;
+			.scoll-img {
+				width: 227rpx;
+				border-top-right-radius: 25rpx;
+				border-top-left-radius: 25rpx;
+				height: 227rpx;
+				overflow: hidden;
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
+			.scoll-name {
+				height: 80rpx;
+				width: 227rpx;
+				font-size: 22rpx;
+				padding: 15rpx 15rpx;
+			}
+			.price-list {
+				padding: 25rpx 15rpx;
+				padding-right: 25rpx;
+				.tpl {
+					.red-price {
+						color: #f31d29;
+						text {
+							font-size: 35rpx !important;
+							font-weight: bold;
+						}
+					}
+					.grey-price {
+						text-decoration: line-through;
+						color: #999999;
+						font-size: 10px !important;
+					}
+				}
+				.img {
+					width: 45rpx;
+					height: 45rpx;
+					image {
+						width: 100%;
+						height: 100%;
+					}
+				}
+			}
+		}
+	}
+}
+</style>

+ 165 - 0
pages/product/common/productBottom.vue

@@ -0,0 +1,165 @@
+<template>
+	<view class="page-bottom">
+		<!-- <view class="p-b-btn" @click="shopLi">
+			<image class="icon" src="../../../static/icon/goodsServer.png" mode="widthFix"></image>
+			<text>客服</text>
+		</view>
+		<view class="p-b-btn" :class="{ active: goodsObjact.userCollect }" @click="setCart(goodsObjact)">
+			<image class="icon" src="../../../static/icon/goodsAddCart.png" mode="widthFix"></image>
+			<text>购物车</text>
+		</view> -->
+		<view class="action-btn-group">
+			<button type="primary" class=" action-btn add-cart-btn margin-r-30" @click="buy(2)">加入购物车</button>
+			<button type="primary" class=" action-btn  buy-now-btn margin-r-30" @click="buy(1)">立即购买</button>
+		</view>
+	</view>
+</template>
+
+<script>
+import { collectAdd, collectDel } from '@/api/product.js';
+export default {
+	props: {
+		many: {
+			default: 9
+		},
+		goodsObjact: {
+			default: function() {
+				return {};
+			}
+		},
+		goodsid:{
+			default: ''
+		},
+		systemStore:{
+			default: function() {
+				return {};
+			}
+		}
+	},
+	data() {
+		return {};
+	},
+	methods: {
+		// 联系商家
+		shopLi() {
+			uni.makePhoneCall({
+				phoneNumber: this.systemStore.phone //仅为示例
+			});
+		},
+		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: 120rpx;
+	background-color: #ffffff;
+	/* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
+	border-radius: 16rpx; */
+	.icon{
+		width: 50rpx ;
+	}
+	.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;
+		flex-grow: 1;
+		&: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: 250rpx;
+			height: 100%;
+			font-size: $font-base;
+			padding: 0;
+			border-radius: 100px;
+			flex-grow: 1;
+			background: transparent;
+			&.buy-now-btn {
+				background: linear-gradient(90deg, #3C82E6, #5395F5);
+				color: #FFFFFF;
+			}
+			&.add-cart-btn {
+				color: #5395F5;
+				border: 1px solid  #5395F5;
+			}
+		}
+	}
+}
+.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;
+	}
+}
+</style>

+ 150 - 0
pages/product/common/productContent.vue

@@ -0,0 +1,150 @@
+<template>
+	<view class="introduce-section">
+		<view class="flex">
+
+			<view class="price-box">
+				<text class="price-tip">¥</text>
+				<view class="price margin-l-10">
+					{{ goodsObjact.price }}
+					<!-- <text class="text">/份</text> -->
+					<!-- <text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text> -->
+				</view>
+			</view>
+			<view class="sales">
+				{{(goodsObjact.sales+goodsObjact.ficti)|getNum}}+
+				<text class="margin-l-10">
+					付款
+				</text>
+			</view>
+		</view>
+		<text class="title clamp2">{{ goodsObjact.store_name }}</text>
+		<text class="info" v-if="goodsObjact.store_info">{{ goodsObjact.store_info }}</text>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			goodsObjact: {
+				type: Object,
+				default: function() {
+					return {
+						percent: 1
+					};
+				}
+			}
+		},
+		filters: {
+			getNum(num) {
+				if (num) {
+			
+					// 转为字符串
+					num += '';
+					let nu = num.slice(0, 1);
+					for (let i = 0; i < num.length - 1; i++) {
+						nu += 0
+					}
+					return nu
+				}
+			}
+		},
+		data() {
+			return {};
+		}
+	};
+</script>
+
+<style lang="scss">
+	/* 标题简介 */
+	.introduce-section {
+		position: relative;
+		background: #fff;
+		padding: 35rpx 35rpx;
+
+		.sales {
+			color: $font-color-light;
+			font-size: 24rpx;
+		}
+
+		.title {
+			font-size: 32rpx;
+			color: $font-color-dark;
+
+			.tip-o {
+				color: #ff3334;
+				padding-left: 15rpx;
+			}
+		}
+
+		.shareDate {
+			position: absolute;
+			top: 25rpx;
+			right: 25rpx;
+			font-size: 26rpx;
+			color: #3d3f46;
+			border-radius: 15rpx;
+			background-color: #ffffff;
+			height: 60rpx;
+			line-height: 60rpx;
+		}
+
+		.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: 26rpx;
+			color: $uni-color-primary;
+		}
+
+		.price {
+			font-size: 44rpx;
+			font-weight: bold;
+
+			.text {
+				padding-left: 5rpx;
+				color: #b0b0b0;
+				font-size: 22rpx !important;
+			}
+		}
+
+		.m-price {
+			margin: 0 12rpx;
+			color: $font-color-light;
+			text-decoration: line-through;
+			margin-left: 25rpx;
+			font-size: 24rpx;
+		}
+	}
+</style>

+ 55 - 0
pages/product/common/topSwiper.vue

@@ -0,0 +1,55 @@
+<template>
+	<view class="carousel">
+		<swiper indicator-dots :circular="true" duration="400">
+			<swiper-item class="swiper-item" v-for="(item, index) in imgList" :key="index">
+				<view class="image-wrapper"><image :src="item" class="loaded" mode="scaleToFill"></image></view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+export default {
+	props: {
+		imgList: {
+			type: Array,
+			default: function () {
+				return []
+			}
+		},
+	},
+	data() {
+		return {
+			
+		};
+	},
+};
+</script>
+
+<style lang="scss">
+.carousel {
+	/* #ifdef APP-PLUS */
+	padding-top: var(--status-bar-height);
+	/* #endif */
+	height: 700rpx;
+	position: relative;
+	swiper {
+		height: 100%;
+	}
+	.image-wrapper {
+		width: 100%;
+		height: 100%;
+	}
+	.swiper-item {
+		display: flex;
+		justify-content: center;
+		align-content: center;
+		height: 700rpx;
+		overflow: hidden;
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+}
+</style>

+ 416 - 0
pages/product/list.vue

@@ -0,0 +1,416 @@
+<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: '正在加载',
+				mask:true
+			});
+		},
+		//显示分类面板
+		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: '正在加载',
+				mask:true
+			});
+		},
+		//详情
+		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>

+ 648 - 0
pages/product/product.vue

@@ -0,0 +1,648 @@
+<template>
+	<view class="container">
+		<!-- 轮播图 -->
+		<top-swiper :imgList="imgList"></top-swiper>
+		<!-- 标题 -->
+		<product-content :goodsObjact="goodsObjact"></product-content>
+		<!-- 规格信息 -->
+		<fresh-detail @click='specOPne' :specSelected="specSelected"></fresh-detail>
+		<!-- 图文详情 -->
+		<content-text :description="description"></content-text>
+		<!-- 底部高度撑开 -->
+		<view class="contentBottomHeight"></view>
+		<!-- 底部操作菜单 -->
+		<product-bottom :systemStore='system_store' @buy="buy" :goodsObjact="goodsObjact" :goodsid="goodsid"
+			@specOPne="specOPne"></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">
+				<image class="close" src="../../static/icon/goodsExit.png" mode="aspectFit" @click="toggleSpec">
+				</image>
+
+				<view class="a-t">
+					<image @click="showImg(true)" :src="actionGoodsType.actionImage"></image>
+					<view class="right">
+						<text class="name">{{ goodsObjact.store_name }}</text>
+						<text class="price">
+							<text class="font-size-base margin-r-10">
+								¥
+							</text>
+							<text>
+								{{ actionGoodsType.actionPrice*goodsNumber}}
+							</text>
+							<text class="font-color-gray font-size-sm margin-l-10">
+								库存:{{actionGoodsType.goodsStore}}
+							</text>
+						</text>
+					</view>
+				</view>
+				<view v-if="many==2" v-for="(item, index) in specList" :key="index" class="attr-list">
+					<text>{{ item.attr_name }}</text>
+					<view class="item-list flex">
+						<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 v-if="many==1" class="attr-list">
+					<text>规格</text>
+					<view class="item-list flex">
+						<text class="tit selected">
+							默认
+						</text>
+					</view>
+				</view>
+				<view class="attr-list">
+					<text>购买数量</text>
+					<view class="item-list">
+						<uni-number-box class="step" :isMin="true" v-model="goodsNumber"
+							:max="actionGoodsType.goodsNumberMax"></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>
+</template>
+
+<script>
+	import {
+		goodsDetail,
+		cartAdd
+	} 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 freshDetail from './common/freshDetail.vue';
+	// 图文详情
+	import contentText from './common/contentText.vue';
+	// 底部按钮
+	import productBottom from './common/productBottom.vue';
+	export default {
+		components: {
+			topSwiper,
+			productContent,
+			freshDetail,
+			contentText,
+			productBottom,
+		},
+		data() {
+			return {
+				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: [],
+				// 对比对象
+				good_list: '', //猜你喜欢列表
+				userInfo: '',
+				// 选中商品的分类
+				actionGoodsType: {
+					goodsNumberMax: 0, //最大可购买数量
+					goodsStore: 0, //选中库存
+					actionImage: '', //默认选中图片
+					actionPrice: 0, //默认选中商品价格
+					day_deducted: 0, //选中商品的服务费用
+					deal_price_num: 0, //选中商品的扣款天数
+					uniqueId: '', //选中规格商品id
+				},
+				system_store: {}, //商家信息
+			};
+		},
+		async onLoad(options) {
+			let obj = this;
+			obj.userInfo = uni.getStorageSync('userInfo');
+			//保存商品id
+			this.goodsid = options.id;
+			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']),
+			...mapState('shop', ['shopDetail'])
+		},
+		// 分享
+		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: {
+			showImg(bool) {
+				uni.navigateTo({
+					url: './showImg?imgs=' + JSON.stringify([this.actionGoodsType.actionImage]) + '&current=' + 0,
+					animationType: "fade-in"
+
+				})
+			},
+			//选择规格
+			selectSpec(item, arr, ind) {
+				arr.attr_value.forEach(function(e) {
+					e.check = false;
+				});
+				item.check = true;
+				let obj = this;
+				obj.specSelected[ind] = item.attr;
+				// 重置触发修改事件
+				obj.specSelected = obj.specSelected.map((e) => {
+					return e
+				});
+				let str = obj.specSelected.join(',');
+
+				let goodItemAction = obj.actionGoodsType
+
+				// 获取当前选中的对象
+				if (obj.productValue[str]) {
+
+					obj.buys_show = true;
+					obj.buys_shows = false;
+					goodItemAction.actionPrice = obj.productValue[str].price;
+					goodItemAction.goodsNumberMax = obj.productValue[str].stock;
+					goodItemAction.actionImage = obj.productValue[str].image;
+					goodItemAction.uniqueId = obj.productValue[str].unique;
+					goodItemAction.goodsStore = obj.productValue[str].stock;
+					console.log(goodItemAction.goodsStore, 'kc')
+					goodItemAction.day_deducted = obj.productValue[str].day_deducted; //每天扣款
+					if (+obj.productValue[str].day_deducted) {
+						goodItemAction.deal_price_num = Math.ceil((obj.productValue[str].deal_price - obj.productValue[str]
+							.price) / obj.productValue[str].day_deducted); //每天扣款
+					} else {
+						goodItemAction.deal_price_num = 0
+					}
+					// 扣款天数
+				} else {
+					(obj.buys_show = false), (obj.buys_shows = true);
+				}
+				if (goodItemAction.goodsStore == 0) {
+					obj.buys_show = false;
+					obj.buys_shows = true;
+				}
+				// obj.specSelected[ind] = item.attr;
+			},
+			// 打開彈窗
+			specOPne(type = 1) {
+				let obj = this;
+				obj.type = type;
+				obj.specClass = 'show';
+			},
+			//规格弹窗开关
+			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
+			// 	});
+			// },
+			// 获取商品详情
+			goodsDetail() {
+				let obj = this;
+				// 获取普通商品信息
+				goodsDetail({}, this.goodsid).then(function({
+					data
+				}) {
+					obj.list = data;
+					//保存猜你喜欢列表
+					obj.good_list = data.good_list;
+					//保存评论列表
+					obj.reply = data.reply;
+					let goods = data.storeInfo;
+					obj.goodsObjact = goods;
+					//保存商家信息
+					obj.system_store = data.system_store;
+					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 (obj.specList.length > 0) {
+
+						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(',');
+						let goodItemAction = obj.actionGoodsType
+						// 设置默认值
+						goodItemAction.actionPrice = obj.productValue[str].price;
+						goodItemAction.goodsNumberMax = obj.productValue[str].stock;
+						goodItemAction.actionImage = obj.productValue[str].image;
+						goodItemAction.uniqueId = obj.productValue[str].unique;
+						goodItemAction.goodsStore = obj.productValue[str].stock;
+						goodItemAction.day_deducted = obj.productValue[str].day_deducted; //每天扣款
+						goodItemAction.deal_price_num = Math.ceil((obj.productValue[str].deal_price - obj
+							.productValue[str].price) / obj.productValue[str].day_deducted); //每天扣款
+						// 扣款天数
+					} else {
+						obj.many = 1; //单规格
+						obj.actionGoodsType.actionPrice = goods.price; //保存默认选中商品价格
+						obj.actionGoodsType.actionImage = goods.image_base; //保存默认选中商品图片
+						obj.actionGoodsType.goodsNumberMax = goods.stock; //保存默认选中最大可购买商品数量
+						obj.actionGoodsType.goodsStore = goods.stock;
+					}
+				});
+			},
+			// 立即购买
+			buy() {
+				let obj = this;
+				// 创建传值对象
+				let data = {
+					cartNum: obj.goodsNumber, //商品数量
+					productId: obj.goodsid, //商品编号
+					uniqueId: obj.actionGoodsType.uniqueId,
+				};
+				// 判断是否需要读取非默认商家id
+				// 判断是否加入购物车
+				if (obj.type == 2) {
+					data.new = 0;
+				} else {
+					data.new = 1;
+				}
+				uni.showLoading({
+					title: '请求中',
+					mask: true
+				});
+				cartAdd(data)
+					.then(function(e) {
+						uni.hideLoading()
+						let da = e.data;
+						// 不是购物车跳转支付页面
+						if (obj.type == 1) {
+							// 跳转到支付页
+							let url = '/pages/order/createOrder?id=' + da.cartId
+							uni.navigateTo({
+								url: url,
+								fail(res) {
+									console.log(res, '错误')
+								}
+							});
+						}
+						// 购物车不跳转购物车页面
+						if (obj.type == 2) {
+							uni.showToast({
+								title: '成功加入购物车',
+								type: 'top',
+								duration: 2000,
+								icon: 'none'
+							});
+						}
+						obj.toggleSpec()
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			// 阻止触发上级事件
+			stopPrevent() {}
+		}
+	};
+</script>
+
+<style lang="scss">
+	.alertImgBox {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		width: 100%;
+
+		.alertImg {
+			width: 730rpx;
+		}
+	}
+
+	/*  弹出层 */
+	.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: 35vh;
+			border-radius: 10rpx 10rpx 0 0;
+			background-color: #fff;
+
+			.btn {
+				height: 76rpx;
+				line-height: 66rpx;
+				border-radius: 100rpx;
+				background: linear-gradient(90deg, #3C82E6, #5395F5);
+				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: 50rpx;
+		position: relative;
+
+		.close {
+			width: 36rpx;
+			height: 36rpx;
+			position: absolute;
+			top: 50rpx;
+			right: 50rpx;
+		}
+
+		.a-t {
+			display: flex;
+
+			image {
+				border: 1px solid $page-color-light;
+				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%;
+
+				.price {
+					font-size: 44rpx;
+					color: $uni-color-primary;
+					margin: 10rpx 0rpx;
+					flex-grow: 1;
+					width: 100%;
+				}
+
+				.name {
+					font-size: 32rpx;
+					color: $font-color-dark;
+					height: 50rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+					display: block;
+				}
+
+				.selected-text {
+					margin-right: 10rpx;
+				}
+			}
+		}
+
+		.attr-list {
+			display: flex;
+			flex-direction: column;
+			font-size: $font-base + 2rpx;
+			color: $font-color-base;
+			padding-top: 30rpx;
+		}
+
+		.item-list {
+			padding: 20rpx 0 0;
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: flex-start;
+
+			.tit {
+				min-width: 200rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				background: #eee;
+				margin-bottom: 20rpx;
+				margin-right: 16rpx;
+				border-radius: 5rpx;
+				height: 60rpx;
+				padding: 0 20rpx;
+				font-size: $font-base;
+				color: $font-color-dark;
+			}
+
+			.selected {
+				background: #E1F4EA;
+				color: $color-green;
+				border: 1px solid $color-green;
+			}
+		}
+	}
+
+	//默认商品底部高度
+	.goodsBottom {
+		height: 160rpx;
+	}
+
+	page {
+		background: #f0f0f0;
+	}
+
+	//秒杀、拼团底部高度
+	.contentBottomHeight {
+		height: 110rpx;
+	}
+
+	//默认商品底部高度
+	.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;
+	}
+</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>

+ 449 - 0
pages/product/search.vue

@@ -0,0 +1,449 @@
+<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 { searchKeyword, getProducts } from '@/api/product.js';
+export default {
+	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: '正在加载',
+				mask:true
+			});
+		},
+		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>

+ 252 - 0
pages/product/showImg.vue

@@ -0,0 +1,252 @@
+<template>
+  <view @click="back" @longpress="isPop = true">
+    <swiper class="swiper-img" :current="currentImg" :duration="300" @change="changeSwiper">
+      <swiper-item class="swiper-item" v-for="(item, index) in imgs" :key="index">
+        <view class="img-page">
+          <movable-area scale-area>
+            <movable-view @change.stop='isPop = false'  @scale.stop='isPop = false' direction="all" scale="true" scale-min="1" scale-max="4">
+              <image :src="item" mode="widthFix" :lazy-load="true" />
+            </movable-view>
+          </movable-area>
+        </view>
+      </swiper-item>
+    </swiper>
+    <view class="item-bottom">
+      <view class="small-list-page">
+        <view class="small-list" v-if="imgs.length > 1">
+          <view class="img-page" :class="currentImg == index ? 'img-page-checked' : ''" v-for="(item, index) in imgs"
+            :key="index" @click.stop="toImg(index)">
+            <image class="img" border-radius="10rpx" :src="item" mode="aspectFill" />
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="pop" v-if="isPop">
+      <!-- <view class="item" @click.stop="share()">分享图片</view> -->
+      <!-- #ifndef H5 -->
+      <view class="item" @click.stop="saveImg(false)">保存图片</view>
+      <view class="item" v-if='imgs.length>1' @click.stop="saveImg(true)">保存全部图片</view>
+      <!-- #endif -->
+    </view>
+  </view>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        imgs: [],
+        currentImg: 0,
+        isPop: false
+      };
+    },
+    onLoad(options) {
+      let {
+        imgs,
+        current
+      } = options;
+      this.imgs = JSON.parse(imgs);
+      this.currentImg = current;
+    },
+    methods: {
+      changeSwiper(e) {
+        this.currentImg = e.detail.current;
+      },
+      toImg(index) {
+        this.currentImg = index;
+      },
+      back() {
+        if (this.isPop) {
+          this.isPop = false
+          return
+        }
+        try {
+          this.$Router.back(1);
+        } catch (e) {
+          //TODO handle the exception
+          uni.navigateBack();
+        }
+      },
+      share() {
+        uni.downloadFile({
+          // 下面一行时拼接预览PDF的地址!!!
+          url: this.imgs[this.currentImg],
+          success: function(res) {
+            var filePath = res.tempFilePath;
+            if (!filePath) return
+            uni.openDocument({
+              filePath: filePath,
+              success: function(res) {
+                console.log(res);
+                console.log('打开文档成功');
+              }
+            });
+          }
+        });
+      },
+      saveImg(isAll = false) {
+        const that = this;
+        if (!isAll) {
+          uni.downloadFile({
+            url: this.imgs[this.currentImg],
+            success: res => {
+              if (res.statusCode === 200) {
+                uni.saveImageToPhotosAlbum({
+                  filePath: res.tempFilePath,
+                  success: function() {
+                    uni.showToast({
+                      icon: "none",
+                      title: "保存成功"
+                    })
+                    that.isPop =false
+                  },
+                  fail: function() {}
+                });
+              } else {}
+            }
+          });
+          return;
+        }
+        this.imgs.forEach(item => {
+          uni.downloadFile({
+            url: item,
+            success: res => {
+              if (res.statusCode === 200) {
+                uni.saveImageToPhotosAlbum({
+                  filePath: res.tempFilePath,
+                  success: function() {
+                    uni.showToast({
+                      icon: "none",
+                      title: "保存全部成功"
+                    })
+                    that.isPop =false
+                  },
+                  fail: function() {}
+                });
+              } else {}
+            }
+          });
+        })
+
+      }
+    },
+  };
+</script>
+
+<style lang="scss" scoped>
+  movable-view {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    height: 100%;
+  }
+
+  movable-area {
+    height: 100%;
+    width: 100%;
+    position: fixed;
+    overflow: hidden;
+  }
+
+  movable-view image {
+    width: 100%;
+  }
+
+  uni-image>img {
+    z-index: -1 !important;
+  }
+
+  .content {
+    height: 60vh;
+  }
+
+  .swiper-img {
+    width: 100vw;
+    height: 100vh;
+    background-color: #000000;
+    &>.swiper-item {
+      width: 100vw;
+      height: 100vh;
+
+      .img-page {
+        height: 100vh;
+        display: flex;
+        align-items: center;
+      }
+    }
+  }
+
+  .item-bottom {
+    width: 100vw;
+    position: fixed;
+    z-index: 9999;
+    bottom: 0;
+    left: 0rpx;
+    padding: 30rpx;
+    transition: ease-in-out 0.3s;
+    height: 200rpx;
+    display: flex;
+    justify-content: space-between;
+    flex-direction: column;
+  }
+
+  .small-list-page {
+    min-height: 60rpx;
+  }
+
+  .small-list {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+
+    .img-page {
+      display: inline-block;
+      margin-right: 20rpx;
+      border: 2rpx solid #c2c2c2;
+      transition: ease-in 0.1s;
+      border-radius: 11rpx;
+      background: #c2c2c2;
+      overflow: hidden;
+
+      &:last-child {
+        margin-right: 0;
+      }
+
+      .img {
+        width: 46rpx;
+        height: 46rpx;
+        display: block;
+      }
+    }
+
+    .img-page-checked {
+      transform: scale(1.2);
+      border: 4rpx solid #c2c2c2;
+    }
+  }
+
+  .pop {
+    width: 500rpx;
+    background-color: #FFFFFF;
+    border-radius: 20rpx;
+    overflow: hidden;
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    z-index: 999999;
+
+    .item {
+      line-height: 100rpx;
+      height: 100rpx;
+      padding: 0 50rpx;
+      transition: all .2s;
+      border-radius: 20rpx;
+
+      &:active {
+        background-color: #eeeeee;
+      }
+    }
+  }
+</style>

+ 2 - 2
pages/public/domApp.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="box">
 		<view class="logo flex-line ">
-			<image class="logoImg" src="../../static/img/domLogo.png" mode="aspectFit"></image>
+			<image class="logoImg" src="../../static/image/domLogo.png" mode="aspectFit"></image>
 			<view class="text">
 				<view class="name">
 					母婴界
@@ -20,7 +20,7 @@
 				</view>
 			</view>
 		</view>
-		<image class="img" src="../../static/img/bg.png" mode="widthFix"></image>
+		<image class="img" src="../../static/image/bg.png" mode="widthFix"></image>
 		<view class="bottom flex-line">
 			<view class="buttom" @click="load">
 				立即下载

+ 9 - 8
pages/public/login.vue

@@ -5,7 +5,7 @@
 				<image class="banner-img" src="../../static/image/logo.png" mode="scaleToFill"></image>
 			</view>
 			<view class="logName">
-				母婴界严选
+				
 			</view>
 		</view>
 		<view class="login_text">
@@ -79,6 +79,7 @@
 				checked: false, //是否同意条款
 				username: '',
 				passward: '',
+				successUrl:'/pages/home/index'
 			};
 		},
 		onLoad() {
@@ -99,15 +100,15 @@
 					this.logout();
 					uni.showModal({
 						title: '提示',
-						content: '请先阅读同意《母婴界严选服务》《隐私条例》',
+						content: '请先阅读同意《绿津服务》《隐私条例》',
 						showCancel: false,
 					});
 					return;
 				}
-				let ur = uni.getStorageSync('present') || '/pages/index/index';
+				let ur = uni.getStorageSync('present') || this.successUrl;
 				// 用于处理缓存bug
 				if (ur == 'pages/product/product') {
-					ur = '/pages/index/index'
+					ur = this.successUrl
 				}
 				
 				if (!userinfo.phone) {
@@ -131,7 +132,7 @@
 								url: ur,
 								fail(e) {
 									uni.navigateTo({
-										url: '/pages/index/index',
+										url:this.successUrl,
 									});
 								}
 							});
@@ -154,7 +155,7 @@
 				if(!this.checked){
 					uni.showModal({
 						title: '提示',
-						content: '请先阅读同意《母婴界严选服务》《隐私条例》',
+						content: '请先阅读同意《绿津服务》《隐私条例》',
 						showCancel: false,
 					});
 					return;
@@ -171,13 +172,13 @@
 							obj.login();
 							// 保存返回用户数据
 							obj.setUserInfo(e.data);
-							let ur = uni.getStorageSync('present') || '/pages/index/index';
+							let ur = uni.getStorageSync('present') || obj.successUrl;
 							//成功跳转首页
 							uni.reLaunch({
 								url: ur,
 								fail(e) {
 									uni.switchTab({
-										url: '/pages/index/index',
+										url: obj.successUrl,
 									});
 								}
 							})

+ 3 - 2
pages/public/loginMethods.vue

@@ -58,6 +58,7 @@
 				is_ios: false, //判断是否为ios手机
 				// is_apple_login: false, //是否有ios授权登录功能
 				// #endif
+				successUrl:'/pages/home/index'
 			};
 		},
 		created() {
@@ -135,7 +136,7 @@
 												obj.setUserInfo(e.data);
 												//成功跳转首页
 												uni.switchTab({
-													url: '/pages/index/index'
+													url: obj.successUrl
 												});
 											});
 			
@@ -156,7 +157,7 @@
 										// obj.setUserInfo(e.data);
 										// //成功跳转首页
 										// uni.switchTab({
-										// 	url: '/pages/index/index'
+										// 	url: this.successUrl
 										// });
 									}
 								});

+ 1 - 1
pages/public/phoneLogin.vue

@@ -154,7 +154,7 @@
 						obj.setUserInfo(e.data);
 						//成功跳转首页
 						uni.switchTab({
-							url: '/pages/index/index'
+							url: '/pages/home/index'
 						});
 					});
 				}).catch((e) => {

+ 9 - 4
pages/public/redirect.vue

@@ -34,6 +34,11 @@
 			this.loadMp(option)
 			// #endif
 		},
+		data() {
+			return {
+				successUrl:'/pages/home/index'
+			};
+		},
 		methods: {
 			...mapMutations('user', ['login', 'setUserInfo', 'logout']),
 			// #ifdef H5
@@ -50,7 +55,7 @@
 				}) => {
 					obj.wchatAuth(data);
 					// 修改当前页面
-					history.replaceState({ name: '首页' }, '首页', obj.urlFile+'/pages/index/index');
+					history.replaceState({ name: '首页' }, '首页', obj.urlFile+obj.successUrl);
 				}).catch((e) => {
 					uni.showModal({
 						title: '错误',
@@ -105,10 +110,10 @@
 					obj.login();
 					// 保存返回用户数据
 					obj.setUserInfo(e.data);
-					let ur = uni.getStorageSync('present') || '/pages/index/index';
+					let ur = uni.getStorageSync('present') || obj.successUrl;
 					// 用于处理缓存bug
 					if (ur == 'pages/product/product') {
-						ur = '/pages/index/index'
+						ur = obj.successUrl
 					}
 
 					if (!e.data.phone) {
@@ -132,7 +137,7 @@
 									url: ur,
 									fail(e) {
 										uni.navigateTo({
-											url: '/pages/index/index',
+											url: obj.successUrl,
 										});
 									}
 								});

+ 6 - 7
pages/public/wxLogin.vue

@@ -61,6 +61,7 @@
 				loding: false, //判断是否在点击中
 				MaskShow: false, // 手机号授权弹窗
 				cache_key: '',
+				successUrl:'/pages/home/index'
 			};
 		},
 		onLoad(option) {
@@ -125,7 +126,7 @@
 			outUser() {
 				this.logout();
 				uni.switchTab({
-					url: '/pages/index/index'
+					url: this.successUrl
 				})
 			},
 			getLoginCode() {
@@ -208,10 +209,11 @@
 			},
 			// #endif
 			ToIndex() {
-				let ur = uni.getStorageSync('present') || '/pages/index/index';
+				const that = this;
+				let ur = uni.getStorageSync('present') ||that.successUrl;
 				// 用于处理缓存bug
 				if (ur == 'pages/product/product') {
-					ur = '/pages/index/index';
+					ur = that.successUrl;
 				}
 				uni.switchTab({
 					url: ur,
@@ -220,15 +222,12 @@
 							url: ur,
 							fail(e) {
 								uni.navigateTo({
-									url: '/pages/index/index'
+									url: that.successUrl
 								});
 							}
 						});
 					}
 				});
-				// uni.switchTab({
-				// 	url: '/pages/index/index'
-				// });
 			},
 			// 获取用户数据
 			GetUser() {

+ 1 - 1
pages/user/model/model.vue

@@ -200,7 +200,7 @@
 			// console.log(currentPage.route)
 			if (currentPage.route == 'pages/public/wxLogin') {
 				uni.switchTab({
-					url: '/pages/index/index'
+					url: '/pages/home/index'
 				})
 			}
 		},

+ 1 - 1
pages/user/money/paySuccess.vue

@@ -12,7 +12,7 @@
 				<navigator v-if="type==0" :url="'/pages/order/orderDetail?id='+orderId" open-type="redirect"
 					class="mix-btn hollow">查看订单</navigator>
 				<view v-if="type==1" class="mix-btn hollow" @click="navBack">返回</view>
-				<navigator url="/pages/index/index" open-type="switchTab" class="mix-btn ">返回首页</navigator>
+				<navigator url="/pages/home/index" open-type="switchTab" class="mix-btn ">返回首页</navigator>
 			</view>
 		</view>
 	</view>

+ 1 - 1
pages/user/myteam.vue

@@ -11,7 +11,7 @@
 				<view class="header">我的推广</view>
 			</view> -->
 			<view class="content-bg">
-				<image src="../../static/img/tg-bg.png" mode=""></image>
+				<image src="../../static/image/tg-bg.png" mode=""></image>
 			</view>
 			<view class="money-box">
 				<view class="money">{{ all|| '0' }}</view>

+ 1 - 1
pages/user/shareQrCode.vue

@@ -36,7 +36,7 @@
 			// if (res.from === 'button') {
 
 			// 保存邀请人
-			let path = '/pages/index/index?' + 'spread=' + this.userInfo.uid;
+			let path = '/pages/home/index?' + 'spread=' + this.userInfo.uid;
 			console.log('path', path)
 			let data = {
 				path: path,

BIN
static/icon/goodsAddCart.png


BIN
static/icon/goodsServer.png


BIN
static/icon/hot.png


BIN
static/icon/index1.png


BIN
static/icon/index2.png


BIN
static/icon/index3.png


BIN
static/icon/index4.png


BIN
static/icon/index5.png


BIN
static/icon/tj.png


BIN
static/icon/底部菜单_slices/组 2291(1).png


BIN
static/icon/底部菜单_slices/组 2291(2).png


BIN
static/icon/底部菜单_slices/组 2291(3).png


BIN
static/icon/底部菜单_slices/组 2291(4).png


BIN
static/icon/底部菜单_slices/组 2291(5).png


BIN
static/icon/底部菜单_slices/组 2291(6).png


BIN
static/icon/底部菜单_slices/组 2291(7).png


BIN
static/icon/底部菜单_slices/组 2291(8).png


BIN
static/icon/底部菜单_slices/组 2291(9).png


BIN
static/icon/底部菜单_slices/组 2291.png


BIN
static/icon/底部菜单_slices/组 2291@2x(1).png


BIN
static/icon/底部菜单_slices/组 2291@2x(2).png


BIN
static/icon/底部菜单_slices/组 2291@2x(3).png


BIN
static/icon/底部菜单_slices/组 2291@2x(4).png


BIN
static/icon/底部菜单_slices/组 2291@2x(5).png


BIN
static/icon/底部菜单_slices/组 2291@2x(6).png


BIN
static/icon/底部菜单_slices/组 2291@2x(7).png


BIN
static/icon/底部菜单_slices/组 2291@2x(8).png


BIN
static/icon/底部菜单_slices/组 2291@2x(9).png


BIN
static/icon/底部菜单_slices/组 2291@2x.png


+ 0 - 0
static/img/bg.png → static/image/bg.png


+ 0 - 0
static/img/domLogo.png → static/image/domLogo.png


BIN
static/image/img009.png


BIN
static/image/img010.png


BIN
static/image/index-top.png


+ 0 - 0
static/img/tg-bg.png → static/image/tg-bg.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-order-current.png


BIN
static/tabBar/tab-order.png


+ 1 - 1
store/index.js

@@ -7,7 +7,7 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
 	state: {
 		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
-		baseURL:'https://api.myjie.cn',//请求地址配置 
+		baseURL:'http://sc.frp.liuniu946.com',//请求地址配置 
 		// baseURL:'http://dp.frp.shuibo.net',//请求地址配置 
 		urlFile:'/index',//项目部署所在文件夹
 		hasLogin:false,

+ 5 - 5
utils/request.js

@@ -10,9 +10,9 @@ service.interceptors.response(
 		try {
 			let res = response.data;
 			// 解析字符串为数字
-			if (res.code !== 200) {
-				console.log(res.code);
-				if (res.code == 410000) {
+			if (res.status !== 200) {
+				console.log(res.status);
+				if (res.status == 410000) {
 					// 调用退出登录方法清空用户信息
 					store.commit('user/logout');
 					// 判断是否开启强制登录
@@ -66,11 +66,11 @@ service.interceptors.request(
 		// console.log(config);
 		if (!config.header) {
 			config.header = {
-				"token":  token,
+				"Authori-zation": 'Bearer ' + token,
 			}
 		} else {
 			// 添加key请求头
-			config.header["token"] = token;
+			config.header["Authori-zation"] = 'Bearer ' + token;
 		}
 		return config
 	},

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.