Browse Source

完成购买功能

gcz 4 years ago
parent
commit
566b614944

+ 1 - 1
App.vue

@@ -2,7 +2,7 @@
 	import iconfont from "@/static/iconfont/iconfont.js";
 	export default {
 		onLaunch: function() {
-			// this.$wxApi.config()
+			this.$wxApi.config()
 			// console.log('App Launch')
 		},
 		onShow: function() {

+ 30 - 3
common/css/common.css

@@ -5,6 +5,7 @@ input{outline: 0!important;}
 uni-button[type=primary]{background-color: #6BBC6D;}
 
 .wrap{margin: 0 40rpx;}
+.page-wrap{padding: 24rpx;}
 
 /* 轮播 */
 .appAdv{height:400rpx;}
@@ -42,8 +43,8 @@ uni-button[type=primary]{background-color: #6BBC6D;}
 .big-btn-hollow{border: 1px solid #E5E5E5;color: #333;}
 
 /* 常规间距 */
-.nomal-top{margin-top: 40rpx;}
-.nomal-bottom{margin-bottom: 40rpx;}
+.nomal-top{margin-top: 24rpx;}
+.nomal-bottom{margin-bottom: 24rpx;}
 
 /* 搜索 */
 .full-search{display: flex;overflow: hidden;background-color: #fff;border: 1px solid #cecece;border-radius: 100rpx;}
@@ -58,6 +59,7 @@ uni-button[type=primary]{background-color: #6BBC6D;}
 .form-item-type{margin: 24rpx 0;}
 .form-item{position: relative;display: flex;min-height: 96rpx;justify-content: space-between;align-items: center;margin: 0 0 0 24rpx;border-bottom: 1px solid #eee;}
 .form-item.arrow::after{content: '';width: 20rpx;height: 20rpx;margin-top: -10rpx;right: 24rpx;position: absolute;top: 50%;border-top: 1px solid #ccc;border-right: 1px solid #ccc;transform: rotate(45deg);}
+.form-item.required::before{content: '*';position: absolute;left: -15rpx;top: 50%;line-height: 1;margin-top: -12rpx;color: red;}
 .form-item-til,
 .form-item-con{padding: 20rpx 0;}
 .form-item-til{padding-right: 15rpx;font-size: 34rpx;}
@@ -91,10 +93,11 @@ uni-button[type=primary]{background-color: #6BBC6D;}
 
 /* 内容全屏 */
 /* top:calc(44px + env(safe-area-inset-top)); 头部导航时 */
-.fix-content{position: fixed;left: 0;right: 0;top:calc(44px + env(safe-area-inset-top));bottom: 0;}
+.fix-content{position: fixed;left: 0;right: 0;top:calc(44px + env(safe-area-inset-top));bottom: 0;overflow-y: auto;}
 /* 隐藏弹出 */
 .fix-content.translate{transition: all .3s;background-color: #fff;z-index: 100;transform: translateX(100%);}
 .fix-content.translate.open{transform: translateX(0);}
+.fix-content-nav{padding: 24rpx;background: #e6e6e6;}
 
 /* 圆角带边框左对齐搜索 */
 .search-left-color >>> .uni-searchbar__box{justify-content: left!important;border-color: #6BBC6D!important;border-radius: 50rpx!important;background-color: #fff!important;}
@@ -120,3 +123,27 @@ uni-button[type=primary]{background-color: #6BBC6D;}
 .page-tip{margin: 24rpx 40rpx;font-size: 32rpx;color: #999;line-height: 45rpx;}
 .page-tip-til{color: #6BBC6D;}
 
+.step-wrap{padding: 43rpx 86rpx 92rpx 74rpx;margin-bottom: 24rpx;display: flex;background-color: #fff;border-radius: 16rpx;}
+.step-item{position: relative;flex: 1;height: 2rpx;background-color: #E5E5E5;}
+.step-item::before{content: '';width: 16rpx;height: 16rpx;background-color: #E5E5E5;border-radius: 50%;position: absolute;left: 0;top: -8rpx;}
+.step-item.active{background-color: #6BBC6D;}
+.step-item.active::before{background-color: #6BBC6D;}
+.step-item::after{content: attr(data-text);position: absolute;bottom: -60rpx;left: -30rpx;font-size: 24rpx;}
+.step-wrap .step-item:last-of-type{flex: unset;width: 0;}
+.step-wrap .step-item:last-of-type::after{width: 100rpx;}
+
+/* 订单信息 */
+.bill-info{margin-top: 24rpx;margin-bottom: 24rpx;padding: 24rpx;padding-bottom: 0;background-color: #fff;border-radius: 16rpx;}
+.bill-product{display: flex;align-items: center;margin-bottom: 57rpx;}
+.bill-product-imgwrap{width: 160rpx;height: 160rpx;overflow: hidden;display: flex;align-items: center;margin-right: 24rpx;}
+.bill-product-img{width: 100%;height: 100%;text-align: center;max-width: 100%;}
+.bill-product-name{font-size: 30rpx;color: #333;line-height: 42rpx;margin-bottom: 8rpx;}
+.bill-product-info{flex: 1;}
+.bill-product-price-wrap{display: flex;justify-content: space-between;}
+.bill-product-price-wrap .left{font-size: 28rpx;color: #FF5030;}
+.bill-product-number{width: 150rpx;text-align: right;}
+.bill-product-price{font-size: 36rpx;color: #FF5030;line-height: 50rpx;font-weight: bold;margin-left: 8rpx;margin-right: 5rpx;}
+.bill-product-unit{font-size: 24rpx;color: #999;}
+.bill-product-number{font-size: 24rpx;color: #999;}
+.bill-info .form-item:last-of-type{border-bottom: 0;}
+.bill-info .amount{color: #FF5030;font-weight: bold;}

+ 5 - 3
config/config.js

@@ -4,8 +4,8 @@ const config = {
 	// apiBaseurl:'http://172.16.90.64:9098/forest-portal',//测试
 	// apiBaseurl:'http://172.16.90.50:9098/forest-portal',//邱波
 	// apiBaseurl:'http://172.16.90.3:9098/forest-portal',//邱波
-	// apiBaseurl:'http://wx.hw.hongweisoft.com/zddtest/forest-portal',//东东
-	apiBaseurl:'http://wx.hw.hongweisoft.com/zddapi/forest-portal',//东东
+	apiBaseurl:'http://wx.hw.hongweisoft.com/zddtest/forest-portal',//东东
+	// apiBaseurl:'http://wx.hw.hongweisoft.com/zddapi/forest-portal',//东东
 	//本地图片
 	// imgUrl:'http://'+window.location.host,
 	// 图片占位
@@ -13,7 +13,9 @@ const config = {
 	
 	// loginUrl:'http://tanhui.hongweisoft.com/forest-portal/wechat/h5/authorize?returnUrl=/',//登录后跳转到测试链接
 	// loginUrl:'http://forest.hw.hongweisoft.com/data/forest-portal/wechat/h5/authorize?returnUrl=/',//登录后跳转到测试链接
-	loginUrl:'http://wx.hw.hongweisoft.com/zddapi/forest-portal/wechat/h5/authorize?returnUrl=http://172.16.90.25:8081/#/',//登录后跳转到测试链接 东东
+	// loginUrl:'http://wx.hw.hongweisoft.com/zddapi/forest-portal/wechat/h5/authorize?returnUrl=http://172.16.90.25:8081/#/',//登录后跳转到测试链接 东东
+	loginUrl:'http://wx.hw.hongweisoft.com/zddtest/forest-portal/wechat/h5/authorize?returnUrl=http://foresth5test.hw.hongweisoft.com/#/',//登录后跳转到测试链接 东东
+	// loginUrl:'http://wx.hw.hongweisoft.com/zddtest/forest-portal/wechat/h5/authorize?returnUrl=http://wx.hw.hongweisoft.com/gcz/#/',//登录后跳转到测试链接 东东
 
 	// 公司测试配置
 	// apiBaseurl:'http://forest.hw.hongweisoft.com/data/forest-portal',//测试

+ 41 - 1
main.js

@@ -4,6 +4,29 @@ import { config } from './config/config'
 import store from './store' 
 import Request from '@/js_sdk/luch-request/luch-request/index.js';
 const http = new Request();
+http.interceptors.response.use((response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/
+   if (response.data.code !== 200) { // 服务端返回的状态码不等于200,则reject()
+	   uni.showToast({
+		icon:'none',
+		mask:false,
+		title:`${response.data.message}`,
+		duration: 2000
+	   });
+	 };
+	 if(response.data.code == 401){
+		// console.log(response) 
+	 };
+     // return Promise.reject(response) // return Promise.reject 可使promise状态进入catch
+ if (response.config.custom.verification) { // 演示自定义参数的作用
+    return response.data
+  }
+  // console.log(response)
+  return response
+}, (response) => { /*  对响应错误做点什么 (statusCode !== 200)*/
+  console.log(response);
+  return Promise.reject(response)
+});
+
 import './utils/filter' 
 
 Vue.config.productionTip = false
@@ -15,6 +38,19 @@ const setNavbarTitle = (title,defaultTitle) => {
 	})
 }
 
+//统一提示方便全局修改
+const msg = (title, duration=1500, mask=false, icon='none')=>{
+	if(Boolean(title) === false){
+		return;
+	}
+	uni.showToast({
+		title,
+		duration,
+		mask,
+		icon
+	});
+}
+
 //封装全局登录检查函数:backpage为登录后返回的页面;backtype为打开页面的类型[1 : redirectTo 2 : switchTab]
 //3种页面跳转方式:NavigationTo(直接打开新页面),RedirectTo(覆盖原页面后打开新页面),SwitchTo(切换顶部导航的方式来切换页面)
 Vue.prototype.checkLogin = function(backpage, backtype){
@@ -31,7 +67,11 @@ Vue.prototype.checkLogin = function(backpage, backtype){
 import $wxApi from "./wxapi.js";
 Vue.prototype.$wxApi = $wxApi;
 
-Vue.prototype.$api = {http,setNavbarTitle}
+//微信支付封装
+import $pay from "./pay.js";
+Vue.prototype.$pay = $pay
+
+Vue.prototype.$api = {msg,http,setNavbarTitle}
 Vue.prototype.$getimg = config.imgUrl
 Vue.prototype.$placeImg = config.placeImg
 Vue.prototype.$store = store

+ 1 - 0
manifest.json

@@ -81,6 +81,7 @@
             "base" : "./"
         },
         "devServer" : {
+			"disableHostCheck":true,
             "https" : false
         },
         "title" : "贵州林产品信息发布平台",

+ 96 - 0
package-lock.json

@@ -0,0 +1,96 @@
+{
+  "name": "forest",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "argparse": {
+      "version": "1.0.10",
+      "resolved": "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz",
+      "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=",
+      "requires": {
+        "sprintf-js": "~1.0.2"
+      }
+    },
+    "bmaplib.curveline": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/bmaplib.curveline/download/bmaplib.curveline-1.0.0.tgz",
+      "integrity": "sha1-gm6wvxxZ+tGyMUK+Zvw2DPAJrqI="
+    },
+    "bmaplib.heatmap": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npm.taobao.org/bmaplib.heatmap/download/bmaplib.heatmap-1.0.4.tgz",
+      "integrity": "sha1-MBYSYncf54rzVwX/kkV3Jd5dmFA="
+    },
+    "bmaplib.lushu": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npm.taobao.org/bmaplib.lushu/download/bmaplib.lushu-1.0.7.tgz",
+      "integrity": "sha1-d8F9z3FI0wxG6EMMf/hrIOQYuLg="
+    },
+    "bmaplib.markerclusterer": {
+      "version": "1.0.13",
+      "resolved": "https://registry.npm.taobao.org/bmaplib.markerclusterer/download/bmaplib.markerclusterer-1.0.13.tgz",
+      "integrity": "sha1-RC1xpsQIRO5H0B9tshZrVFMLW9E=",
+      "requires": {
+        "bmaplib.texticonoverlay": "^1.0.2"
+      }
+    },
+    "bmaplib.texticonoverlay": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/bmaplib.texticonoverlay/download/bmaplib.texticonoverlay-1.0.2.tgz",
+      "integrity": "sha1-14VG6g8DbZ/pZJg3ljFbbBEqBb8="
+    },
+    "entities": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/entities/download/entities-1.1.2.tgz?cache=0&sync_timestamp=1602897029273&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-1.1.2.tgz",
+      "integrity": "sha1-vfpzUplmTfr9NFKe1PhSKidf6lY="
+    },
+    "linkify-it": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npm.taobao.org/linkify-it/download/linkify-it-2.2.0.tgz?cache=0&sync_timestamp=1589973714406&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flinkify-it%2Fdownload%2Flinkify-it-2.2.0.tgz",
+      "integrity": "sha1-47VGl+eL+RXHCjis14/QngBYsc8=",
+      "requires": {
+        "uc.micro": "^1.0.1"
+      }
+    },
+    "markdown-it": {
+      "version": "8.4.2",
+      "resolved": "https://registry.npm.taobao.org/markdown-it/download/markdown-it-8.4.2.tgz",
+      "integrity": "sha1-OG+YmY3BWjdyKqdyIIT0Agvdm1Q=",
+      "requires": {
+        "argparse": "^1.0.7",
+        "entities": "~1.1.1",
+        "linkify-it": "^2.0.0",
+        "mdurl": "^1.0.1",
+        "uc.micro": "^1.0.5"
+      }
+    },
+    "mdurl": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npm.taobao.org/mdurl/download/mdurl-1.0.1.tgz",
+      "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
+    },
+    "sprintf-js": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz",
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+    },
+    "uc.micro": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npm.taobao.org/uc.micro/download/uc.micro-1.0.6.tgz",
+      "integrity": "sha1-nEEagCpAmpH8bPdAgbq6NLJEmaw="
+    },
+    "vue-baidu-map": {
+      "version": "0.21.22",
+      "resolved": "https://registry.npm.taobao.org/vue-baidu-map/download/vue-baidu-map-0.21.22.tgz",
+      "integrity": "sha1-a3apHvNPGKeC1zKrD1QaGjqgaeA=",
+      "requires": {
+        "bmaplib.curveline": "^1.0.0",
+        "bmaplib.heatmap": "^1.0.4",
+        "bmaplib.lushu": "^1.0.7",
+        "bmaplib.markerclusterer": "^1.0.13",
+        "markdown-it": "^8.4.0"
+      }
+    }
+  }
+}

+ 20 - 0
package.json

@@ -0,0 +1,20 @@
+{
+  "name": "forest",
+  "version": "1.0.0",
+  "description": "",
+  "main": "main.js",
+  "dependencies": {
+    "vue-baidu-map": "^0.21.22"
+  },
+  "devDependencies": {},
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "http://172.16.90.250:3000/forest/forest-H5.git"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC"
+}

+ 24 - 0
pages.json

@@ -93,6 +93,18 @@
 				"navigationBarTitleText": "贵州林产品-企业认证"
 			}
 		},
+		{
+			"path": "pages/usercenter/myorder/myorder",
+			"style": {
+				"navigationBarTitleText": "我的订单"
+			}
+		},
+		{
+			"path": "pages/usercenter/myorder/orderdetails/orderdetails",
+			"style": {
+				"navigationBarTitleText": "订单详情"
+			}
+		},
 		{
 			"path": "pages/usercenter/bindphone/bindphone",
 			"style": {
@@ -105,6 +117,18 @@
 				"navigationBarTitleText": "贵州林产品-意见反馈"
 			}
 		},
+		{
+			"path": "pages/usercenter/addrs/addrs",			
+			"style": {
+				"navigationBarTitleText": "地址管理"
+			}
+		},
+		{
+			"path": "pages/confirmorder/confirmorder",			
+			"style": {
+				"navigationBarTitleText": "确认订单"
+			}
+		},
 		{
 			"path": "pages/inbuild/inbuild",
 			"style": {

+ 24 - 0
pages/confirmorder/confirmorder.css

@@ -0,0 +1,24 @@
+page{background-color: #FBFBFC;}
+.content-wrap{padding: 24rpx;}
+.bottom-btn{background-color: #6BBC6D;height: 98rpx;line-height: 98rpx;color: #fff;border-radius: 8rpx;text-align: center;font-size: 36rpx;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 200 - 0
pages/confirmorder/confirmorder.vue

@@ -0,0 +1,200 @@
+<template>
+	<view class="pages">
+		<view class="content-wrap">
+			<view class="select-bar" @click="getAddrs">
+				<svg class="icon select-bar-icon" aria-hidden="true">
+					<use xlink:href="#icondizhi1"></use>
+				</svg>
+				<!-- <view class="select-bar-text">请选择收货信息</view> -->
+				<view class="select-bar-text">
+					<picker mode="selector" @change="bindPickerChange" :value="index" :range="addrsList" :range-key="'detailAddress'">
+						<view class="uni-input">{{theAddr}}</view>
+					</picker>
+				</view>
+				<view class="select-bar-arrow"></view>
+			</view>
+			<view class="bill-info">
+				<view class="bill-product">
+					<view class="bill-product-imgwrap">
+						<image :src="billData.productImg" class="bill-product-img" mode="aspectFill"></image>
+					</view>
+					<view class="bill-product-info">
+						<view class="bill-product-name">{{billData.productName}}</view>
+						<view class="bill-product-price-wrap">
+							<view class="left">
+								¥
+								<text class="bill-product-price">{{billData.productPrice}}</text>
+								<text class="bill-product-unit" v-if="billData.productUnit">/{{billData.productUnit}}</text>								
+							</view>
+							<view class="bill-product-number">
+								X {{billData.bayNum}}
+							</view>
+						</view>
+					</view>
+				</view>
+				<!-- bill-product end -->
+				<view class="form-item">
+					<view class="form-item-til">商品总额</view>
+					<view class="form-item-con amount">
+						¥ {{ billData.productPrice*billData.bayNum }}
+					</view>
+				</view>
+				<view class="form-item">
+					<view class="form-item-til">配送方式</view>
+					<view class="form-item-con">
+						普通快递
+					</view>
+				</view>
+				<view class="form-item">
+					<view class="form-item-til">运费</view>
+					<view class="form-item-con">
+						¥ 0
+					</view>
+				</view>
+			</view>
+			<!-- bill-info end -->
+			<view class="bottom-btn-wrap">
+				<view class="bottom-btn" @click="submit">确认购买</view>
+			</view>
+		</view>
+		<!-- content-wrap end -->
+	</view>
+</template>
+
+<script>
+	import {bus} from "../../utils/bus.js";
+	export default {
+		data() {
+			return {
+				token:'',
+				params:{},
+				billData:null,
+				addrsList:[],
+				index:0,
+				theAddr:'请选择收货地址',
+				memberReceiveAddressId:'',
+			}
+		},
+		onShow() {
+			
+		},
+		onLoad() {
+			let self = this;
+			if(Object.keys(bus.data).length>0){
+				this.billData = bus.data;
+				// console.log('bus.data',bus.data);
+			};
+			uni.getStorage({
+				key:'token',
+				success: function (res) {
+					self.token = res.data;
+				   // console.log(self.token);
+				}
+			});			
+			this.getAddrs();
+		},
+		methods: {
+			submit(){
+				let param = {productId:this.billData.productId,bayNum:this.billData.bayNum,memberReceiveAddressId:this.memberReceiveAddressId};
+				this.$api.http.post(this.config.apiBaseurl + '/order/insert',param,{
+					header: {
+					Accept:'application/json',
+					Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+				},
+				}).then(res => {
+					// console.log('res',res);
+					if(res.data.code == 200 ){
+						this.pay(res.data.data.order.id,res.data.data.order.payType)
+					}else{
+						uni.showToast({
+							icon:"none",
+							title:res.data.message,
+							duration: 2000
+						});
+					}
+				}).catch(err =>{
+					console.log('err',err)
+				});
+				console.log('param',param);
+			},
+			pay(orderId,payType){
+				
+				let userInfo = uni.getStorageSync("userInfo");
+					let params = {
+						orderId:orderId,
+						payType:payType,
+						openid:userInfo.wxUsers.openid,
+						"tradeType":"test"
+					}
+					this.$pay.wxPay(params).then(res =>{
+						console.log('payres',res);
+						if(res.code == 0){
+							uni.reLaunch({
+								url: '/pages/buySuccess/buySuccess?orderId=' + params.orderId
+							})
+						}else if(res.code == 1){
+							uni.navigateTo({
+								url: '/pages/userCenter/myOrder/myOrder'
+							})
+						}else if(res.code == 2){
+							this.$api.msg("支付失败,请检查!")
+							setTimeout(()=>{
+								uni.navigateTo({
+									url: '/pages/userCenter/myOrder/myOrder'
+								});
+							},1000)
+						}else{
+							uni.showToast({
+								icon:"none",
+								title:res.data.message,
+								duration: 2000
+							});							
+						}
+					});
+				
+				// let param = {orderId:orderId,payType:payType};
+				// this.$api.http.post(this.config.apiBaseurl + '/order/paySuccess',param,{
+				// 	header: {
+				// 	Accept:'application/json',
+				// 	Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+				// },
+				// }).then(res => {
+				// 	console.log('res',res);
+				// 	if(res.data.code == 200 ){
+						
+				// 	}
+				// }).catch(err =>{
+				// 	console.log('err',err)
+				// });				
+			},
+			getAddrs(){
+				// console.log('this.token',this.token);
+				let thetoken = 'Bearer ' + this.token;
+				this.$api.http.get(this.config.apiBaseurl + '/member/address/list',{header: {Authorization:thetoken}}).then(res => {
+					console.log('getAddrList', res.data.data);
+					this.addrsList = res.data.data;
+					if(res.data.data.length>0){
+						this.memberReceiveAddressId = res.data.data[0].id;
+						this.theAddr = res.data.data[0].detailAddress;
+						console.log('this.memberReceiveAddressId',this.memberReceiveAddressId);
+					}else{
+						this.theAddr = '您还没有设置收货地址,请到个人中心页面设置!';
+					}
+				}).catch(err => {
+					// console.log('err', err)
+				})
+			},
+			bindPickerChange(e){				
+				console.log(this.addrsList[e.target.value]);
+				this.memberReceiveAddressId = this.addrsList[e.target.value].id;
+				this.theAddr = this.addrsList[e.target.value].detailAddress;
+				console.log('this.memberReceiveAddressId',this.memberReceiveAddressId);
+			}
+
+		}
+	}
+</script>
+
+<style scoped>
+	@import url("./confirmorder.css");
+</style>

+ 45 - 0
pages/product/modal/quickBuy.css

@@ -0,0 +1,45 @@
+.randomPop >>> .uni-popup__wrapper-box{flex: 1;width:750rpx;}
+.popup-content{background-color: #fff;padding: 24rpx 30rpx;}
+.bottom .popup-content{border-bottom-left-radius: 0;border-bottom-right-radius: 0;}
+
+.product{display: flex;margin-bottom: 24rpx;}
+.product-img-wrap{width: 260rpx;height: 260rpx;overflow: hidden;display: flex;align-items: center;border-radius: 16rpx;border: 1px solid #979797;position: absolute;top: -79rpx;background-color: #fff;}
+.product-img-wrap .product-img{width: 100%;height: 100%;}
+.product-info{margin-left: 284rpx;}
+.product-info-name{font-size: 32rpx;color: #333;line-height: 45rpx;font-weight: bold;margin-bottom: 8rpx;min-height: 99rpx;margin-bottom: 24rpx;}
+.product-info-price-wrap{font-size: 28rpx;color: #FF5030;}
+.product-info-price{font-size: 36rpx;font-weight: bold;margin-left: 10rpx;line-height: 50rpx;}
+.product-info-unit{font-size: 24rpx;color: #999;}
+
+.nums{}
+.nums-til{font-size: 26rpx;color: #333;line-height: 37rpx;margin-bottom: 24rpx;}
+.nums .countNum{display:flex;width:221rpx;height:64rpx;border:1px solid #E5E5E5;}
+.nums .countNum .countNum-action{width:230rpx;height:100%;line-height:64rpx;color:#65B74E;text-align:center;}
+.nums .countNum .reduce{border-right:1px solid #E5E5E5;}
+.nums .countNum .add{border-left:1px solid #E5E5E5;}
+.nums .countNum .countNum-input .uni-input{height:100%;text-align:center;}
+
+.buy-btn{height: 98rpx;line-height: 98rpx;background-color: #6BBC6D;color: #fff;text-align: center;border-radius: 8rpx;margin-top: 140rpx;font-size: 36rpx;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 117 - 0
pages/product/modal/quickBuy.vue

@@ -0,0 +1,117 @@
+<template>
+	<uni-popup ref="randomPop" type="bottom" class="randomPop">
+		<view class="popup-content">
+			<view class="product">
+				<view class="product-img-wrap">
+					<image :src="pData.product.pic" class="product-img" mode="widthFix"></image>
+				</view>
+				<view class="product-info">
+					<view class="product-info-name">
+						{{pData.product.name}}
+					</view>
+					<view class="product-info-price-wrap">
+						¥<text class="product-info-price">{{pData.product.price}}</text>
+						<text class="product-info-unit" v-if="pData.product.unit">/{{pData.product.unit}}</text>
+					</view>
+				</view>
+			</view>
+			<view class="nums">
+				<view class="nums-til">数量</view>
+				 <view class="countNum">
+					 <view class="countNum-action reduce" @click="calcValue('reduce',total)">-</view>
+					 <view class="countNum-input">
+						 <input class="uni-input" v-model="total" type="number" @blur="onInput(total)"/>
+					 </view>
+					 <view class="countNum-action add" @click="calcValue('add',total)">+</view>
+				 </view>
+			</view>
+			<view class="buy-btn" @click="submit">立即购买</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script>
+	// import { mapMutations } from 'vuex';
+	import { debounce } from '@/utils/util.js'
+	// import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue"
+	import uniPopup from '@/components/uni-popup/uni-popup.vue'
+	import { bus } from '../../../utils/bus.js';
+	export default{
+		name:'quickBuy',
+		components:{
+			uniPopup,
+		},
+		created(){
+			console.log(this.pData);
+		},
+		props:{
+			visible: {
+				type: Boolean,
+				default: false
+			},
+			pData: {
+				type: Object,
+				default: []
+			}
+		},	
+		data(){
+			return{
+				loading:false,
+				loadStatus:'loading',
+				min:1,
+				total:1,
+
+			}
+		},
+		methods:{
+			openPop(){
+				this.$refs.randomPop.open();
+			},
+			closePop(){
+				Object.assign(this.$data, this.$options.data.call(this))
+				this.$refs.randomPop.close()
+				this.$emit('closeModal',true)
+			},
+			onInput(total){
+				console.log(this.total)
+				if(!(/(^[1-9]\d*$)/.test(this.total))){
+					this.total = 1
+					if(this.total < this.min){
+						this.total = 1
+					}
+				}
+			},
+			//数量计算
+			calcValue(type,total){
+				if (type === "reduce") {
+					this.total-- 
+					if (total <= this.min) {
+						this.total = 1
+					}
+				} else if (type === "add") {
+					this.total++;
+				}
+			},
+			submit(){
+				this.$emit('closeModal',true)
+				bus.$emit('toDetailPage', {
+					data: {
+						productId:this.pData.product.id,
+						bayNum:this.total,
+						productName:this.pData.product.name,
+						productPrice:this.pData.product.price,
+						productImg:this.pData.product.pic,
+						productUnit:this.pData.product.unit,
+					}
+				});				
+				uni.navigateTo({
+					url: '/pages/confirmorder/confirmorder',
+				});
+			}
+		},
+	}
+</script>
+
+<style scoped>
+	@import url("./quickBuy.css");
+</style>

+ 2 - 1
pages/product/product.css

@@ -36,7 +36,8 @@
 .safe-icon{width: 36rpx;height: 36rpx;margin-right: 10rpx;display: inline-block;vertical-align: -10rpx;}
 .safe-icon-img{width: 100%;height: 100%;}
 
-
+.bottom-flex-btn{border: 0;}
+.bottom-flex-btn::after{border: 0;}
 
 
 

+ 29 - 1
pages/product/product.vue

@@ -86,6 +86,7 @@
 		<view class="bottom-flex-btn-wrap">
 			<view class="bottom-flex-btn-content">
 				<button type="default" :disabled="isPred==0?false:true"  class="bottom-flex-btn" @click="focuse(params.productid)">有意向</button>
+				<button type="default" class="bottom-flex-btn" @click="buy(params.productid)">购买</button>
 				<button type="default" class="bottom-flex-btn primary" @click="callnumber(phoneNumber)">打电话</button>
 			</view>			
 		</view>
@@ -93,16 +94,19 @@
 		<uni-popup ref="popup" type="dialog">
 		    <uni-popup-dialog type="info"  content="还未绑定手机号码,是否去绑定?" :duration="2000" :before-close="true" @close="closepopup" @confirm="confirmpopup"></uni-popup-dialog>
 		</uni-popup>
+		<quick-buy class="quickbuy" :pData="this.productresult" ref="quickBuy" @closeModal="closeModal" v-if="modal.visibleModal"></quick-buy>
 	</view>
 </template>
 
 <script>
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
+	import quickBuy from './modal/quickBuy';
 	export default {
 		components: {
 			uniPopup,
-			uniPopupDialog
+			uniPopupDialog,
+			quickBuy,
 		},
 		data() {
 			return {
@@ -130,6 +134,9 @@
 				firstimg:'',
 				files:[],
 				thispage:'',
+				modal: {
+					visibleModal: false
+				},
 				
 				
 			}
@@ -254,6 +261,10 @@
 					url:`/pages/supplier/supplierdetail/supplierdetail?id=${id}`
 				})
 			},
+			closeModal(){
+				console.log('111111');
+				this.modal.visibleModal = false;
+			},
 			closepopup(done){
 				done()
 			},
@@ -263,6 +274,23 @@
 				});
 				done()
 			},
+			buy(item){
+				console.log('item',item);
+				if(!this.product.price){
+					uni.showToast({
+						icon:'none',
+						mask:true,
+						title:`暂时无法购买`,
+						duration: 2000
+					});
+					return false;
+				};
+				this.modal.visibleModal = true;
+				this.$nextTick(res => {
+					this.$refs.quickBuy.openPop();
+				});
+				
+			}
 
 		}
 	}

+ 1 - 1
pages/publish/publish.css

@@ -16,7 +16,7 @@
 .form-item-chooseIMGs-wrap .img-item{position: relative;}
 .form-item-chooseIMGs-wrap .img-item icon{position: absolute;right: 0;top: 0;border-radius: 50%;background-color: #fff;z-index: 10;}
 
-.form-item.required::before{content: '*';position: absolute;left: -15rpx;top: 50%;line-height: 1;margin-top: -12rpx;color: red;}
+
 
 
 

+ 18 - 0
pages/usercenter/addrs/addrs.css

@@ -0,0 +1,18 @@
+page{background: #FBFBFC;}
+.uni-popup{z-index: 999;}
+.addrs-item{display: flex;padding: 24rpx 0 24rpx 24rpx;box-sizing: border-box;min-height: 178rpx;background-color: #fff;margin-bottom: 8rpx;}
+.addrs-item-content{flex: 1;}
+.addrs-item-icon-wrap{width: 104rpx;display: flex;align-items: center;color: #3cc51f;justify-content: center;}
+.addrs-item-upwrap{display: flex;justify-content: space-between;font-size: 34rpx;color: #333;line-height: 48rpx;margin-bottom: 8rpx;}
+.addrs-item-addr{color: #999;font-size: 26rpx;line-height: 37rpx;}
+.form-item{padding-left: 24rpx;}
+.form-item.save-addr{padding: 0;margin: 0;}
+.save-addr .form-item-til{text-align: center;width: 100%;padding: 0;background-color: #3cc51f;color: #fff;height: 96rpx;line-height: 96rpx;}
+.addrs-item.default{background-color: #E9F8D9;}
+
+
+
+
+.new-btn-wrap{background-color: #fff;margin-top: 24rpx;}
+.new-btn{background-color: #fff;border: 0;height: 96rpx;line-height: 96rpx;font-size: 34rpx;color: #6BBC6D;text-align: center;position: relative;}
+.new-btn::after{border: 0;content: '';width: calc( 100% - 24rpx );height: 1px;position: absolute;right: 0;bottom: 0;background-color: #eee;}

+ 377 - 0
pages/usercenter/addrs/addrs.vue

@@ -0,0 +1,377 @@
+<template>
+	<view class="pages">
+		<view class="addrs">
+			<view class="addrs-item" :class="item.defaultStatus==1?'default':''" v-for="(item,index) in addrsList" :key="index" @click="editAddr(item)">
+				<view class="addrs-item-content">
+					<view class="addrs-item-upwrap">
+						<view class="addrs-item-name">收货人:{{item.name}}</view>
+						<view class="addrs-item-phoneNumber">{{item.phoneNumber}}</view>
+					</view>
+					<view class="addrs-item-addr">收货地址:{{item.province}}{{item.city}}{{item.region}}{{item.detailAddress}}</view>
+				</view>
+				<view class="addrs-item-icon-wrap">
+					<text class="iconfont iconGroup" v-if="item.defaultStatus == 1"></text>
+				</view>
+			</view>
+		</view>
+		<view class="new-btn-wrap">
+			<view class="new-btn" @click="newAddr">添加新地址</view>
+		</view>
+		<!-- 地址编辑 -->
+		<view class="newaddr-page fix-content translate" :class="{ 'open': fixPageOpen }">
+			<view class="fix-content-nav"><text @click="closeFixPage" class="iconfont iconhoutui"></text></view>
+
+			<view class="form-item required">
+				<view class="form-item-til">所在省</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请选择/输入" v-model="params.province" value="" />
+				</view>
+			</view>
+			<view class="form-item required">
+				<view class="form-item-til">所在市</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请选择/输入" v-model="params.city" value="" />
+				</view>
+			</view>
+			<view class="form-item required">
+				<view class="form-item-til">所在地区</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请选择/输入" v-model="params.region" value="" />
+				</view>
+			</view>
+			<view class="form-item required">
+				<view class="form-item-til">详细地址</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请输入详细地址" v-model="params.detailAddress" value="" />
+				</view>
+			</view>
+			<view class="form-item required">
+				<view class="form-item-til">联系人</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请输入联系人" v-model="params.name" value="" />
+				</view>
+			</view>
+			<view class="form-item required">
+				<view class="form-item-til">联系电话</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请输入联系电话" v-model="params.phoneNumber" value="" />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="form-item-til">邮政编码</view>
+				<view class="form-item-con">
+					<input type="text" placeholder="请输入邮政编码" v-model="params.postCode" value="" />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="form-item-til">设为收货地址</view>
+				<view class="form-item-con" style="min-width: auto;">
+					<switch :checked="params.defaultStatus==1?true:false" @change="switchDefaultStatus" />
+				</view>
+			</view>
+			<view class="form-item" v-if="isedit">
+				<view class="form-item-til" style="color: red;" @click="delAddr">删除收货地址</view>
+			</view>
+			<view class="form-item save-addr">
+				<view class="form-item-til" @click="saveAddr">保存收货地址</view>
+			</view>
+
+			<baidu-map class="map" :center="center" :zoom="zoom" @ready="handlermap" :scroll-wheel-zoom="true" @click="clickEvent"
+			 ak="BSf4i2bljmxl8R0x28cjOy8KMVrCVzev">
+				<!-- 地图控件位置 -->
+				<bm-navigation anchor="BMAP_ANCHOR_TOP_RIGHT"></bm-navigation>
+				<!-- 获取城市列表 -->
+				<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT"></bm-city-list>
+				<!-- 定位当前位置 -->
+				<bm-geolocation anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :showAddressBar="true" :autoLocation="true" @locationSuccess="getLoctionSuccess"></bm-geolocation>
+				<!-- 地图容器 -->
+				<bm-view :style="{width:'100%',height: '400px'}"></bm-view>
+			</baidu-map>
+
+		</view>
+		<!-- 地址编辑 -->
+		<uni-popup ref="popup" type="dialog">
+		    <uni-popup-dialog type="info"  content="确认删除此地址吗?" :duration="2000" :before-close="true" @close="closepopup" @confirm="confirmpopup"></uni-popup-dialog>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		BaiduMap,
+		BmNavigation,
+		BmView,
+		BmGeolocation,
+		BmCityList
+	} from 'vue-baidu-map';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
+	const defaultparams= {
+		token: '',
+		name: '',
+		phoneNumber: "",
+		defaultStatus: "0",
+		postCode: "",
+		province: "",
+		city: "",
+		region: "",
+		detailAddress: "",
+		latitude: '',
+		longitude: ''
+	};
+	export default {
+		components: {
+			BaiduMap,
+			BmNavigation,
+			BmView,
+			BmGeolocation,
+			BmCityList,
+			uniPopup,
+			uniPopupDialog,
+		},
+		data() {
+			return {
+				isedit: false,
+				addrsList: [],
+				token:'',
+				params: Object.assign({},defaultparams),
+				ruleItems:{
+					name: '',
+					phoneNumber: "",
+					province: "",
+					city: "",
+					region: "",
+					detailAddress: "",					
+				},
+				rules: {
+					name: {rule: /^[\u4E00-\u9FA5]{2,4}$/,msg: "姓名2到4位汉字"},
+					province: {rule: /\S/,msg: "请填写必要内容"},
+					city: {rule: /\S/,msg: "请填写必要内容"},
+					region: {rule: /\S/,msg: "请填写必要内容"},
+					detailAddress: {rule: /\S/,msg: "请填写必要内容"},
+					phoneNumber: {rule: /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/,msg: "请填写正确手机号"},
+				},
+				fixPageOpen: false,
+				center: {
+					lng: 106.632713,
+					lat: 26.653157
+				},
+				zoom: 12,
+			}
+		},
+		onShow() {
+			let serf = this;
+			this.getAddrList();
+
+		},
+		onLoad() {
+			let self = this;
+			uni.getStorage({
+				key:'token',
+				success: function (res) {
+					self.token = res.data;
+				   // console.log(res.data);
+				}
+			});
+			
+
+		},
+		methods: {
+			getAddrList() {
+				let thetoken = 'Bearer ' + this.token;
+				this.$api.http.get(this.config.apiBaseurl + '/member/address/list',{header: {Authorization:thetoken}}).then(res => {
+					console.log('getAddrList', res);
+					this.addrsList = res.data.data;					
+					if(this.addrsList.length == 1 && this.addrsList[0].defaultStatus!=1){
+						console.log('getAddrListlength', this.addrsList[0]);
+						// setTimeout(function(){console.log(this)},5000);
+						setTimeout(this.setDefault(this.addrsList[0].id),1000);
+						// this.setDefault(this.addrsList[0].id);
+					}
+				}).catch(err => {
+					// console.log('err', err)
+				})
+			},
+			newAddr() {
+				this.fixPageOpen = true;
+			},
+			closeFixPage(){
+				this.fixPageOpen = false;
+				this.params = Object.assign({},defaultparams);
+				this.isedit = false;
+				this.getAddrList();
+				
+			},
+			//是否默认
+			switchDefaultStatus(e) {
+				if (e.target.value) {
+					this.params.defaultStatus = 1;
+				} else {
+					this.params.defaultStatus = 0;
+				}
+				// console.log('this.params',this.params);
+			},
+			editAddr(item){
+				this.isedit = true;
+				this.params = Object.assign(this.params,item);
+				this.fixPageOpen = true;
+			},
+			saveAddr(){
+				console.log(this.isedit);				
+				for (let x in this.ruleItems) {
+					// console.log('x',x)
+					if(!this.validate(x)) return;
+				}
+				console.log('this.params',this.params);
+				// var saveApi;
+				if(this.isedit){
+					// saveApi = this.config.apiBaseurl + '/member/address/update';
+					// console.log(this.params);
+					this.$api.http.put(this.config.apiBaseurl + '/member/address/update/'+this.params.id,this.params,{
+						header: {
+						Accept:'application/json',
+						Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+					},
+					}).then(res => {
+						this.closeFixPage();
+						// console.log('res',res)
+					}).catch(err =>{
+						console.log('err',err)
+					});
+				}else{
+					// saveApi = this.config.apiBaseurl + '/member/address/add';
+					if(this.addrsList.length == 0 ){this.params.defaultStatus = 1}
+					this.$api.http.post(this.config.apiBaseurl + '/member/address/add',this.params,{
+						header: {
+						Accept:'application/json',
+						Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+					},
+					}).then(res => {
+						this.closeFixPage();
+						// console.log('res',res)
+					}).catch(err =>{
+						console.log('err',err)
+					});
+				}
+				
+			},
+			closepopup(done){
+				done()
+			},
+			confirmpopup(done,value){
+				this.$api.http.delete(this.config.apiBaseurl + '/member/address/delete/'+this.params.id,{},{
+					header: {
+					Accept:'application/json',
+					Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+				},
+				}).then(res => {					
+					this.closeFixPage();					
+					// console.log('res',res)
+				}).catch(err =>{
+					console.log('err',err)
+				});	
+				done()
+			},
+			delAddr(item){
+				this.$refs.popup.open();
+			},
+			setDefault(id){
+				this.$api.http.put(this.config.apiBaseurl + '/member/address/default/'+id,{},{
+					header: {
+					Accept:'application/json',
+					Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+				},
+				}).then(res => {
+					// this.closeFixPage();
+					console.log('res',res)
+				}).catch(err =>{
+					console.log('err',err)
+				});				
+			},
+			//判断验证是否符合要求
+			validate(key) {
+				let bool = true;
+				if (!this.rules[key].rule.test(this.params[key])) {
+					//提示信息
+					uni.showToast({
+						title: this.rules[key].msg,
+					})
+					//取反
+					bool = false;
+					return false;
+				}
+				return bool;
+			},
+			handlermap({
+				BMap,
+				map
+			}) {
+				let _this = this;
+				var geolocation = new BMap.Geolocation();
+				geolocation.getCurrentPosition(function(r) {
+					// console.log(r);
+					_this.center = {
+						lng: r.longitude,
+						lat: r.latitude
+					}; // 设置center属性值
+					// console.log('_this.center',_this.params);
+					if (_this.params.latitude && _this.params.longitude) {
+						let transqq = qqMapTransBMap(_this.params.longitude, _this.params.latitude);
+						// console.log('transqq',transqq);
+						_this.center = {
+							lng: transqq.lng,
+							lat: transqq.lat
+						};
+					};
+					let Icon_0 = new BMap.Icon("static/img/zuobiao.gif", new BMap.Size(64, 64), {
+						anchor: new BMap.Size(18, 32),
+						imageSize: new BMap.Size(36, 36)
+					});
+					let myMarker = new BMap.Marker(new BMap.Point(_this.params.longitude, _this.params.latitude), {
+						icon: Icon_0
+					});
+					// map.addOverlay(myMarker);
+					_this.autoLocationPoint = {
+						lng: r.longitude,
+						lat: r.latitude
+					}; // 自定义覆盖物
+					_this.initLocation = true;
+				}, {
+					enableHighAccuracy: true
+				})
+				window.map = map;
+			},
+			//点击地图监听
+			clickEvent(e) {
+				map.clearOverlays();
+				let Icon_0 = new BMap.Icon("static/img/zuobiao.gif", new BMap.Size(64, 64), {
+					anchor: new BMap.Size(18, 32),
+					imageSize: new BMap.Size(36, 36)
+				});
+				var myMarker = new BMap.Marker(new BMap.Point(e.point.lng, e.point.lat), {
+					icon: Icon_0
+				});
+				map.addOverlay(myMarker);
+				//用所定位的经纬度查找所在地省市街道等信息
+				var point = new BMap.Point(e.point.lng, e.point.lat);
+				var gc = new BMap.Geocoder();
+				let _this = this;
+				gc.getLocation(point, function(rs) {
+					var addComp = rs.addressComponents;
+					console.log(rs); //地址信息
+					_this.params.province = rs.addressComponents.province;
+					_this.params.city = rs.addressComponents.city;
+					_this.params.region = rs.addressComponents.district;
+					// _this.params.detailAddress = rs.address;
+				});
+				//转为高德坐标
+				// let transGaode = bMapTransQQMap(e.point.lng, e.point.lat);
+			},
+
+		}
+	}
+</script>
+
+<style scoped>
+	@import url("./addrs.css");
+</style>

+ 1 - 1
pages/usercenter/myfocus/myfocus.vue

@@ -6,7 +6,7 @@
 					<view v-for="(item,index) in productlist" :key="index" class="product-item">
 						<!-- <uni-swipe-action-item :right-options="swipeOptions" @click="delItem(item.id)" @change="changeSwipe"> -->
 							<view class="product-item-img-wrap" @click="productclick(item.pmsProduct.id)">
-								<image class="product-item-img" :src="$getimg+item.pmsProduct.pic" mode="aspectFit"></image>
+								<image class="product-item-img" :src="$getimg+item.pmsProduct.pic|miniImg(50)" mode="aspectFit"></image>
 							</view>
 							<view class="product-item-info" @click="productclick(item.pmsProduct.id)">
 								<view class="product-item-til">{{item.productName}}</view>

+ 42 - 0
pages/usercenter/myorder/myorder.css

@@ -0,0 +1,42 @@
+page{background-color: #FBFBFC;}
+
+.status-bar{display: flex;border-bottom: 1px solid #ddd;}
+.status-bar-item{flex: 1;text-align: center;font-size: 24rpx;padding: 24rpx 0;}
+.status-bar-item.active{color: #FF5030;}
+
+.order{padding: 24rpx;}
+.order-item{margin-bottom: 24rpx;padding: 24rpx;background-color: #fff;}
+.order-item .status{margin-bottom: 24rpx;text-align: right;color: #FF5030;font-size: 26rpx;}
+.order-info{display: flex;align-items: center;padding-bottom: 24rpx;}
+.order-info-imgwrap{margin-right: 24rpx;width: 160rpx;height: 160rpx;overflow: hidden;text-align: center;}
+.order-info-img{width: 100%;height: 100%;}
+.order-info-text{flex: 1;}
+.order-info-title{font-size: 30rpx;color: #333;line-height: 42rpx;margin-bottom: 20rpx;}
+.order-info-num{display: flex;justify-content: flex-end;color: #999;}
+.order-info-bynum{margin-right: 24rpx;}
+.order-info-bynum .bynum{margin-left: 12rpx;line-height: 50rpx;}
+.order-info-amount .rmb{margin-left: 12rpx;font-size: 28rpx;color: #FF5030;line-height: 40rpx;}
+.order-info-amount .amount{margin-left: 8rpx;font-size: 36rpx;color: #FF5030;font-weight: bold;}
+.order-tool{display: flex;justify-content: flex-end;padding-top: 24rpx;border-top: 1px solid #eee;}
+.order-tool .btn{width: 160rpx;height: 60rpx;line-height: 60rpx;font-size: 26rpx;color: #333;margin-right: 0;margin-left: 24rpx;background-color: #fff;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 243 - 0
pages/usercenter/myorder/myorder.vue

@@ -0,0 +1,243 @@
+<template>
+	<view class="pages">
+		<view class="status-bar">
+			<view class="status-bar-item" :class="params.status == -1?'active':''" @click="changestatus(-1)">全部</view>
+			<view class="status-bar-item" :class="params.status == 0?'active':''" @click="changestatus(0)">待付款</view>
+			<view class="status-bar-item" :class="params.status == 1?'active':''" @click="changestatus(1)">待发货</view>
+			<view class="status-bar-item" :class="params.status == 2?'active':''" @click="changestatus(2)">已发货</view>
+			<view class="status-bar-item" :class="params.status == 3?'active':''" @click="changestatus(3)">已完成</view>
+			<view class="status-bar-item" :class="params.status == 4?'active':''" @click="changestatus(4)">已关闭</view>
+			<!-- <view class="status-bar-item" :class="params.status == 5?'active':''" @click="changestatus(5)">无效</view> -->
+		</view>
+		<mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
+			<view class="order">
+				<view v-for="(item,index) in orderlist" :key="index" class="order-item" @click="goOrderDetails(item.id)">
+					<view class="status" v-if="item.status == 0">待付款</view>
+					<view class="status" v-if="item.status == 1">待发货</view>
+					<view class="status" v-if="item.status == 2">已发货</view>
+					<view class="status" v-if="item.status == 3">已完成</view>
+					<view class="status" v-if="item.status == 4">已关闭</view>
+					<view class="status" v-if="item.status == 5">无效订单</view>
+					<view class="order-info">
+						<view class="order-info-imgwrap">
+							<image :src="item.orderItemList[0].productPic" class="order-info-img" mode="aspectFill"></image>
+						</view>
+						<view class="order-info-text">
+							<view class="order-info-title">
+								{{item.orderItemList[0].productBrand}}{{item.orderItemList[0].productName}}
+							</view>
+							<view class="order-info-num">
+								<view class="order-info-bynum">数量<text class="bynum">X{{item.orderItemList[0].productQuantity}}</text></view>
+								<view class="order-info-amount">商品总额<text class="rmb">¥</text><text class="amount">{{item.orderItemList[0].productQuantity*item.orderItemList[0].realAmount}}</text></view>
+							</view>
+						</view>
+					</view>
+					<!-- order-info end -->
+					<view class="order-tool" v-if="item.status == 0">
+						<!-- <view class="order-tool-more">
+							<svg class="icon" aria-hidden="true">
+							    <use xlink:href="#iconfengyunbang"></use>
+							</svg>
+							更多操作
+						</view> -->
+						<!-- <button type="default" class="btn" v-if="item.status != 0" @click="delOrder">删除订单</button> -->
+						<button type="default" class="btn" v-if="item.status == 0" @click.stop="cancelOrder(item)">取消订单</button>
+						<button type="default" class="btn" v-if="item.status == 0" @click.stop="pay(item)">我要付款</button>
+					</view>
+				</view>
+				<!-- order-item end -->
+			</view>
+			<!-- order end -->
+		</mescroll-body>
+		<uni-popup ref="popup" type="dialog">
+		    <uni-popup-dialog type="info"  content="确认取消此订单吗?" :duration="2000" :before-close="true" @close="closepopup" @confirm="confirmpopup"></uni-popup-dialog>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	// 引入mescroll-mixins.js
+	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";	
+	// 引入mescroll-body组件 (如已在main.js注册全局组件,则省略此步骤)
+	import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"; // 注意.vue后缀不能省
+	
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		components: {
+			MescrollBody,
+			uniPopup,
+			uniPopupDialog,
+		},
+		data() {
+			return {
+				mescroll: null, // mescroll实例对象 (此行可删,mixins已默认)
+				// 下拉刷新的配置(可选, 绝大部分情况无需配置)
+				downOption: { 
+					// ...
+				},
+				// 上拉加载的配置(可选, 绝大部分情况无需配置)
+				upOption: {
+					page: {
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 4, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						tip: '暂无相关数据'
+					}
+				},
+				tokenhead:'',
+				token:'',				
+				params:{
+					status:-1,
+					// tokenhead:'',
+					// token:'',
+				},
+				orderlist:[],
+				cancelId:null,
+				
+			}
+		},
+		onShow() {
+			let serf = this;
+			//检查登录,获取token
+			// let loginRes = this.checkLogin('/pages/index/index', '2');
+			// if(!loginRes){return false;}
+			// serf.params.token=loginRes[0];			
+		},
+		onLoad() {
+			let self = this;
+			uni.getStorage({
+				key:'token',
+				success: function (res) {
+					self.token = res.data;
+				   // console.log(res.data);
+				}
+			});
+			uni.getStorage({
+				key:'tokenhead',
+				success: function (res) {
+					self.tokenhead = res.data;
+				   // console.log(res.data);
+				}
+			});
+
+		},
+		methods: {
+			/*mescroll组件初始化的回调,可获取到mescroll对象 (此处可删,mixins已默认)*/
+			mescrollInit(mescroll) {
+				this.mescroll = mescroll;
+			},
+			/*下拉刷新的回调, 有三种处理方式:*/
+			downCallback(){			
+				// 第2种: 下拉刷新和上拉加载调同样的接口, 那么不用第1种方式, 直接mescroll.resetUpScroll()即可
+				this.mescroll.resetUpScroll(); // 重置列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
+			},
+			/*上拉加载的回调*/
+			upCallback(page) {
+				let pageNum = page.num; // 页码, 默认从1开始
+				let pageSize = page.size; // 页长, 默认每页10条
+				this.params = Object.assign(this.params,{pageNum:pageNum,pageSize:pageSize});				
+				let thetoken = this.tokenhead + this.token;
+				// console.log('thetoken',thetoken);
+				this.$api.http.get(this.config.apiBaseurl+'/order/list',{params:this.params,header: {Authorization:thetoken}}).then(data => {
+					// console.log('1111111111',data);
+					if(data.data.code=='1001'){
+						// uni.redirectTo({
+						// 	url:'/pages/login/login?backpage=/pages/index/index'+'&backtype='+2,
+						// });							
+					};
+					// console.log(data);
+					// 接口返回的当前页数据列表 (数组)
+					let curPageData = data.data.data.list; 
+					// console.log('curPageData',curPageData);
+					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+					let curPageLen = curPageData.length; 
+					// 接口返回的总页数 (如列表有26个数据,每页10条,共3页; 则totalPage=3)
+					// let totalPage = data.xxx; 
+					// 接口返回的总数据量(如列表有26个数据,每页10条,共3页; 则totalSize=26)
+					let totalSize = data.data.data.total; 
+					// this.mescrollList = curPageData;
+					// 接口返回的是否有下一页 (true/false)
+					// let hasNext = data.xxx; 
+					
+					//设置列表数据
+					if(page.num == 1) this.orderlist = []; //如果是第一页需手动置空列表
+					this.orderlist = this.orderlist.concat(curPageData); //追加新数据
+					// console.log('page.num',page.num);
+					console.log('this.orderlist',JSON.parse(JSON.stringify(this.orderlist)));
+					
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					this.mescroll.endBySize(curPageLen, totalSize); 
+			
+					// setTimeout(()=>{
+					// 	this.mescroll.endSuccess(curPageLen)
+					// },20)
+				
+				}).catch(err => {
+					this.mescroll.endErr()
+					console.log(err)
+				
+				});
+			},
+			//删除订单
+			delOrder(item){
+				
+			},
+			cancelOrder(item){
+				console.log(JSON.parse(JSON.stringify(item)));
+				this.cancelId = item.id;
+				this.$refs.popup.open();
+				
+			},
+			closepopup(done){
+				done()
+			},
+			confirmpopup(done,value){
+				this.$api.http.post(this.config.apiBaseurl + '/order/cancelUserOrder/?orderId='+this.cancelId,{},{
+					header: {
+					Accept:'application/json',
+					Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+				},
+				}).then(res => {
+					this.downCallback();
+					// console.log('res',res)
+				}).catch(err =>{
+					console.log('err',err)
+				});
+				done()
+			},
+			changestatus(status){
+				this.params.status  = status;
+				this.downCallback();
+			},
+			goOrderDetails(id){
+				console.log(id)
+				uni.navigateTo({
+					url: './orderdetails/orderdetails?orderid=' + id,
+				});
+			},
+			pay(item){
+				let userInfo = uni.getStorageSync("userInfo");
+					let params = {
+						orderId:item.id,
+						payType:item.payType,
+						openid:userInfo.wxUsers.openid,
+						"tradeType":"test"
+					}
+					this.$pay.wxPay(params).then(res =>{
+						this.downCallback();
+						// console.log('payres',res);
+					}).catch(err =>{console.log('err',err);});
+			},
+			
+			
+
+		}
+	}
+</script>
+
+<style scoped>
+@import url("./myorder.css");
+</style>

+ 47 - 0
pages/usercenter/myorder/orderdetails/orderdetails.css

@@ -0,0 +1,47 @@
+page{background-color: #FBFBFC;}
+.status-wrap{display: flex;align-items: center;background-color: #fff;padding: 31rpx 33rpx 31rpx 24rpx;}
+.status-til{margin-right: 24rpx;font-size: 34rpx;color: #FF5030;font-weight: bold;}
+.status-con{width: 420rpx;text-align: right;font-size: 26rpx;color: #999;line-height: 37rpx;margin-right: 24rpx;}
+.status-icon{text-align: left;transform: rotate(180deg);}
+.status-icon .iconfont{color: #ccc;font-size: 34rpx;}
+.status-common{height: 136rpx;line-height: 136rpx;border-radius: 16rpx;background-color: #fff;font-size: 34rpx;color: #FF5030;font-weight: bold;text-align: center;}
+.status-common.delivery-company{height: auto;line-height: 1;padding: 40rpx 0;}
+.status-common.delivery-company .company{margin-top: 24rpx;}
+
+.addr{background-color: #fff;padding: 24rpx;margin: 24rpx -24rpx;padding-right: 104rpx;}
+.addr-up{display: flex;margin-bottom: 8rpx;justify-content: space-between;font-size: 34rpx;color: #333;line-height: 48rpx;}
+.addr-theaddr{font-size: 26rpx;color: #999;}
+
+.order-info{background-color: #fff;padding: 24rpx;margin: 24rpx -24rpx;position: relative;}
+.order-info-til{font-size: 34rpx;color: #333;line-height:48rpx;margin-bottom: 8rpx;font-weight: bold;}
+.order-info-item{font-size: 26rpx;color: #999;line-height: 37rpx;margin-bottom: 8rpx;}
+.order-info-call{width: 160rpx;height: 60rpx;line-height: 60rpx;position: absolute;right: 24rpx;top: 18rpx;text-align: center;border: 2px solid #ddd;;background-color: #fff;border-radius: 8rpx;}
+
+.bottom-flex-btn-wrap.orderdetails .bottom-flex-btn-content{background: transparent;border: 0;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 276 - 0
pages/usercenter/myorder/orderdetails/orderdetails.vue

@@ -0,0 +1,276 @@
+<template>
+	<view class="pages page-wrap">
+		<view class="step-wrap" v-if="status == 0||status == 1||status == 2||status == 3">
+			<view class="step-item" data-text="已拍下" :class="status == 0||status == 1||status == 2||status == 3?'active':''"></view>
+			<view class="step-item" data-text="已付款" :class="status == 1||status == 2||status == 3?'active':''"></view>
+			<view class="step-item" data-text="已发货" :class="status == 2||status == 3?'active':''"></view>
+			<view class="step-item" data-text="交易成功" :class="status == 3?'active':''"></view>
+		</view>
+		<view class="status-wrap" v-if="status == 0">
+				<view class="status-til" v-if="status == 0">等待付款</view>
+				<view class="status-til" v-if="status == 1">待发货</view>
+				<view class="status-til" v-if="status == 2">已发货</view>
+				<view class="status-til" v-if="status == 3">已完成</view>
+				<view class="status-til" v-if="status == 5">无效订单</view>
+			<view class="status-con" v-if="status == 0">
+				如超时未付款,订单将 <br> 自动关闭
+			</view>
+			<view class="status-con" v-if="status == 2">
+				{{logistics}}
+			</view>
+			<view class="status-icon"><text class="iconfont iconhoutui"></text></view>
+		</view>
+		<view class="status-common" v-if="status == 1">
+			等待发货
+		</view>
+		<view class="status-common delivery-company" v-if="status == 2">
+			您的快递单号为:{{item.deliverySn}}
+			<view class="company"  @click="gocheck(item.deliverySn)">{{item.deliveryCompany}}</view>
+		</view>
+		<view class="status-common" v-if="status == 4">
+			<!-- 因交易超时,系统关闭了该笔交易 -->
+			订单已经关闭
+		</view>
+		<!-- status end -->		
+		<view class="bill-info">
+			<view class="bill-product" @click="jumpDetails(orderItemList.productId)">
+				<view class="bill-product-imgwrap">
+					<image :src="orderItemList.productPic" class="bill-product-img" mode="aspectFill"></image>
+				</view>
+				<view class="bill-product-info">
+					<view class="bill-product-name">{{orderItemList.productName}}</view>
+					<view class="bill-product-price-wrap">
+						<view class="left">
+							¥
+							<text class="bill-product-price">{{orderItemList.productPrice}}</text>
+							<text class="bill-product-unit" v-if="orderItemList.productUnit">/{{orderItemList.productUnit}}</text>								
+						</view>
+						<view class="bill-product-number">
+							X {{orderItemList.productQuantity}}
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- bill-product end -->
+			<view class="form-item">
+				<view class="form-item-til">商品总额</view>
+				<view class="form-item-con amount">
+					¥ {{ orderItemList.productPrice*orderItemList.productQuantity }}
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="form-item-til">配送方式</view>
+				<view class="form-item-con">
+					普通快递
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="form-item-til">运费</view>
+				<view class="form-item-con">
+					¥ 0
+				</view>
+			</view>
+		</view>
+		<!-- bill-info end -->
+		<view class="addr">
+			<view class="addr-up">
+				<text class="addr-name">{{ item.receiverName }}</text>
+				<text class="addr-phone">{{ item.receiverPhone }}</text>
+			</view>
+			<view class="addr-theaddr">
+				收货地址:
+				{{item.receiverProvince}}
+				{{item.receiverCity}}
+				{{item.receiverRegion}}
+				{{item.receiverDetailAddress}}
+			</view>
+		</view>
+		<!-- addr end -->
+		<view class="order-info">
+			<view class="order-info-til">订单信息</view>
+			<view class="order-info-item">订单编号:{{item.orderSn}}</view>
+			<view class="order-info-item">创建时间:{{item.createTime | formatDateTime}}</view>
+			<view class="order-info-item" v-if="item.paymentTime">支付时间:{{item.paymentTime | formatDateTime}}</view>
+			<view class="order-info-item" v-if="item.deliveryTime">发货时间:{{item.deliveryTime | formatDateTime}}</view>
+			<view class="order-info-item" v-if="item.receiveTime">确收时间:{{item.receiveTime | formatDateTime}}</view>
+			<view class="order-info-call" @click="callnumber" v-if="helpphone">联系客服</view>
+		</view>
+		<!-- order-info end -->
+		<view class="bottom-flex-btn-wrap orderdetails" v-if="status == 0">
+			<view class="bottom-flex-btn-content">
+				<button type="default" class="bottom-flex-btn" @click="cancelOrder">取消订单</button>
+				<button type="default" class="bottom-flex-btn primary" @click="pay">我要付款</button>
+			</view>	
+		</view>
+		<view class="bottom-flex-btn-wrap orderdetails" v-if="status == 2">
+			<view class="bottom-flex-btn-content">
+				<button type="default" class="bottom-flex-btn primary" @click="received">确认收货</button>
+			</view>	
+		</view>
+		<!-- bottom-flex-btn-wrap end -->
+		<uni-popup ref="popup" type="dialog">
+		    <uni-popup-dialog type="info"  :content="popupContent" :duration="2000" :before-close="true" @close="closepopup" @confirm="confirmpopup"></uni-popup-dialog>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
+	export default {
+		components: {
+			uniPopup,
+			uniPopupDialog,
+		},
+		data() {
+			return {
+				token:'',
+				tokenhead:'',
+				params: {
+					orderid:'',
+				},
+				item:{},
+				orderItemList:{},
+				status:null,
+				helpphone:null,
+				logistics:'暂时无法获取物流信息',
+				popupContent:'',
+				popupType:'',
+
+			}
+		},
+		onShow() {
+			let serf = this;
+		},
+		onLoad(option) {
+			this.params.orderid = option.orderid;
+			let self = this;
+			uni.getStorage({
+				key:'token',
+				success: function (res) {
+					self.token = res.data;
+				   // console.log(res.data);
+				}
+			});
+			uni.getStorage({
+				key:'tokenhead',
+				success: function (res) {
+					self.tokenhead = res.data;
+				   // console.log(res.data);
+				}
+			});
+			this.getdetails();
+
+		},
+		methods: {
+			getdetails(){
+				this.$api.http.get(this.config.apiBaseurl + '/order/detail/'+this.params.orderid,{
+					header: {
+					Accept:'application/json',
+					Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+				},
+				}).then(res => {
+					this.item = res.data.data;
+					this.orderItemList = res.data.data.orderItemList[0];
+					// console.log('this.orderItemList',this.orderItemList);
+					this.status = res.data.data.status;
+					// console.log('status',this.status)
+					console.log('res',JSON.parse(JSON.stringify(this.item)))
+				}).catch(err =>{
+					console.log('err',err)
+				});
+			},
+			cancelOrder(){
+				this.$refs.popup.open();
+				this.popupContent = '确认取消此订单吗?';
+				this.popupType = 'cancel';
+			},
+			received(){
+				this.$refs.popup.open();
+				this.popupContent = '确认收货?';
+				this.popupType = 'received';
+			},
+			closepopup(done){
+				done()
+			},
+			confirmpopup(done,value){
+				if(this.popupType == 'cancel'){
+					this.$api.http.post(this.config.apiBaseurl + '/order/cancelUserOrder/?orderId='+this.item.id,{},{
+						header: {
+						Accept:'application/json',
+						Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+					},
+					}).then(res => {
+						this.getdetails();
+						// console.log('res',res)
+					}).catch(err =>{
+						console.log('err',err)
+					});
+				}else if(this.popupType == 'received'){
+					this.$api.http.post(this.config.apiBaseurl + '/order/confirmReceiveOrder/?orderId='+this.item.id,{},{
+						header: {
+						Accept:'application/json',
+						Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
+					},
+					}).then(res => {
+						this.getdetails();
+						// console.log('res',res)
+					}).catch(err =>{
+						console.log('err',err)
+					});
+				}
+				
+				done()
+			},
+			pay(){
+				let userInfo = uni.getStorageSync("userInfo");
+					let params = {
+						orderId:this.item.id,
+						payType:this.item.payType,
+						openid:userInfo.wxUsers.openid,
+						"tradeType":"test"
+					}
+					this.$pay.wxPay(params).then(res =>{
+						this.getdetails();
+						// console.log('payres',res);
+					}).catch(err =>{console.log('err',err);});
+			},
+			//打电话
+			callnumber(number){
+				if(!this.helpphone){
+					uni.showToast({
+						icon:'none',
+						mask:true,
+						title:`暂时没有客服`,
+						duration: 2000
+					});
+					return;
+				};
+				uni.makePhoneCall({
+				    phoneNumber: this.helpphone 
+				});				
+			},
+			//产品跳转链接
+			jumpDetails(id){
+				uni.navigateTo({
+					url:`/pages/product/product?id=${id}`,
+					fail(err) {
+						console.log(err)
+					}
+				})				
+			},
+			// 查快递
+			gocheck(id){
+				uni.setClipboardData({
+					data: id
+				});
+				window.location.assign('https://m.kuaidi100.com/');
+			}
+
+		}
+	}
+</script>
+
+<style scoped>
+	@import url("./orderdetails.css");
+</style>

+ 18 - 0
pages/usercenter/usercenter.vue

@@ -45,6 +45,24 @@
 					<view class="select-bar-arrow"></view>
 				</view>
 			</navigator>
+			<navigator url="/pages/usercenter/myorder/myorder">
+				<view class="select-bar">
+					<svg class="icon select-bar-icon" aria-hidden="true">
+						<use xlink:href="#icondizhi"></use>
+					</svg>
+					<view class="select-bar-text">我的订单</view>
+					<view class="select-bar-arrow"></view>
+				</view>
+			</navigator>
+			<navigator url="/pages/usercenter/addrs/addrs">
+				<view class="select-bar">
+					<svg class="icon select-bar-icon" aria-hidden="true">
+						<use xlink:href="#icondizhi"></use>
+					</svg>
+					<view class="select-bar-text">收货地址</view>
+					<view class="select-bar-arrow"></view>
+				</view>
+			</navigator>
 			<navigator url="/pages/usercenter/feedback/feedback">
 				<view class="select-bar">
 					<svg class="icon select-bar-icon" aria-hidden="true">

+ 48 - 0
pay.js

@@ -0,0 +1,48 @@
+/**
+ * 订单支付
+ */
+import Vue from "vue";
+//#ifdef H5
+import $wxApi from "./wxapi.js";
+//#endif
+import Request from '@/js_sdk/luch-request/luch-request/index.js';
+const $http = new Request();
+
+import {config} from './config/config.js';
+export default {
+	//微信支付
+	wxPay(obj = {}) {
+		uni.showLoading({
+			title: '支付中'
+		});
+		return new Promise(r => {
+			let token = uni.getStorageSync("token");
+			$http.post(config.apiBaseurl + "/app/pay",obj,{
+				header: {
+					Accept:'application/json',
+					Authorization: 'Bearer '+ token, //注意Bearer后面有一空格
+				},
+			}).then(res=>{
+				console.log('res',res);
+					//#ifdef H5
+					$wxApi.JSAPI(res.data.data).then(r);
+					//#endif
+					this.payError(res);
+				})
+		});
+	},
+	//支付错误处理
+	payError(res){
+		uni.hideLoading();
+		if(res.code == 623){
+			setTimeout(i=>{
+				new Vue().$api.goto("/pages/userCenter/myorder/myorder");
+			},2000);
+			uni.showToast({
+				title:res.msg + "    即将跳转到订单页",
+				icon:"none",
+				duration:2000
+			});
+		}
+	}
+}

+ 161 - 0
static/iconfont/demo_index.html

@@ -30,6 +30,48 @@
       <div class="content unicode" style="display: block;">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+              <span class="icon iconfont">&#xe63d;</span>
+                <div class="name">后退</div>
+                <div class="code-name">&amp;#xe63d;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe662;</span>
+                <div class="name">加</div>
+                <div class="code-name">&amp;#xe662;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe663;</span>
+                <div class="name">减</div>
+                <div class="code-name">&amp;#xe663;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe65f;</span>
+                <div class="name">地质</div>
+                <div class="code-name">&amp;#xe65f;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe660;</span>
+                <div class="name">风云榜</div>
+                <div class="code-name">&amp;#xe660;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe661;</span>
+                <div class="name">更多</div>
+                <div class="code-name">&amp;#xe661;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe65e;</span>
+                <div class="name">保(3)</div>
+                <div class="code-name">&amp;#xe65e;</div>
+              </li>
+          
             <li class="dib">
               <span class="icon iconfont">&#xe65d;</span>
                 <div class="name">企业认证</div>
@@ -182,6 +224,69 @@
       <div class="content font-class">
         <ul class="icon_lists dib-box">
           
+          <li class="dib">
+            <span class="icon iconfont iconhoutui"></span>
+            <div class="name">
+              后退
+            </div>
+            <div class="code-name">.iconhoutui
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont iconjia"></span>
+            <div class="name">
+              加
+            </div>
+            <div class="code-name">.iconjia
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont iconjian"></span>
+            <div class="name">
+              减
+            </div>
+            <div class="code-name">.iconjian
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icondizhi1"></span>
+            <div class="name">
+              地质
+            </div>
+            <div class="code-name">.icondizhi1
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont iconfengyunbang"></span>
+            <div class="name">
+              风云榜
+            </div>
+            <div class="code-name">.iconfengyunbang
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icongengduo"></span>
+            <div class="name">
+              更多
+            </div>
+            <div class="code-name">.icongengduo
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont iconbao3"></span>
+            <div class="name">
+              保(3)
+            </div>
+            <div class="code-name">.iconbao3
+            </div>
+          </li>
+          
           <li class="dib">
             <span class="icon iconfont iconwodetuandui"></span>
             <div class="name">
@@ -364,6 +469,62 @@
       <div class="content symbol">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#iconhoutui"></use>
+                </svg>
+                <div class="name">后退</div>
+                <div class="code-name">#iconhoutui</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#iconjia"></use>
+                </svg>
+                <div class="name">加</div>
+                <div class="code-name">#iconjia</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#iconjian"></use>
+                </svg>
+                <div class="name">减</div>
+                <div class="code-name">#iconjian</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icondizhi1"></use>
+                </svg>
+                <div class="name">地质</div>
+                <div class="code-name">#icondizhi1</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#iconfengyunbang"></use>
+                </svg>
+                <div class="name">风云榜</div>
+                <div class="code-name">#iconfengyunbang</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icongengduo"></use>
+                </svg>
+                <div class="name">更多</div>
+                <div class="code-name">#icongengduo</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#iconbao3"></use>
+                </svg>
+                <div class="name">保(3)</div>
+                <div class="code-name">#iconbao3</div>
+            </li>
+          
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#iconwodetuandui"></use>

File diff suppressed because it is too large
+ 34 - 6
static/iconfont/iconfont.css


BIN
static/iconfont/iconfont.eot


File diff suppressed because it is too large
+ 1 - 1
static/iconfont/iconfont.js


+ 49 - 0
static/iconfont/iconfont.json

@@ -5,6 +5,55 @@
   "css_prefix_text": "icon",
   "description": "",
   "glyphs": [
+    {
+      "icon_id": "16162443",
+      "name": "后退",
+      "font_class": "houtui",
+      "unicode": "e63d",
+      "unicode_decimal": 58941
+    },
+    {
+      "icon_id": "18205013",
+      "name": "加",
+      "font_class": "jia",
+      "unicode": "e662",
+      "unicode_decimal": 58978
+    },
+    {
+      "icon_id": "18205014",
+      "name": "减",
+      "font_class": "jian",
+      "unicode": "e663",
+      "unicode_decimal": 58979
+    },
+    {
+      "icon_id": "18205009",
+      "name": "地质",
+      "font_class": "dizhi1",
+      "unicode": "e65f",
+      "unicode_decimal": 58975
+    },
+    {
+      "icon_id": "18205010",
+      "name": "风云榜",
+      "font_class": "fengyunbang",
+      "unicode": "e660",
+      "unicode_decimal": 58976
+    },
+    {
+      "icon_id": "18205011",
+      "name": "更多",
+      "font_class": "gengduo",
+      "unicode": "e661",
+      "unicode_decimal": 58977
+    },
+    {
+      "icon_id": "16978183",
+      "name": "保(3)",
+      "font_class": "bao3",
+      "unicode": "e65e",
+      "unicode_decimal": 58974
+    },
     {
       "icon_id": "16956711",
       "name": "企业认证",

File diff suppressed because it is too large
+ 21 - 0
static/iconfont/iconfont.svg


BIN
static/iconfont/iconfont.ttf


BIN
static/iconfont/iconfont.woff


BIN
static/iconfont/iconfont.woff2


BIN
static/img/zuobiao.gif


+ 42 - 0
utils/date.js

@@ -0,0 +1,42 @@
+// date.js
+export function formatDate(date, fmt) {
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+  }
+  let o = {
+    'M+': date.getMonth() + 1,
+    'd+': date.getDate(),
+    'h+': date.getHours(),
+    'm+': date.getMinutes(),
+    's+': date.getSeconds()
+  };
+  for (let k in o) {
+    if (new RegExp(`(${k})`).test(fmt)) {
+      let str = o[k] + '';
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
+    }
+  }
+  return fmt;
+}
+
+function padLeftZero(str) {
+  return ('00' + str).substr(str.length);
+}
+
+export function str2Date(dateStr, separator) {
+  if (!separator) {
+    separator = "-";
+  }
+  let dateArr = dateStr.split(separator);
+  let year = parseInt(dateArr[0]);
+  let month;
+  //处理月份为04这样的情况
+  if (dateArr[1].indexOf("0") == 0) {
+    month = parseInt(dateArr[1].substring(1));
+  } else {
+    month = parseInt(dateArr[1]);
+  }
+  let day = parseInt(dateArr[2]);
+  let date = new Date(year, month - 1, day);
+  return date;
+}

+ 40 - 0
utils/filter.js

@@ -39,3 +39,43 @@ Vue.filter("firstImg",function(arr,sizeType,imgType){
 Vue.filter("miniImg",function(img,quality){
 	return img+'?imageMogr2/quality/'+quality
 });
+
+import {formatDate} from '@/utils/date';
+Vue.filter("formatDateTime",function(time){
+	if (time == null || time === '') {
+	  return 'N/A';
+	}
+
+	//不足10 补0操作
+	var addZero=function (num) {
+	    return num < 10 ? '0' + num : num;
+	};
+	 let time1 = time.replace(/T/g, ' ');
+	 time1 = time1.replace(/\-/g, "/");
+	 console.log(time1.substring(0,19));
+	 var time2 = (new Date(time1)).getTime();
+	 console.log('a',time2);
+	  var date = new Date(time2);
+	  console.log('date',date);
+	  var Year = date.getFullYear();
+	  var Month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
+	  var d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+	  var Hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
+	  var Minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
+	  var Seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
+	  var over_time = Year + "/" + Month + "/" + d + " " + Hours + ":" + Minutes + ":" + Seconds
+	 //***至此以上是将时间转为正常时间格式,以下为将时间进行增加8小时解决时区差异的操作***
+	  var time3 = new Date(Date.parse(over_time));
+	  // time3.setTime(time3.setHours(time3.getHours()));
+	  time3.setTime(time3.setHours(time3.getHours() + 8));
+	  var Y = time3.getFullYear() + '/';
+	  var M =addZero(time3.getMonth() + 1) + '/';
+	  var D =addZero(time3.getDate()) + ' ';
+	  var h = addZero(time3.getHours()) + ':';
+	  var m =addZero(time3.getMinutes()) + ':';
+	  var s =addZero(time3.getSeconds());
+	  return (Y + M + D + " " + h + m + s) 
+
+	// return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
+});
+

+ 19 - 8
wxapi.js

@@ -2,17 +2,22 @@
 const wx = require('@/js_sdk/jweixin-1.4.0.js')
 
 //配置注册url
-const url = '/wechat/h5/getJsapiTicket';
+const url = '/app/getJsapiTicket';
 
 //http方法
 import Request from '@/js_sdk/luch-request/luch-request/index.js';
 const $http = new Request();
 
 //系统域名url
+// encodeURIComponent
 const href = location.href.split('#')[0];
-// const href = location.href.split("?")[0]
+// const href = location.href.split("?")[0];
+console.log('href',href);
 
-import { config } from './config/config'
+
+let token = uni.getStorageSync("token");
+
+import { config } from './config/config';
 
 //系统域名url
 export default {
@@ -58,21 +63,26 @@ export default {
 				"openProductSpecificView",
 				"addCard",
 				"chooseCard",
-				"openCard"
+				"openCard",
 			],
-			...(await $http.get(url,{url:href})).retBody,
+			...(await $http.get(config.apiBaseurl + url, {
+				params: {url: href},
+				header:{Accept:'application/json',
+				Authorization: 'Bearer '+ token},
+				dataType: 'json'})
+				).data.data,
 		});
 		wx.ready(e => {
 			this.isOk = true;
 			this.hideMenu();
 		});
 		wx.error(e => {
-			console.log("失败")
+			console.log("失败",e.errMsg);
 			this.isOk = false;
 		});
 	},
 	hideMenu() {
-		wx.hideAllNonBaseMenuItem();
+		// wx.hideAllNonBaseMenuItem();
 	},
 	showMenu() {
 		wx.showMenuItems({
@@ -128,10 +138,11 @@ export default {
 	JSAPI(res) {
 		return new Promise(r => {
 			wx.chooseWXPay({
+				"appId": res.appId,
 				"timestamp": res.timeStamp, //时间戳,自1970年以来的秒数     
 				"nonceStr": res.nonceStr, //随机串     
 				"package": res.packageValue,
-				"signType": res.signType, //微信签名方式:     
+				"signType": res.signType, //微信签名方式:
 				"paySign": res.paySign, //微信签名 
 				success() {
 					r({