Ver Fonte

接口对接

小欧追 há 2 anos atrás
pai
commit
31fd904b70
95 ficheiros alterados com 14237 adições e 3681 exclusões
  1. 13 4
      App.vue
  2. 12 9
      common/http.interceptor.js
  3. 51 0
      common/time.js
  4. 1 1
      common/url.js
  5. 207 151
      components/x-navbar.vue
  6. 128 10
      main.js
  7. 6 1
      manifest.json
  8. 43 3
      pages.json
  9. 396 291
      pages/fuwu/fuwu.vue
  10. 210 86
      pages/index/change-address.vue
  11. 179 77
      pages/index/daijia.vue
  12. 146 97
      pages/index/home.vue
  13. 60 14
      pages/index/index.vue
  14. 381 70
      pages/index/paotui.vue
  15. 234 45
      pages/index/weixiu.vue
  16. 41 0
      pages/index/wenzhang.vue
  17. 90 15
      pages/mine/address-list.vue
  18. 91 9
      pages/mine/address-set.vue
  19. 40 0
      pages/mine/all-tips.vue
  20. 6 1
      pages/mine/anquan.vue
  21. 132 0
      pages/mine/bangding.vue
  22. 148 47
      pages/mine/change-pwd.vue
  23. 88 29
      pages/mine/change-tel.vue
  24. 27 19
      pages/mine/forget-tel.vue
  25. 170 0
      pages/mine/forget-tel1.vue
  26. 157 102
      pages/mine/forget-wen.vue
  27. 57 21
      pages/mine/forget-wen1.vue
  28. 2 2
      pages/mine/forget.vue
  29. 775 362
      pages/mine/kaitong-fuwu.vue
  30. 127 44
      pages/mine/login-code.vue
  31. 78 21
      pages/mine/login.vue
  32. 210 94
      pages/mine/mine.vue
  33. 17 46
      pages/mine/more-fuwu.vue
  34. 84 70
      pages/mine/setting.vue
  35. 101 29
      pages/mine/tel-add.vue
  36. 62 8
      pages/mine/tel-list.vue
  37. 75 9
      pages/mine/userinfo.vue
  38. 169 110
      pages/mine/wenda-add.vue
  39. 62 8
      pages/mine/wenda-list.vue
  40. 63 0
      pages/mine/xiaoxi-info.vue
  41. 75 11
      pages/mine/xiaoxi.vue
  42. 48 5
      pages/mine/yaoqing-user.vue
  43. 26 11
      pages/mine/yaoqing.vue
  44. 348 93
      pages/order/fuwu-orderinfo.vue
  45. 66 33
      pages/order/jindu.vue
  46. 368 122
      pages/order/order-info.vue
  47. 1406 688
      pages/order/order.vue
  48. 330 84
      pages/shop/goods-info.vue
  49. 30 12
      pages/shop/myshop.vue
  50. 218 92
      pages/shop/search.vue
  51. 331 189
      pages/shop/shop-order.vue
  52. 318 196
      pages/shop/shop-orderinfo.vue
  53. 246 77
      pages/shop/shop.vue
  54. 350 158
      pages/shop/xiadan.vue
  55. BIN
      static/.DS_Store
  56. BIN
      static/images/guanggao.jpeg
  57. BIN
      static/images/mine1-1.png
  58. BIN
      static/images/order1-1.png
  59. BIN
      static/images/shop-order.png
  60. BIN
      static/images/shop1.png
  61. BIN
      static/images/userBG.png
  62. BIN
      static/images/wxpic.png
  63. BIN
      static/images/wxpic.webp
  64. BIN
      static/logo.png
  65. 18 0
      uni_modules/Sansnn-uQRCode/changelog.md
  66. 1323 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/common/uqrcode.js
  67. 241 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/bridge/bridge-weex.js
  68. 18 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/FillStyleLinearGradient.js
  69. 8 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/FillStylePattern.js
  70. 17 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/FillStyleRadialGradient.js
  71. 666 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/RenderingContext.js
  72. 11 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/ActiveInfo.js
  73. 21 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Buffer.js
  74. 21 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Framebuffer.js
  75. 298 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/GLenum.js
  76. 142 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/GLmethod.js
  77. 23 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/GLtype.js
  78. 21 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Program.js
  79. 21 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Renderbuffer.js
  80. 1191 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/RenderingContext.js
  81. 22 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Shader.js
  82. 11 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js
  83. 22 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Texture.js
  84. 22 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/UniformLocation.js
  85. 3 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/classUtils.js
  86. 74 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/env/canvas.js
  87. 96 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/env/image.js
  88. 24 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/env/tool.js
  89. 39 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/index.js
  90. 485 0
      uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue
  91. 82 0
      uni_modules/Sansnn-uQRCode/package.json
  92. 210 0
      uni_modules/Sansnn-uQRCode/readme.md
  93. 3 1
      uview-ui/components/u-calendar/u-calendar.vue
  94. 1 1
      uview-ui/components/u-column-notice/u-column-notice.vue
  95. 4 3
      uview-ui/components/u-upload/u-upload.vue

+ 13 - 4
App.vue

@@ -2,6 +2,14 @@
 	export default {
 		onLaunch: function() {
 			console.log('App Launch')
+			if (uni.getStorageSync("token")) {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+					}
+				})
+			}
 		},
 		onShow: function() {
 			console.log('App Show')
@@ -13,9 +21,10 @@
 </script>
 
 <style lang="scss">
-	/*每个页面公共css */
-	@import "uview-ui/index.scss";
-	page{
-		background-color: #E3F7F0;
+	/*每个页面公共css */
+	@import "uview-ui/index.scss";
+
+	page {
+		background-color: #E3F7F0;
 	}
 </style>

+ 12 - 9
common/http.interceptor.js

@@ -31,7 +31,9 @@ const install = (Vue, vm) => {
 		// config.header.token = getApp().globalData.username;
 
 		// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的
-		// 所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
+		// 所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
+		
+		const token = uni.getStorageSync('token');
 		if (config.method == "POST") {
 			var timestamp = parseInt(new Date().getTime() / 1000)
 			var secret_key = 'cXab5HR4pfBjdDryr2JjwbreieKVjA'
@@ -41,22 +43,23 @@ const install = (Vue, vm) => {
 				str += Key + '=' + params[Key] + '&';
 			}
 			var sign = md5Libs.md5(`${str}timestamp=${timestamp}&secret_key=${secret_key}`)
-			console.log(`${str}timestamp=${timestamp}&secret_key=${secret_key}`);
-			var phonetype = uni.getSystemInfoSync().model
+			// console.log(`${str}timestamp=${timestamp}&secret_key=${secret_key}`);
+			var phonetype = uni.getSystemInfoSync().model
 			config.data.header = config.data.header || {}
 			config.data.header.sign = sign
 			config.data.header.timestamp = timestamp
 			config.data.header.phonetype = phonetype
 			config.data.header.category = 3
 			config.data.header.secret_key = secret_key
-			config.data.header.debug = "5CDAC27A0F89C916553DE870F3C55181"//默认登录
+			// config.data.header.debug = "5CDAC27A0F89C916553DE870F3C55181"//默认登录
+			config.data.header.version_name = "beta2"//默认数据
+			config.data.header.token = token;
+			config.data = {
+				request: JSON.stringify(config.data) //config.data
+			}
 		}
-		const token = uni.getStorageSync('token');
-		config.data.header.token = token;
+		// console.log(config.data);
 		config.header.token = token;
-		config.data = {
-			request: JSON.stringify(config.data) //config.data
-		}
 		// 可以对某个url进行特别处理,此url参数为this.$u.get(url)中的url值
 		// if (config.url == '/user/login') config.header.noToken = true;
 		// 最后需要将config进行return

+ 51 - 0
common/time.js

@@ -0,0 +1,51 @@
+var time = [
+	'00:00',
+	'00:30',
+	'01:00',
+	'01:30',
+	'02:00',
+	'02:30',
+	'03:00',
+	'03:30',
+	'04:00',
+	'04:30',
+	'05:00',
+	'05:30',
+	'06:00',
+	'06:30',
+	'07:00',
+	'07:30',
+	'08:00',
+	'08:30',
+	'09:00',
+	'09:30',
+	'10:00',
+	'10:30',
+	'11:00',
+	'11:30',
+	'12:00',
+	'12:30',
+	'13:00',
+	'13:30',
+	'14:00',
+	'14:30',
+	'15:00',
+	'15:30',
+	'16:00',
+	'16:30',
+	'17:00',
+	'17:30',
+	'18:00',
+	'18:30',
+	'19:00',
+	'19:30',
+	'20:00',
+	'20:30',
+	'21:00',
+	'21:30',
+	'22:00',
+	'22:30',
+	'23:00',
+	'23:30'
+]
+export default time

+ 1 - 1
common/url.js

@@ -1,2 +1,2 @@
-var url = 'http://app.dd.ponyinfo.net/'
+var url = 'http://app.dd.ponyinfo.net'
 export default url

+ 207 - 151
components/x-navbar.vue

@@ -3,51 +3,53 @@
 		<u-navbar :background="{background:'#2AA47F'}" :is-back="false" :title="title" :borderBottom="false"
 			title-color="#fff">
 			<view class="left-box u-flex u-col-center" slot="left">
-				<image src="/static/images/index1-1.png" @tap="show = true" style="width: 47rpx;height: 43rpx;" mode=""></image>
+				<image src="/static/images/index1-1.png" @tap="openleft" style="width: 47rpx;height: 43rpx;" mode="">
+				</image>
 				<view style="width: 47rpx;height: 43rpx;position: relative;margin-right: 25rpx;" @tap="toxiaoxi">
 					<image src="/static/images/index1-2.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
-					<text
-						style="position: absolute;top: -20rpx;right: -10rpx;font-size: 22rpx;width: 30rpx;height: 30rpx;text-align: center;line-height: 30rpx;border-radius: 100rpx;color: #fff;background-color: red;">{{count}}</text>
+					<text v-if="count > 0" style="position: absolute;top: -20rpx;right: -10rpx;font-size: 22rpx;width: 30rpx;height: 30rpx;text-align: center;line-height: 30rpx;border-radius: 100rpx;color: #fff;background-color: red;">{{count > 99 ? '99+' : count}}</text>
 				</view>
-				<image src="/static/images/index1-3.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
-			</view>
+				<image @click="$opencode()" src="/static/images/index1-3.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
+			</view>
 			<slot></slot>
 		</u-navbar>
 		<u-popup v-model="show" mode="left">
-			<view class="popup-left">
-				<view :style="{height:statusheight + 'px'}"></view>
-				<view class="popup-user">
-					<image class="img-bg" src="../static/images/userBG.png" mode=""></image>
-					<image src="../static/images/mine1-2.png" class="user-code" @tap="tocode" mode=""></image>
-					<view class="user-box u-flex u-col-center">
-						<image src="../static/images/mine1-1.png" mode=""></image>
-						<text>小马哟哦难怪乎</text>
-					</view>
-				</view>
-				<view :class="active == 0 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(0)">
-					<image v-if="active == 0" src="../static/images/index.png" mode=""></image>
-					<image v-else src="../static/images/index1.png" mode=""></image>
-					<text>首页</text>
-				</view>
-				<view :class="active == 1 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(1)">
-					<image v-if="active == 1" src="../static/images/order.png" mode=""></image>
-					<image v-else src="../static/images/order1.png" mode=""></image>
-					<text>订单</text>
-				</view>
-				<view :class="active == 2 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(2)">
-					<image v-if="active == 2" src="../static/images/shop.png" mode=""></image>
-					<image v-else src="../static/images/shop.png" mode=""></image>
-					<text>商城</text>
-				</view>
-				<view :class="active == 3 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(3)">
-					<image v-if="active == 2" src="../static/images/mine.png" mode=""></image>
-					<image v-else src="../static/images/mine1.png" mode=""></image>
-					<text>我的</text>
-				</view>
-				<!-- <view class="out-login u-flex u-col-center" @tap="toout">
-					<image src="../static/images/mine1-4.png" mode=""></image>
-					<text>退出应用</text>
-				</view> -->
+			<view class="popup-left">
+				<view :style="{height:statusheight + 'px'}"></view>
+				<view class="popup-user">
+					<image class="img-bg" src="../static/images/userBG.png" mode=""></image>
+					<image src="../static/images/mine1-2.png" class="user-code" @tap="tocode" mode=""></image>
+					<view class="user-box u-flex u-col-center" @click="touser">
+						<image v-if="userdata.id && userdata.detail.headimgurl_image_src"
+							:src="userdata.detail.headimgurl_image_src" mode=""></image>
+						<image v-else src="../static/images/head-img.jpeg" mode=""></image>
+						<text>{{userdata.detail.nickname || '点击登录'}}</text>
+					</view>
+				</view>
+				<view :class="active == 0 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(0)">
+					<image v-if="active == 0" src="../static/images/index.png" mode=""></image>
+					<image v-else src="../static/images/index1.png" mode=""></image>
+					<text>首页</text>
+				</view>
+				<view :class="active == 1 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(1)">
+					<image v-if="active == 1" src="../static/images/order.png" mode=""></image>
+					<image v-else src="../static/images/order1.png" mode=""></image>
+					<text>订单</text>
+				</view>
+				<view :class="active == 2 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(2)">
+					<image v-if="active == 2" src="../static/images/shop.png" mode=""></image>
+					<image v-else src="../static/images/shop.png" mode=""></image>
+					<text>商城</text>
+				</view>
+				<view :class="active == 3 ? 'tabbar-item tabbar-item1' : 'tabbar-item'" @tap="totabbar(3)">
+					<image v-if="active == 2" src="../static/images/mine.png" mode=""></image>
+					<image v-else src="../static/images/mine1.png" mode=""></image>
+					<text>我的</text>
+				</view>
+				<!-- <view class="out-login u-flex u-col-center" @tap="toout">
+					<image src="../static/images/mine1-4.png" mode=""></image>
+					<text>退出应用</text>
+				</view> -->
 			</view>
 		</u-popup>
 	</view>
@@ -67,138 +69,192 @@
 				type: String,
 				default: ''
 			},
-			count: {
+			active: {
 				type: Number,
 				default: 0
-			},
-			active:{
-				type:Number,
-				default:0
 			}
 		},
 		data() {
 			return {
-				show:false,
-				statusheight:0
+				show: false,
+				statusheight: 0,
+				userdata: {},
+				count:0
 			}
 		},
 		created() {
 			this.statusheight = uni.getSystemInfoSync().statusBarHeight
 		},
-		methods: {
-			tocode(){
-				uni.navigateTo({
-					url:"/pages/mine/yaoqing"
-				})
-			},
-			totabbar(num){
-				this.show = false
-				if(this.active == num){
-					return
-				}
-				if(num == 0){
-					uni.switchTab({
-						url:"/pages/index/home"
-					})
-				}
-				if(num == 1){
-					uni.switchTab({
-						url:"/pages/order/order"
-					})
-				}
-				if(num == 2){
-					uni.switchTab({
-						url:"/pages/shop/shop"
+		methods: {
+			touser() {
+				this.show = false
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "/pages/mine/userinfo"
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/mine/login-code"
+					})
+				}
+			},
+			openleft() {
+				this.show = true
+				if (uni.getStorageSync("token")) {
+					this.$u.post('/User/getDetail').then(res => {
+						if (res.code == 0) {
+							this.userdata = res.response
+						} else {
+							this.userdata = {}
+						}
+					})
+				} else {
+					this.userdata = {}
+				}
+			},
+			tocode() {
+				this.show = false
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "/pages/mine/yaoqing"
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/mine/login-code"
+					})
+				}
+
+			},
+			totabbar(num) {
+				this.show = false
+				if (this.active == num) {
+					return
+				}
+				if (num == 0) {
+					uni.switchTab({
+						url: "/pages/index/home"
+					})
+				}
+				if (num == 1) {
+					uni.switchTab({
+						url: "/pages/order/order"
+					})
+				}
+				if (num == 2) {
+					uni.switchTab({
+						url: "/pages/shop/shop"
+					})
+				}
+				if (num == 3) {
+					uni.switchTab({
+						url: "/pages/mine/mine"
+					})
+				}
+			},
+			toxiaoxi() {
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "/pages/mine/xiaoxi"
 					})
-				}
-				if(num == 3){
-					uni.switchTab({
-						url:"/pages/mine/mine"
+				} else {
+					uni.navigateTo({
+						url: "/pages/mine/login-code"
 					})
-				}
-			},
-			toxiaoxi() {
-				uni.navigateTo({
-					url: "/pages/mine/xiaoxi"
-				})
+				}
+				
 			},
 		}
 	}
 </script>
 
 <style lang="scss">
-	.x-navbar {
-		.popup-left{
-			width: 450rpx;
-			.out-login{
-				padding: 20rpx 0;
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-				margin-top: 200rpx;
-				image{
-					width: 34rpx;
-					height: 34rpx;
-					margin: 0 40rpx;
-				}
-				text{
-					flex: 1;
-					font-size: 24rpx;
-				}
-			}
-			.tabbar-item{
-				padding: 20rpx 0;
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-				image{
-					width: 44rpx;
-					height: 44rpx;
-					margin: 0 40rpx;
-				}
-				text{
-					flex: 1;
-					font-size: 24rpx;
-				}
-			}
-			.tabbar-item1{
-				background-color: #2AA47F;
-				text{
-					color: #fff;
-				}
-			}
-			.popup-user{
-				width: 450rpx;
-				height: 300rpx;
-				position: relative;
-				.user-box{
-					width: 380rpx;
-					left: 30rpx;
-					bottom: 20rpx;
-					position: absolute;
-					image{
-						width: 120rpx;
-						height: 120rpx;
-						border-radius: 100rpx;
-						margin-right: 20rpx;
-					}
-					text{
-						color: #fff;
-					}
-				}
-				.user-code{
-					position: absolute;
-					top: 10rpx;
-					right: 10rpx;
-					width: 50rpx;
-					height: 50rpx;
-				}
-				.img-bg{
-					width: 450rpx;
-					height: 300rpx;
-				}
-			}
+	.x-navbar {
+		.popup-left {
+			width: 450rpx;
+
+			.out-login {
+				padding: 20rpx 0;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				margin-top: 200rpx;
+
+				image {
+					width: 34rpx;
+					height: 34rpx;
+					margin: 0 40rpx;
+				}
+
+				text {
+					flex: 1;
+					font-size: 24rpx;
+				}
+			}
+
+			.tabbar-item {
+				padding: 20rpx 0;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+
+				image {
+					width: 44rpx;
+					height: 44rpx;
+					margin: 0 40rpx;
+				}
+
+				text {
+					flex: 1;
+					font-size: 24rpx;
+				}
+			}
+
+			.tabbar-item1 {
+				background-color: #2AA47F;
+
+				text {
+					color: #fff;
+				}
+			}
+
+			.popup-user {
+				width: 450rpx;
+				height: 300rpx;
+				position: relative;
+
+				.user-box {
+					width: 380rpx;
+					left: 30rpx;
+					bottom: 20rpx;
+					position: absolute;
+
+					image {
+						width: 120rpx;
+						height: 120rpx;
+						border-radius: 100rpx;
+						margin-right: 20rpx;
+					}
+
+					text {
+						color: #fff;
+					}
+				}
+
+				.user-code {
+					position: absolute;
+					top: 10rpx;
+					right: 10rpx;
+					width: 50rpx;
+					height: 50rpx;
+				}
+
+				.img-bg {
+					width: 450rpx;
+					height: 300rpx;
+				}
+			}
 		}
+
 		.left-box {
 			padding: 0 25rpx;
 

+ 128 - 10
main.js

@@ -1,5 +1,6 @@
 import App from './App'
-
+import md5Libs from "./uview-ui/libs/function/md5.js";
+import url from "./common/url.js"
 // #ifndef VUE3
 import Vue from 'vue'
 
@@ -7,6 +8,123 @@ var amapFile = require('./common/amap-wx.js');
 Vue.prototype.myAmapFun = new amapFile.AMapWX({
 	key: 'daba801a5b8eb18e2aee6d0838ea4c61'
 });
+Vue.prototype.$md5 = md5Libs.md5
+Vue.prototype.$url = url
+Vue.prototype.$tophone = function(tel, str) {
+	if (str) {
+		this.$u.toast(str)
+	} else {
+		uni.makePhoneCall({
+			phoneNumber: tel
+		})
+	}
+
+}
+Vue.prototype.$openad = function(obj) {
+	// 广告类型(1、类别;2、服务;3、链接;4、商家;5、文章;6、关键字;7水电服务,8呼叫代驾,9跑腿服务,10申请服务,11商城,12商城商品,13查看大图)
+	if (obj.advertise_type == 5) {
+		uni.navigateTo({
+			url: "/pages/index/wenzhang?id=" + obj.id
+		})
+		return
+	}
+	if (obj.advertise_type == 7) {
+		uni.navigateTo({
+			url: "/pages/index/weixiu"
+		})
+		return
+	}
+	if (obj.advertise_type == 8) {
+		uni.navigateTo({
+			url: "/pages/index/daijia"
+		})
+		return
+	}
+	if (obj.advertise_type == 9) {
+		uni.navigateTo({
+			url: "/pages/index/paotui"
+		})
+		return
+	}
+	if (obj.advertise_type == 11) {
+		uni.switchTab({
+			url: "/pages/shop/shop"
+		})
+		return
+	}
+	if (obj.advertise_type == 12) {
+		uni.navigateTo({
+			url: "/pages/shop/goods-info?id=" + obj.business_product.id
+		})
+		return
+	}
+	uni.showModal({
+		content: `新的type=${obj.advertise_type}`
+	})
+	console.log(obj);
+}
+Vue.prototype.$getdata = function() {
+	var timestamp = parseInt(new Date().getTime() / 1000)
+	var secret_key = 'cXab5HR4pfBjdDryr2JjwbreieKVjA'
+	var params = {}
+	var str = '';
+	for (var Key in params) {
+		str += Key + '=' + params[Key] + '&';
+	}
+	var sign = md5Libs.md5(`${str}timestamp=${timestamp}&secret_key=${secret_key}`)
+	// console.log(`${str}timestamp=${timestamp}&secret_key=${secret_key}`);
+	var phonetype = uni.getSystemInfoSync().model
+	var header = {}
+	header.sign = sign
+	header.timestamp = timestamp
+	header.phonetype = phonetype
+	header.category = 3
+	header.secret_key = secret_key
+	header.token = uni.getStorageSync('token');
+	// config.data.header.debug = "5CDAC27A0F89C916553DE870F3C55181"//默认登录
+	return {
+		request: JSON.stringify({
+			header: header
+		})
+	}
+}
+Vue.prototype.$opencode = function() {
+	if (!uni.getStorageSync("token")) {
+		this.$u.toast("请登录")
+		setTimeout(() => {
+			uni.navigateTo({
+				url: "/pages/mine/login-code"
+			})
+		}, 800)
+		return
+	}
+	uni.scanCode({
+		success: (res) => {
+			var query = res.result.split("?")[1]
+			if(query){
+				var vars = query.split("&");
+				for (var i = 0; i < vars.length; i++) {
+					var pair = vars[i].split("=");
+					if (pair[0] == 'xiaoma_code') {
+						uni.navigateTo({
+							url: "/pages/shop/shop-orderinfo?url=" + pair[1]
+						})
+						return;
+					}
+				}
+				this.$u.toast('缺少参数')
+			}else{
+				this.$u.toast('缺少参数')
+			}
+		},
+		fail(e) {
+			uni.showModal({
+				content:JSON.stringify(e)
+			})
+		}
+	})
+}
+
 // main.js
 import uView from 'uview-ui';
 Vue.use(uView);
@@ -15,18 +133,18 @@ Vue.config.productionTip = false
 App.mpType = 'app'
 const app = new Vue({
 	...App
-})
-
-// http拦截器,此为需要加入的内容,如果不是写在common目录,请自行修改引入路径
-import httpInterceptor from '@/common/http.interceptor.js'
-// 这里需要写在最后,是为了等Vue创建对象完成,引入"app"对象(也即页面的"this"实例)
-Vue.use(httpInterceptor, app)
+})
+
+// http拦截器,此为需要加入的内容,如果不是写在common目录,请自行修改引入路径
+import httpInterceptor from '@/common/http.interceptor.js'
+// 这里需要写在最后,是为了等Vue创建对象完成,引入"app"对象(也即页面的"this"实例)
+Vue.use(httpInterceptor, app)
 
 app.$mount()
 // #endif
-
-
-
+
+
+
 
 // #ifdef VUE3
 import {

+ 6 - 1
manifest.json

@@ -64,7 +64,12 @@
         "setting" : {
             "urlCheck" : false
         },
-        "usingComponents" : true
+        "usingComponents" : true,
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "获取定位信息"
+            }
+        }
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 43 - 3
pages.json

@@ -23,6 +23,30 @@
 			}
 		},
 		{
+			"path": "pages/index/wenzhang",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationBarBackgroundColor": "#2AA47F",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		{
+			"path": "pages/mine/all-tips",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationBarBackgroundColor": "#2AA47F",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		{
+			"path": "pages/mine/xiaoxi-info",
+			"style": {
+				"navigationBarTitleText": "消息详情",
+				"navigationBarBackgroundColor": "#2AA47F",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		{
 			"path": "pages/index/paotui",
 			"style": {
 				"navigationBarTitleText": "跑腿服务",
@@ -220,14 +244,22 @@
 			}
 		},
 		{
-			"path": "pages/mine/change-tel",
+			"path": "pages/mine/bangding",
 			"style": {
-				"navigationBarTitleText": "更换手机绑定",
+				"navigationBarTitleText": "绑定手机号",
 				"navigationBarBackgroundColor": "#09AA8C",
 				"navigationBarTextStyle": "white"
 			}
 		},
 		{
+			"path": "pages/mine/change-tel",
+			"style": {
+				"navigationBarTitleText": "更换手机绑定",
+				"navigationBarBackgroundColor": "#09AA8C",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		{
 			"path": "pages/mine/change-pwd",
 			"style": {
 				"navigationBarTitleText": "设置密码",
@@ -284,6 +316,14 @@
 			}
 		},
 		{
+			"path": "pages/mine/forget-tel1",
+			"style": {
+				"navigationBarTitleText": "找回密码",
+				"navigationBarBackgroundColor": "#09AA8C",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		{
 			"path": "pages/mine/xiaoxi",
 			"style": {
 				"navigationBarTitleText": "消息管理",
@@ -362,7 +402,7 @@
 				"text": "订单"
 			},
 			{
-				"iconPath": "static/images/shop.png",
+				"iconPath": "static/images/shop1.png",
 				"selectedIconPath": "static/images/shop.png",
 				"pagePath": "pages/shop/shop",
 				"text": "商城"

+ 396 - 291
pages/fuwu/fuwu.vue

@@ -1,310 +1,415 @@
-<template>
-	<view class="fuwu">
-		<u-navbar :background="{background:'#2AA47F'}" title="小马服务商" :borderBottom="false"
-			title-color="#fff" back-icon-color="#fff">
-			<view class="left-box u-flex u-col-center" slot="left">
-				<view style="width: 47rpx;height: 43rpx;position: relative;margin-right: 25rpx;">
-					<image src="../../static/images/index1-2.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
-					<text style="position: absolute;top: -20rpx;right: -10rpx;font-size: 22rpx;width: 30rpx;height: 30rpx;text-align: center;line-height: 30rpx;border-radius: 100rpx;color: #fff;background-color: red;">99</text>
-				</view>
-				<image src="../../static/images/fuwu1-1.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
-			</view>
+<template>
+	<view class="fuwu">
+		<u-navbar :background="{background:'#2AA47F'}" title="小马服务商" :borderBottom="false" title-color="#fff"
+			back-icon-color="#fff">
+			<view class="left-box u-flex u-col-center" slot="left">
+				<view style="width: 47rpx;height: 43rpx;position: relative;margin-right: 25rpx;" @tap="toxiaoxi">
+					<image src="../../static/images/index1-2.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
+					<text v-if="count > 0"
+						style="position: absolute;top: -20rpx;right: -10rpx;font-size: 22rpx;width: 30rpx;height: 30rpx;text-align: center;line-height: 30rpx;border-radius: 100rpx;color: #fff;background-color: red;">{{count > 99 ? '99+' : count}}</text>
+				</view>
+				<image src="../../static/images/fuwu1-1.png" style="width: 44rpx;height: 44rpx;" mode="" @tap="totips"></image>
+			</view>
 		</u-navbar>
-		<view class="row-box1 u-flex u-col-center u-row-between">
-			<text class="text1">您已是服务提供者</text>
+		<view class="notice-box" v-if="list.length > 0">
+			<u-notice-bar @click="openbar" mode="vertical" :list="list" bg-color="#fff" color="#000"></u-notice-bar>
 		</view>
-		<view class="row-box2 u-flex u-col-center">
-			<text class="text1">在线接单状态</text>
-			<u-switch v-model="checked" size="35" active-color="#08AA8C"></u-switch>
-		</view>
-		<view class="row-box3 u-flex u-col-center">
-			<text class="text1">接单时间:9:00 至 23:30</text>
-			<!-- <view class="text2">
-				<text>设置时间</text>
-			</view> -->
-			<x-button :width="178" :height="46" color="#000" fontSize="30rpx">设置时间</x-button>
-		</view>
-		<view class="order-box">
-			<view class="fuwu-tabs u-flex u-col-center u-row-between">
-				<text :class="fuwutype == 1 ? 'text' : ''">已开通项目</text>
-				<text :class="fuwutype == 2 ? 'text' : ''">申请中项目</text>
-			</view>
-			<view class="fuwu-list u-flex u-col-center">
-				<view class="item u-flex-col u-col-center">
-					<view class="image u-flex u-col-center u-row-center">
-						<image src="../../static/images/t1.png" mode=""></image>
-						<text class="text2">已通过</text>
-					</view>
-					<view class="name">
-						代驾
-					</view>
-				</view>
-				<view class="item u-flex-col u-col-center">
-					<view class="image u-flex u-col-center u-row-center">
-						<image src="../../static/images/t2.png" mode=""></image>
-						<text class="text2">已通过</text>
-					</view>
-					<view class="name">
-						跑腿
-					</view>
-				</view>
-				<view class="item u-flex-col u-col-center">
-					<view class="image u-flex u-col-center u-row-center">
-						<image src="../../static/images/t3.png" mode=""></image>
-						<text class="text2">已通过</text>
-					</view>
-					<view class="name">
-						电工
-					</view>
-				</view>
-				<view class="item u-flex-col u-col-center">
-					<view class="image u-flex u-col-center u-row-center">
-						<image src="../../static/images/t4.png" mode=""></image>
-						<text class="text2">已通过</text>
-					</view>
-					<view class="name">
-						水工
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="down-box-list">
-			<view class="down-title">
-				可申请开通项目
-			</view>
-			<view class="list-box">
-				<view class="item-box u-flex u-col-center u-row-between">
-					<image src="../../static/images/t1.png" mode=""></image>
-					<view class="item-right">
-						
-					</view>
-				</view>
-				<view class="item-box u-flex u-col-center u-row-between">
-					<image src="../../static/images/t2.png" mode=""></image>
-					<view class="item-right">
-						
-					</view>
-				</view>
-				<view class="item-box u-flex u-col-center u-row-between">
-					<image src="../../static/images/t3.png" mode=""></image>
-					<view class="item-right">
-						
-					</view>
-				</view>
-				<view class="item-box u-flex u-col-center u-row-between">
-					<image src="../../static/images/t4.png" mode=""></image>
-					<view class="item-right">
-						
-					</view>
-				</view>
-			</view>
-		</view>
-		
-	</view>
-</template>
-
+		<view class="swiper">
+			<u-swiper :list="swiper" @click="openad" name="advertise_image" height="417" mode="none"></u-swiper>
+		</view>
+		<view class="row-box1 u-flex u-col-center u-row-between">
+			<text class="text1">您已是服务提供者</text>
+		</view>
+		<view class="row-box2 u-flex u-col-center">
+			<text class="text1">在线接单状态</text>
+			<u-switch v-model="checked" size="35" active-color="#08AA8C"></u-switch>
+		</view>
+		<view class="row-box3 u-flex u-col-center">
+			<text class="text1">接单时间:{{jiedantime || '未设置'}}</text>
+			<!-- <view class="text2">
+				<text>设置时间</text>
+			</view> -->
+			<picker mode="multiSelector" :range="timedata" @change="changetime">
+				<x-button :width="178" :height="46" color="#000" fontSize="30rpx">设置时间</x-button>
+			</picker>
+		</view>
+		<view class="order-box">
+			<view class="fuwu-tabs u-flex u-col-center u-row-between">
+				<text :class="fuwutype == 1 ? 'text' : ''" @tap="getfuwu(1)">已开通项目</text>
+				<text :class="fuwutype == 0 ? 'text' : ''" @tap="getfuwu(0)">申请中项目</text>
+			</view>
+			<view class="fuwu-list u-flex u-col-center">
+				<view class="item u-flex-col u-col-center" v-for="(item,index) in fuwulist" :key='index' @tap="toinfo(item.classify_id)">
+					<view class="image u-flex u-col-center u-row-center">
+						<image :src="item.classify_image" mode=""></image>
+						<text class="text2" v-if="fuwutype == 1" style="color: #2AA47F;">通过</text>
+						<text class="text2" v-if="fuwutype == 0">审核中</text>
+					</view>
+					<view class="name">
+						{{item.classify_title}}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="down-box-list">
+			<view class="down-title">
+				可申请开通项目
+			</view>
+			<view class="list-box">
+				<view class="item-box u-flex u-col-center u-row-between" v-for="(item,index) in allfuwu" :key="index" @tap="toinfo(item.id)">
+					<image :src="item.image" mode=""></image>
+					<view class="item-right u-flex-col u-row-center">
+						<text style="font-size: 30rpx;">{{item.title}}</text>
+						<text style="font-size: 24rpx;color: #333;">{{item.desc}}</text>
+					</view>
+				</view>
+			</view>
+		</view>
+
+	</view>
+</template>
+
 <script>
-	export default {
-		data(){
-			return{
-				fuwutype:1,
-				checked:false
-			}
-		},
-		onLoad() {
-			
+	import time from "../../common/time.js"
+	export default {
+		data() {
+			return {
+				fuwutype: 1,
+				checked: false,
+				id: '',
+				count:0,
+				userdata:{},
+				jiedantime:'',
+				timedata:[],
+				fuwulist:[],
+				allfuwu:[],
+				list:[],
+				swiper:''
+			}
 		},
-		methods:{
-			
-		}
-	}
-</script>
-
-<style lang="scss">
-	.fuwu{
-		.down-box-list{
-			padding: 0 24rpx;
-			.list-box{
-				.item-box{
-					margin-bottom: 20rpx;
-					image{
-						width: 126rpx;
-						height: 126rpx;
-						margin-right: 33rpx;
-					}
-					.item-right{
-						flex: 1;
-						height: 126rpx;
-						border-radius: 20rpx;
-						border: 4rpx solid #09AA8C;
+		onShow() {
+			if(uni.getStorageSync("token")){
+				this.$u.post('/UserMessage/getMessageReadFalseCount').then(res => {
+					if (res.code == 0) {
+						this.count = res.response.count
 					}
-				}
-				
-			}
-			.down-title{
-				font-size: 31rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				padding: 40rpx 14rpx 20rpx 14rpx;
+				})
+				this.getuser()
+				this.getfuwu(this.fuwutype)
+				this.getallfuwu()
 			}
-		}
-		.order-box {
-			border: 1rpx solid #A0A0A0;
-			padding: 0 16rpx;
-			border-radius: 20rpx;
-			background-color: #fff;
-			margin: 0 22rpx;
-			padding-bottom: 20rpx;
-		
-			.fuwu-list {
-				.item {
-					width: 25%;
-					margin-top: 10rpx;
-		
-					.name {
-						font-size: 29rpx;
-						font-family: SimHei;
+		},
+		onLoad() {
+			this.timedata.push(time)
+			this.timedata.push(time)
+			this.getad()
+		},
+		methods: {
+			openbar(e){
+				this.$openad(this.list[e])
+			},
+			openad(e){
+				this.$openad(this.swiper[e])
+			},
+			async getad(){
+				var {response:{data}} = await this.$u.post('/Advertise/all',{
+					content:{
+						business:1,
+						device_type:0
 					}
-		
-					.image {
-						width: 124rpx;
-						height: 124rpx;
-						border-radius: 20rpx;
-						// background-color: #08AA8C;
-						position: relative;
-						margin-bottom: 10rpx;
-		
-						image {
-							width: 124rpx;
-							height: 124rpx;
-						}
-		
-						text {
-							position: absolute;
-							top: 50%;
-							left: 50%;
-							transform: translate(-50%, -50%);
-							padding: 8rpx 17rpx;
-							border-radius: 100rpx;
-							font-size: 19rpx;
-							font-family: SimHei;
-							font-weight: 400;
-							
-							background-color: rgba(256, 256, 256, 0.8);
-							white-space: nowrap;
-						}
-						.text1{
-							color: #E60012;
-						}
-						.text2{
-							color: rgba(8, 170, 140, 1);
-						}
+				})
+				data.forEach(val => {
+					if(val.type == 1){
+						this.swiper = val.advertise
 					}
-				}
-			}
-		
-			.fuwu-tabs {
-				text {
-					width: 50%;
-					text-align: center;
-					padding: 21rpx 0;
-					border-bottom: 7rpx solid #fff;
-					font-size: 29rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #707070;
-				}
-		
-				.text {
-					color: #08AA8C;
-					border-bottom: 7rpx solid #08AA8C;
-				}
-			}
-		
-			.order-tabs {
-				.item {
-					width: 20%;
-					position: relative;
-		
-					image {
-						width: 52rpx;
-						height: 52rpx;
-						margin-bottom: 20rpx;
+					if(val.type == 2){
+						this.list = val.advertise
+					}
+				})
+				console.log(this.list);
+			},
+			getallfuwu(){
+				this.$u.post('/FacilitatorExamine/allClassify').then(res => {
+					this.allfuwu = res.response.data
+				})
+			},
+			toinfo(id){
+				uni.navigateTo({
+					url:"../mine/kaitong-fuwu?id=" + id
+				})
+			},
+			getfuwu(type){
+				this.fuwutype = type
+				this.$u.post('/FacilitatorExamine/getQualificationsExamineList',{
+					content:{
+						status:this.fuwutype
+					}
+				}).then(res => {
+					this.fuwulist = res.response.data
+				})
+			},
+			changeswitch(e) {
+				this.$u.post('/Facilitator/setOrdersStatus', {
+					content: {
+						is_orders: e ? 1 : 0
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					setTimeout(() => {
+						this.getuser()
+					},800)
+				})
+			},
+			changetime(e) {
+				this.$u.post('/Facilitator/setOrdersTime', {
+					content: {
+						orders_state_time: this.timedata[0][e.detail.value[0]],
+						orders_end_time: this.timedata[1][e.detail.value[1]]
 					}
-		
-					.text1 {
-						font-size: 28rpx;
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							this.getuser()
+						}, 800)
 					}
-		
-					.text2 {
-						position: absolute;
-						top: -10rpx;
-						right: 5rpx;
-						width: 39rpx;
-						height: 39rpx;
-						text-align: center;
-						line-height: 39rpx;
-						color: #fff;
-						border-radius: 100rpx;
-						font-size: 24rpx;
-						background-color: red;
+				})
+			},
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+						if (this.userdata.facilitator.is_orders == 0) {
+							this.checked = false
+						} else {
+							this.checked = true
+						}
+						this.jiedantime = this.userdata.facilitator.orders_state_time + "至" + this.userdata
+							.facilitator.orders_end_time
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						this.userdata = {}
 					}
+				})
+			},
+			totips(){
+				uni.navigateTo({
+					url:"../mine/all-tips?type=2"
+				})
+			},
+			toxiaoxi(){
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "/pages/mine/xiaoxi"
+					})
+				} else {
+					uni.navigateTo({
+						url: "/pages/mine/login-code"
+					})
 				}
-			}
-		
-			.box-title {
-				padding: 24rpx 0;
-				font-size: 33rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #707070;
-			}
-		}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.fuwu {
+		.down-box-list {
+			padding: 0 24rpx;
+
+			.list-box {
+				.item-box {
+					margin-bottom: 20rpx;
+					
+					image {
+						width: 126rpx;
+						height: 126rpx;
+						margin-right: 33rpx;
+					}
+
+					.item-right {
+						padding: 10rpx;
+						flex: 1;
+						height: 126rpx;
+						border-radius: 20rpx;
+						border: 4rpx solid #09AA8C;
+					}
+				}
+
+			}
+
+			.down-title {
+				font-size: 31rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				padding: 40rpx 14rpx 20rpx 14rpx;
+			}
+		}
+
+		.order-box {
+			border: 1rpx solid #A0A0A0;
+			padding: 0 16rpx;
+			border-radius: 20rpx;
+			background-color: #fff;
+			margin: 0 22rpx;
+			padding-bottom: 20rpx;
+
+			.fuwu-list {
+				.item {
+					width: 25%;
+					margin-top: 10rpx;
+
+					.name {
+						font-size: 29rpx;
+						font-family: SimHei;
+						color: #08AA8C;
+					}
+
+					.image {
+						width: 124rpx;
+						height: 124rpx;
+						border-radius: 20rpx;
+						// background-color: #08AA8C;
+						position: relative;
+						margin-bottom: 10rpx;
+
+						image {
+							width: 124rpx;
+							height: 124rpx;
+						}
+
+						text {
+							position: absolute;
+							top: 50%;
+							left: 50%;
+							transform: translate(-50%, -50%);
+							padding: 8rpx 17rpx;
+							border-radius: 100rpx;
+							font-size: 19rpx;
+							font-family: SimHei;
+							font-weight: 400;
+
+							background-color: rgba(256, 256, 256, 0.8);
+							white-space: nowrap;
+						}
+
+						.text1 {
+							color: #E60012;
+						}
+
+						.text2 {
+							color: #E60012;
+							// color: rgba(8, 170, 140, 1);
+						}
+					}
+				}
+			}
+
+			.fuwu-tabs {
+				text {
+					width: 50%;
+					text-align: center;
+					padding: 21rpx 0;
+					border-bottom: 7rpx solid #fff;
+					font-size: 29rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #707070;
+				}
+
+				.text {
+					color: #08AA8C;
+					border-bottom: 7rpx solid #08AA8C;
+				}
+			}
+
+			.order-tabs {
+				.item {
+					width: 20%;
+					position: relative;
+
+					image {
+						width: 52rpx;
+						height: 52rpx;
+						margin-bottom: 20rpx;
+					}
+
+					.text1 {
+						font-size: 28rpx;
+					}
+
+					.text2 {
+						position: absolute;
+						top: -10rpx;
+						right: 5rpx;
+						width: 39rpx;
+						height: 39rpx;
+						text-align: center;
+						line-height: 39rpx;
+						color: #fff;
+						border-radius: 100rpx;
+						font-size: 24rpx;
+						background-color: red;
+					}
+				}
+			}
+
+			.box-title {
+				padding: 24rpx 0;
+				font-size: 33rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #707070;
+			}
+		}
+
 		.left-box {
 			padding: 0 25rpx;
 
 			image {
 				margin-right: 25rpx;
 			}
-		}
-		.row-box3 {
-			padding: 32rpx;
-		
-			.text1 {
-				margin-right: 40rpx;
-				color: #707070;
-				font-size: 25rpx;
-			}
-		
-		}
-		
-		.row-box2 {
-			padding: 0 32rpx;
-		
-			.text1 {
-				font-size: 25rpx;
-				margin-right: 60rpx;
-			}
-		}
-		
-		.row-box1 {
-			padding: 32rpx;
-		
-			.text1 {
-				color: #707070;
-				font-size: 31rpx;
-				flex: 1;
-			}
-		
-			.text2 {
-				font-size: 25rpx;
-				margin-right: 10rpx;
-			}
-		
-			.image1 {
-				width: 27rpx;
-				height: 27rpx;
-			}
-		}
-	}
+		}
+
+		.row-box3 {
+			padding: 32rpx;
+
+			.text1 {
+				margin-right: 40rpx;
+				color: #707070;
+				font-size: 25rpx;
+			}
+
+		}
+
+		.row-box2 {
+			padding: 0 32rpx;
+
+			.text1 {
+				font-size: 25rpx;
+				margin-right: 60rpx;
+			}
+		}
+
+		.row-box1 {
+			padding: 32rpx;
+
+			.text1 {
+				color: #707070;
+				font-size: 31rpx;
+				flex: 1;
+			}
+
+			.text2 {
+				font-size: 25rpx;
+				margin-right: 10rpx;
+			}
+
+			.image1 {
+				width: 27rpx;
+				height: 27rpx;
+			}
+		}
+	}
 </style>

+ 210 - 86
pages/index/change-address.vue

@@ -3,42 +3,42 @@
 		<view class="address-form">
 			<view class="form-row u-flex u-col-center">
 				<text>联系人:</text>
-				<input type="text" placeholder="请输入姓名" />
+				<input type="text" placeholder="请输入姓名" v-model="name" />
 			</view>
 			<view class="form-row u-flex u-col-center">
 				<text>联系电话:</text>
-				<input type="number" placeholder="请输入联系电话" />
+				<input type="number" placeholder="请输入联系电话" v-model="phone" />
 			</view>
-			<view class="form-row u-flex u-col-center">
+			<view class="form-row u-flex u-col-center" @click="openmap">
 				<text>定位地址:</text>
-				<input type="text" placeholder="定位到的地址信息" />
+				<input type="text" placeholder="定位到的地址信息" :disabled="true" v-model="address" />
 			</view>
 			<view class="address-text">
-				<textarea placeholder="定位后可修改或填写的地址信息" />
+				<textarea placeholder="定位后可修改或填写的地址信息" v-model="addresstext" />
 			</view>
 			<view class="save-address u-flex u-col-center u-row-right">
 				<text class="text1">同时保存到我的地址</text>
 				<u-switch v-model="checked" active-color="#09AA8C" size="40"></u-switch>
-			</view>
-			<x-button :width="180" :height="49" fontSize="27rpx">确认地址</x-button>
-		</view>
-		<view class="address-list">
-			<view class="title">
-				选择已存地址
-			</view>
-			<view class="address-item" v-for="(item,index) in 2" :key="index">
-				<view class="header u-flex u-col-center u-row-right">
-					<text>修改</text>
-					<text>删除</text>
-				</view>
-				<view class="user-box">
-					<text>天赋品策§鹏</text>
-					<text>15916663977</text>
-				</view>
-				<view class="add-text">
-					广东省汕头市龙湖区广东省汕头市龙湖区广东省汕头市龙湖区
-				</view>
-			</view>
+			</view>
+			<x-button :width="180" :height="49" fontSize="27rpx" @click="changeadd">确认地址</x-button>
+		</view>
+		<view class="address-list" v-if="list.length > 0">
+			<view class="title">
+				选择已存地址
+			</view>
+			<view class="address-item" v-for="(item,index) in list" :key="index" @click="change(item)">
+				<view class="header u-flex u-col-center u-row-right">
+					<text @click.stop="toset(item)">修改</text>
+					<text @click.stop="del(item)">删除</text>
+				</view>
+				<view class="user-box">
+					<text>{{item.name}}</text>
+					<text>{{item.phone}}</text>
+				</view>
+				<view class="add-text">
+					{{item.province}}{{item.city}}{{item.area}}{{item.location_address}}{{item.address}}
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -47,67 +47,187 @@
 	export default {
 		data() {
 			return {
-				checked: false
+				checked: false,
+				page: 1,
+				count: 0,
+				list: [],
+				name: '',
+				phone: '',
+				address: '',
+				addresstext: '',
+				lng: '',
+				lat: ''
 			}
 		},
 		onLoad() {
-
+			this.getlist()
+		},
+		onReachBottom() {
+			this.page++
+			this.getlist()
 		},
 		methods: {
-
+			del(item) {
+				uni.showModal({
+					content: "确定删除吗?",
+					success: (res) => {
+						if (res.confirm) {
+							this.$u.post('/UserAddress/delete', {
+								content: {
+									id: item.id
+								}
+							}).then(res => {
+								this.$u.toast(res.msg)
+								if (res.code == 0) {
+									setTimeout(() => {
+										this.page = 1
+										this.getlist()
+									}, 800)
+								}
+							})
+						}
+					}
+				})
+			},
+			toset(item) {
+				uni.navigateTo({
+					url: "../mine/address-set?item=" + encodeURIComponent(JSON.stringify(item))
+				})
+			},
+			change(item) {
+				const eventChannel = this.getOpenerEventChannel();
+				eventChannel.emit('changeaddress', {
+					id: item.id,
+					address: `${item.province}${item.city}${item.area}${item.location_address}${item.address}`,
+					name: item.name,
+					phone: item.phone
+				});
+				uni.navigateBack()
+			},
+			openmap() {
+				uni.chooseLocation({
+					success: (res) => {
+						this.lat = res.latitude
+						this.lng = res.longitude
+						this.address = res.name
+						this.addresstext = res.address
+					}
+				})
+			},
+			changeadd() {
+				if (!this.name) {
+					this.$u.toast("请输入姓名")
+					return
+				}
+				if (!this.phone) {
+					this.$u.toast("请输入手机号")
+					return
+				}
+				if (!this.address) {
+					this.$u.toast("请选择地址")
+					return
+				}
+				this.$u.post('/UserAddress/add', {
+					content: {
+						address: this.addresstext,
+						is_default: 0,
+						is_user_add: this.checked ? 1 : 0,
+						lat: this.lat,
+						lng: this.lng,
+						location_address: this.address,
+						name: this.name,
+						phone: this.phone,
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						const eventChannel = this.getOpenerEventChannel();
+						eventChannel.emit('changeaddress', {
+							id: res.response.id,
+							address: `${res.response.province}${res.response.city}${res.response.area}${res.response.location_address}${res.response.address}`,
+							name: res.response.name,
+							phone: res.response.phone
+						});
+						uni.navigateBack()
+					}
+				})
+			},
+			getlist() {
+				this.$u.post('/UserAddress/list', {
+					content: {
+						limit: 10,
+						list_type: 'page',
+						page: this.page
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if (this.page == 1) {
+						this.list = res.response.data
+					} else {
+						this.list = this.list.concat(res.response.data)
+					}
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss">
-	.change-address {
-		.address-list{
-			width: 691rpx;
-			border-radius: 10rpx;
-			padding: 25rpx;
-			border: 1rpx solid #3DBDA5;
-			margin: 0 auto;
-			.address-item{
-				border: 1rpx solid #FAD445;
-				padding: 0 23rpx 20rpx 23rpx;
-				border-radius: 10rpx;
-				margin-bottom: 20rpx;
-				background-color: #EEEEEE;
-				.add-text{
-					font-size: 27rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #707070;
-				}
-				.user-box{
-					font-size: 27rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #707070;
-					text{
-						margin-right: 20rpx;
-					}
-				}
-				.header{
-					padding: 10rpx 0;
-					font-size: 27rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #08AA8C;
-					border-bottom: 1rpx solid #FAD445;
-					margin-bottom: 20rpx;
-					text{
-						margin-left: 30rpx;
-					}
-				}
-			}
-			.title{
-				padding: 22rpx 0;
-				font-size: 27rpx;
-				font-family: SimHei;
-				font-weight: 400;
-			}
+	.change-address {
+		.address-list {
+			width: 691rpx;
+			border-radius: 10rpx;
+			padding: 25rpx;
+			border: 1rpx solid #3DBDA5;
+			margin: 0 auto;
+
+			.address-item {
+				border: 1rpx solid #FAD445;
+				padding: 0 23rpx 20rpx 23rpx;
+				border-radius: 10rpx;
+				margin-bottom: 20rpx;
+				background-color: #EEEEEE;
+
+				.add-text {
+					font-size: 27rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #707070;
+				}
+
+				.user-box {
+					font-size: 27rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #707070;
+
+					text {
+						margin-right: 20rpx;
+					}
+				}
+
+				.header {
+					padding: 10rpx 0;
+					font-size: 27rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #08AA8C;
+					border-bottom: 1rpx solid #FAD445;
+					margin-bottom: 20rpx;
+
+					text {
+						margin-left: 30rpx;
+					}
+				}
+			}
+
+			.title {
+				padding: 22rpx 0;
+				font-size: 27rpx;
+				font-family: SimHei;
+				font-weight: 400;
+			}
 		}
+
 		.address-form {
 			width: 691rpx;
 			// height: 533rpx;
@@ -115,19 +235,22 @@
 			margin: 20rpx auto;
 			background-color: #fff;
 			border-radius: 10rpx;
-			padding: 0 18rpx;
-			padding-bottom: 30rpx;
+			padding: 0 18rpx;
+			padding-bottom: 30rpx;
 			margin-bottom: 40rpx;
-			.save-address{
-				margin-bottom: 20rpx;
-				.text1{
-					margin-right: 32rpx;
-					font-size: 27rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #959595;
-				}
+
+			.save-address {
+				margin-bottom: 20rpx;
+
+				.text1 {
+					margin-right: 32rpx;
+					font-size: 27rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #959595;
+				}
 			}
+
 			.address-text {
 				margin-top: 20rpx;
 				width: 656rpx;
@@ -135,6 +258,7 @@
 				background-color: #EEEEEE;
 				border-radius: 10rpx;
 				margin-bottom: 20rpx;
+
 				textarea {
 					height: 117rpx;
 				}

+ 179 - 77
pages/index/daijia.vue

@@ -6,21 +6,25 @@
 		<view class="map-down">
 			<view class="tel-box u-flex u-col-center u-row-center">
 				<image class="image1" src="../../static/images/map1-1.png" mode=""></image>
-				<input class="input" type="number" placeholder="请输入手机号" />
+				<input class="input" type="number" placeholder="请输入手机号" v-model="phone" />
 				<image class="image2" src="../../static/images/mine1-4.png" mode=""></image>
 			</view>
 			<view class="qidian-box u-flex u-col-top">
 				<text>起</text>
 				<text>{{addresstext}}</text>
-			</view>
-			<view class="add-text">
-				(填写或选择出发位置)
-			</view>
-			<view style="margin: 20rpx 0;">
-				<x-button>呼叫代驾</x-button>
-			</view>
-			<view class="tips">
-				计价方法和计价介绍
+			</view>
+			<view class="add-text" @click="openmap">
+				(填写或选择出发位置)
+			</view>
+			<view class="xieyi-box u-flex u-col-center u-row-right">
+				<u-checkbox v-model="xieyi" active-color="rgba(8, 170, 140, 1)">同意</u-checkbox>
+				<text class="text1" @tap="toxieyi(16)">《代驾服务协议》</text>
+			</view>
+			<view style="margin: 20rpx 0;">
+				<x-button @click="hujiao">呼叫代驾</x-button>
+			</view>
+			<view class="tips" @tap="toxieyi(12)">
+				计价方法和计价介绍
 			</view>
 		</view>
 
@@ -35,8 +39,10 @@
 				longitude: '',
 				latitude1: '',
 				longitude1: '',
-				markers: [],
-				addresstext: ''
+				// markers: [],
+				addresstext: '',
+				phone: '',
+				xieyi: false
 			}
 		},
 		onLoad() {
@@ -46,48 +52,130 @@
 					this.longitude = res[0].longitude
 					this.latitude1 = res[0].latitude
 					this.longitude1 = res[0].longitude
-					this.markers.push({
-						id: 1,
-						latitude: res[0].latitude,
-						longitude: res[0].longitude
-					})
+					// this.markers.push({
+					// 	id: 1,
+					// 	latitude: res[0].latitude,
+					// 	longitude: res[0].longitude
+					// })
 				}
 			})
-			// uni.getLocation({
-			// 	altitude: true,
-			// 	type: "gcj02",
-			// 	success: (res) => {
-			// 		this.latitude = res.latitude
-			// 		this.longitude = res.longitude
-			// 		this.latitude1 = res.latitude
-			// 		this.longitude1 = res.longitude
-			// 		this.markers.push({
-			// 			id: 2,
-			// 			latitude: res.latitude,
-			// 			longitude: res.longitude
-			// 		})
-			// 		console.log(this.markers);
-			// 	}
-			// })
+			if (uni.getStorageSync("token")) {
+				this.getuser()
+			}
 		},
-		methods: {
+		methods: {
+			xiadan(is_check){
+				this.$u.post('/OrderDesignatedDriving/add',{
+					content:{
+						is_check:is_check,
+						is_phone:1,
+						start_lat:this.latitude1,
+						start_lng:this.longitude1,
+						start_location_address:this.addresstext,
+						start_phone:this.phone,
+					}
+				}).then(res => {
+					if(res.code == 0){
+						if(is_check == 1){
+							uni.showModal({
+								content:res.msg,
+								confirmText:"立即下单",
+								cancelText:"取消",
+								success: (on) => {
+									if(on.confirm){
+										this.xiadan(0)
+									}
+								}
+							})
+						}else{
+							var orderid = res.response.order_no
+							uni.showModal({
+								content:"下单成功",
+								confirmText:"查看详情",
+								cancelText:"返回首页",
+								success: (res) => {
+									if(res.confirm){
+										uni.navigateTo({
+											url:"../order/order-info?id=" + orderid
+										})
+									}else{
+										uni.switchTab({
+											url:"./home"
+										})
+									}
+								}
+							})
+						}
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			hujiao(){
+				if (uni.getStorageSync("token")) {
+					if(!this.phone){
+						this.$u.toast("请输入手机号")
+						return
+					}
+					if(!this.addresstext){
+						this.$u.toast("请选择地址")
+						return
+					}
+					if(!this.xieyi){
+						this.$u.toast("请勾选协议")
+						return
+					}
+					this.xiadan(1)
+				}else{
+					uni.navigateTo({
+						url:"../mine/login-code"
+					})
+				}
+			},
+			toxieyi(type) {
+				uni.navigateTo({
+					url: "../mine/all-tips?type=" + type
+				})
+			},
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.phone = res.response.phone
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+					}
+				})
+			},
+			openmap() {
+				uni.chooseLocation({
+					latitude: this.latitude1,
+					longitude: this.longitude1,
+					success: (res) => {
+						this.addresstext = res.address + res.name
+						this.latitude1 = res.latitude
+						this.longitude1 = res.longitude
+						console.log(res);
+					}
+				})
+			},
 			regionchange(e) {
 				if (e.type == 'end' && e.detail.centerLocation.longitude > 0) {
 					this.latitude1 = e.detail.centerLocation.latitude
 					this.longitude1 = e.detail.centerLocation.longitude
-
-					var num = this.markers.length - 1
-					this.markers.push({
-						id: this.markers[num].id + 1,
-						latitude: e.detail.centerLocation.latitude,
-						longitude: e.detail.centerLocation.longitude
-					})
+					// console.log(e);
+					// var num = this.markers.length - 1
+					// this.markers.push({
+					// 	id: this.markers[num].id + 1,
+					// 	latitude: e.detail.centerLocation.latitude,
+					// 	longitude: e.detail.centerLocation.longitude
+					// })
 
 					this.myAmapFun.getRegeo({
 						location: this.longitude1 + "," + this.latitude1,
 						success: (res) => {
 							this.addresstext = res[0].name + res[0].desc
-							console.log(res[0].name + res[0].desc);
+							// console.log(res[0]);
 						},
 						fail: (err) => {
 							console.log(err);
@@ -107,44 +195,58 @@
 		min-height: 100vh;
 		background-color: #fff;
 
+		.xieyi-box {
+			padding: 0 24rpx;
+			margin: 35rpx 0;
+
+			.text1 {
+				color: rgba(8, 170, 140, 1);
+			}
+		}
+
 		.map-down {
-			padding: 0 30rpx;
-			.tips{
-				text-align: center;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #08AA8C;
+			padding: 0 30rpx;
+
+			.tips {
+				text-align: center;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
 			}
-			.add-text{
-				text-align: center;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #707070;
-				padding-bottom: 20rpx;
-				border-bottom: 1rpx solid #E0E0E0;
+
+			.add-text {
+				text-align: center;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #707070;
+				padding-bottom: 20rpx;
+				border-bottom: 1rpx solid #E0E0E0;
 			}
-			.qidian-box {
-				margin-top: 20rpx;
-				margin-bottom: 10rpx;
-				text:first-child{
-					width: 40rpx;
-					height: 40rpx;
-					border-radius: 100rpx;
-					background-color: #049FE8;
-					text-align: center;
-					line-height: 40rpx;
-					
-					color: #fff;
-					margin-right: 20rpx;
-				}
-				text:last-child{
-					flex: 1;
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-				}
+
+			.qidian-box {
+				margin-top: 20rpx;
+				margin-bottom: 10rpx;
+
+				text:first-child {
+					width: 40rpx;
+					height: 40rpx;
+					border-radius: 100rpx;
+					background-color: #049FE8;
+					text-align: center;
+					line-height: 40rpx;
+
+					color: #fff;
+					margin-right: 20rpx;
+				}
+
+				text:last-child {
+					flex: 1;
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
 			}
 
 			.tel-box {

+ 146 - 97
pages/index/home.vue

@@ -1,39 +1,47 @@
 <template>
 	<view class="home">
-		<x-navbar title="首页" :active="0"></x-navbar>
-		<view class="notice-box">
-			<u-notice-bar mode="horizontal" :list="list" bg-color="#fff" color="#000"></u-notice-bar>
+		<x-navbar title="首页" ref="nav" :active="0"></x-navbar>
+		<view class="notice-box" v-if="list.length > 0">
+			<u-notice-bar @click="openbar" mode="vertical" :list="list" bg-color="#fff" color="#000"></u-notice-bar>
 		</view>
 		<view class="swiper">
-			<u-swiper :list="swiper" height="417" mode="none"></u-swiper>
+			<u-swiper :list="swiper" @click="openad" name="advertise_image" height="417" mode="none"></u-swiper>
 		</view>
 		<view class="tips-box u-flex u-col-center u-flex-wrap u-row-between">
-			<view class="item u-flex u-col-center u-row-center" @tap="totabs(index)" v-for="(item,index) in tabslist" :key='index'>
-				<image :src="item.img" mode="aspectFit"></image>
-				<view class="text">{{item.name}}</view>
+			<view class="item u-flex-col u-col-center u-row-center" @tap="totabs(item)" v-for="(item,index) in tabslist" :key='index'>
+				<image :src="item.advertise_image" mode="aspectFit"></image>
+				<view class="text">{{item.advertise_name}}</view>
 			</view>
 			<view style="width: 158rpx;"></view>
 			<view style="width: 158rpx;"></view>
 		</view>
-		<view class="u-flex u-col-center u-row-center">
+		<!-- <view class="u-flex u-col-center u-row-center">
 			<image src="../../static/images/index1-5.png" style="width: 340rpx;height: 100rpx;" mode="aspectFit">
 			</image>
-		</view>
+		</view> -->
 		<view class="hot-box">
-			<view class="item" v-for="(item,index) in 2" :key='index'>
+			<view class="item" v-for="(item,index) in hotlist" :key='index' @tap="totabs(item)">
 				<view class="image">
-					<image src="" mode=""></image>
-					<text>水电维修</text>
+					<image :src="item.advertise_image" mode=""></image>
+					<text v-if="item.advertise_type == 5">{{item.advertise_title}}</text>
+					<text v-if="item.advertise_type == 12">{{item.business_product.title}}</text>
 				</view>
-				<view class="u-flex text">
-					<text>城市居家及办公的各种供水、供电维护维修及各类杂修便民服务。服务范畴:用水设备,电器设备,更换……</text>
+				<view class="u-flex-col text">
+					<text class="text1" v-if="item.advertise_type == 5">{{item.advertise_details}}</text>
+					<text class="text1" v-if="item.advertise_type == 12">{{item.business_product.desc}}</text>
+					<view class="goods-down u-flex u-col-center" v-if="item.advertise_type == 12">
+						<text>¥{{item.business_product.show_sale_price}}</text>
+						<text>门市价¥{{item.business_product.show_original_price}}</text>
+						<text>销量{{item.business_product.show_sales_number}}</text>
+						<!-- <text>10.2公里</text> -->
+					</view>
 				</view>
 			</view>
 		</view>
-		<view class="u-flex u-col-center u-row-center">
+		<!-- <view class="u-flex u-col-center u-row-center">
 			<image src="../../static/images/index1-6.png" style="width: 340rpx;height: 100rpx;" mode="aspectFit">
 			</image>
-		</view>
+		</view> -->
 		<view class="pubu-box">
 			<u-waterfall v-model="flowList">
 				<template v-slot:left="{leftList}">
@@ -99,82 +107,101 @@
 	export default {
 		data() {
 			return {
-				list: [
-					'寒雨连江夜入吴',
-					'平明送客楚山孤',
-					'洛阳亲友如相问',
-					'一片冰心在玉壶'
-				],
-				swiper: [{
-						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
-						title: '昨夜星辰昨夜风,画楼西畔桂堂东'
-					},
-					{
-						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
-						title: '身无彩凤双飞翼,心有灵犀一点通'
-					},
-					{
-						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
-						title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
-					}
-				],
-				tabslist: [{
-					img: require("../../static/images/t-tools.png"),
-					name: '维修'
-				}, {
-					img: require("../../static/images/t-daijia.png"),
-					name: '代驾'
-				}, {
-					img: require("../../static/images/t-paotui.png"),
-					name: '跑腿'
-				}, {
-					img: require("../../static/images/t-shandian.png"),
-					name: '商店'
-				}, {
-					img: require("../../static/images/t-baojie.png"),
-					name: '家政'
-				}, {
-					img: require("../../static/images/t-yiliao.png"),
-					name: '医护'
-				}, {
-					img: require("../../static/images/t-bangjia.png"),
-					name: '搬家'
-				}, {
-					img: require("../../static/images/t-jipin.png"),
-					name: '祭品'
-				}],
-				flowList: [],
+				list: [],
+				swiper: [],
+				tabslist: [],
+				flowList: [],
+				hotlist:[]
 			}
 		},
 		onLoad() {
-			setTimeout(() => {
+			/* setTimeout(() => {
 				this.getlist()
-			}, 200)
-
+			}, 200) */
+			this.getad()
+		},
+		onShow() {
+			if (uni.getStorageSync("token")) {
+				this.$u.post('/UserMessage/getMessageReadFalseCount').then(res => {
+					if (res.code == 0) {
+						this.$refs.nav.count = res.response.count
+					}
+				})
+				this.getorder()
+			}else{
+				this.$refs.nav.count = 0
+				uni.removeTabBarBadge({
+					index:1,
+				})
+			}
 		},
 		methods: {
-			totabs(index){
-				if(index == 0){
-					uni.navigateTo({
-						url:"./weixiu"
+			getorder(){
+				this.$u.post('/Order/getOrderStatusCount').then(res => {
+					var num = 0
+					num = num + res.response.facilitator.pending_count
+					num = num + res.response.facilitator.received_count
+					num = num + res.response.user.comments_count
+					num = num + res.response.user.pending_count
+					num = num + res.response.user.received_count
+					uni.setTabBarBadge({
+						text:num.toFixed(0).toString(),
+						index:1,
 					})
-				}else if(index == 1){
-					uni.navigateTo({
-						url:"./daijia"
-					})
-				}else if(index == 2){
-					uni.navigateTo({
-						url:"./paotui"
-					})
-				}else if(index == 3){
-					uni.switchTab({
-						url:"../shop/shop"
-					})
-				}else{
-					uni.navigateTo({
-						url:"./other-tabs"
-					})
-				}
+				})
+			},
+			openbar(e){
+				this.$openad(this.list[e])
+			},
+			openad(e){
+				this.$openad(this.swiper[e])
+			},
+			async getad(){
+				var {response:{data}} = await this.$u.post('/Advertise/all',{
+					content:{
+						business:1,
+						device_type:0
+					}
+				})
+				data.forEach(val => {
+					if(val.type == 1){
+						this.swiper = val.advertise
+					}
+					if(val.type == 2){
+						this.list = val.advertise
+					}
+					if(val.type == 3){
+						this.tabslist =  val.advertise
+					}
+					if(val.type == 5){
+						this.hotlist =  val.advertise
+					}
+				})
+				console.log(this.list);
+			},
+			totabs(item){
+				this.$openad(item)
+				// if(index == 0){
+				// 	uni.navigateTo({
+				// 		url:"./weixiu"
+				// 	})
+				// }else if(index == 1){
+				// 	uni.navigateTo({
+				// 		url:"./daijia"
+				// 	})
+				// }else if(index == 2){
+				// 	uni.navigateTo({
+				// 		url:"./paotui"
+				// 	})
+				// }else if(index == 3){
+				// 	uni.switchTab({
+				// 		url:"../shop/shop"
+				// 	})
+				// }else{
+				// 	uni.navigateTo({
+				// 		url:"./other-tabs"
+				// 	})
+				// }
 			},
 			getlist() {
 				for (let i = 0; i < 10; i++) {
@@ -290,12 +317,33 @@
 					background-color: #F4CC14;
 					padding: 18rpx 30rpx;
 
-					text {
+					.text1 {
 						width: 100%;
 						display: -webkit-box;
 						-webkit-box-orient: vertical;
 						-webkit-line-clamp: 2;
 						overflow: hidden;
+					}
+					.goods-down{
+						text:first-child{
+							color: red;
+							font-size: 34rpx;
+							margin-right: 10rpx;
+						}
+						text:nth-child(2){
+							font-size: 24rpx;
+							text-decoration: line-through;
+							margin-right: 10rpx;
+						}
+						text:nth-child(3){
+							font-size: 30rpx;
+							color: #333333;
+							flex: 1;
+						}
+						text:nth-child(4){
+							font-size: 28rpx;
+							color: #28A47F;
+						}
 					}
 				}
 
@@ -327,23 +375,24 @@
 
 			.item {
 				width: 158rpx;
-				height: 158rpx;
+				// height: 158rpx;
 				border-radius: 100rpx;
 				// border: 5rpx solid #4AC885;
-				margin-bottom: 32rpx;
+				margin-bottom: 12rpx;
 				position: relative;
 
 				.text {
-					position: absolute;
-					top: 50%;
-					left: 50%;
-					transform: translate(-50%, -50%);
-					width: 75rpx;
-					height: 47rpx;
+					// position: absolute;
+					// top: 50%;
+					// left: 50%;
+					// transform: translate(-50%, -50%);
+					// width: 75rpx;
+					// height: 47rpx;
+					margin-top: 10rpx;
 					text-align: center;
-					line-height: 47rpx;
-					border-radius: 8rpx;
-					background-color: #F4CC17;
+					// line-height: 47rpx;
+					// border-radius: 8rpx;
+					// background-color: #F4CC17;
 				}
 
 				image {

+ 60 - 14
pages/index/index.vue

@@ -1,6 +1,8 @@
 <template>
 	<view class="index">
-		<image src="../../static/images/guanggao.jpeg" mode=""></image>
+		<image :src="image" v-if="image" mode="" @tap="openad"></image>
+		<image v-else src="../../static/images/guanggao.jpeg" mode=""></image>
+		<text class="tiaoguo" @tap="tohome">跳过{{s}}</text>
 	</view>
 </template>
 
@@ -8,24 +10,61 @@
 	export default {
 		data() {
 			return {
-				s: 1
+				s: 3,
+				image: '',
+				adobj:{},
+				time:null
 			}
 		},
 		onLoad() {
 			this.start()
+		},
+		onShow() {
+			if(this.time){
+				this.daojishi()
+			}
+		},
+		onHide() {
+			clearInterval(this.time)
 		},
-		methods: {
+		methods: {
+			tohome(){
+				clearInterval(this.time)
+				uni.switchTab({
+					url: "./home"
+				})
+			},
+			daojishi(){
+				this.time = setInterval(() => {
+					// console.log(this.s);
+					if (this.s == 0) {
+						this.tohome()
+					} else {
+						this.s--
+					}
+				}, 1000)
+			},
+			openad() {
+				this.$openad(this.adobj)
+			},
 			start() {
-				var time = setInterval(() => {
-					if (this.s == 0) {
-						clearInterval(time)
-						uni.switchTab({
-							url: "./home"
-						})
-					} else {
-						this.s--
+				this.$u.post('/Advertise/getFind', {
+					content: {
+						business: 4,
+						device_type: 0,
+						type: 0
 					}
-				}, 1000)
+				}).then(res => {
+					if (res.response.advertise.length > 0) {
+						this.image = res.response.advertise[0].advertise_image
+						this.adobj = {
+							advertise_type: res.response.advertise[0].advertise_type,
+							id: res.response.advertise[0].id
+						}
+						this.daojishi()
+					}
+				})
+
 			}
 		}
 	}
@@ -33,8 +72,15 @@
 
 <style lang="scss">
 	.index {
-		font-size: 0;
-
+		font-size: 0;
+		position: relative;
+		.tiaoguo{
+			position: absolute;
+			top: 50rpx;
+			left: 20rpx;
+			font-size: 30rpx;
+			color: #fff;
+		}
 		image {
 			width: 750rpx;
 			height: 100vh;

+ 381 - 70
pages/index/paotui.vue

@@ -15,16 +15,20 @@
 						描述要买的商品
 					</view>
 					<view class="form-box">
-						<textarea placeholder="填写想要代购的商品,如【充电器一个,矿泉水两瓶】,代购金额不得超过200元。" />
-						<view class="goods-tabs u-flex u-col-center">
-							<text v-for="(item,index) in 4" :key="index">文件</text>
-						</view>
-						<image class="image" src="../../static/images/648.png" mode=""></image>
+						<textarea placeholder="填写想要代购的商品,如【充电器一个,矿泉水两瓶】,代购金额不得超过200元。" v-model="remark" />
+						<view class="goods-tabs u-flex u-col-center u-flex-wrap">
+							<text v-for="(item,index) in wupinlist" :key="index" @click="remark = remark + item.title">{{item.title}}</text>
+						</view>
+						<u-upload :custom-btn="true" width="154rpx" height="154rpx" :action="url" :show-progress="true" :header="header" :formData="$getdata()"
+							:max-count="8" @on-success="uploadsuccess" @on-remove="delimg" name="img" @on-uploaded="uploadover"
+							@on-choose-complete='uploadstart'>
+							<image class="image" slot="addBtn" src="../../static/images/648.png" mode=""></image>
+						</u-upload>
 					</view>
 				</view>
 				<view class="feiyong-box u-flex u-col-center">
 					<text class="text1">商品费用:</text>
-					<input type="digit" placeholder="预计商品费用,用于骑手参考" />
+					<input type="digit" placeholder="预计商品费用,用于骑手参考" v-model="price" />
 				</view>
 				<view class="isfapiao">
 					<u-radio-group v-model="isfapiao" active-color="#0DA98C">
@@ -34,10 +38,10 @@
 				</view>
 				<view class="feiyong-box u-flex u-col-center" v-if="isfapiao == 2">
 					<text class="text1">发票抬头:</text>
-					<input type="digit" placeholder="填写发票抬头" />
+					<input type="digit" placeholder="填写发票抬头" v-model="fapiao"/>
 				</view>
 				<view class="isfapiao">
-					<u-radio-group v-model="isjiujin" active-color="#0DA98C">
+					<u-radio-group v-model="isjiujin" active-color="#0DA98C" @change="changeaddresstype">
 						<u-radio :name="1">指定地址购买</u-radio>
 						<u-radio :name="2">骑手就近购买</u-radio>
 					</u-radio-group>
@@ -46,19 +50,19 @@
 					<view class="address-item" @tap="toaddress(1)">
 						<view class="top u-flex u-col-center">
 							<text class="text1" style="background-color: #029FE9;">起</text>
-							<text class="text2">汕头市龙胡区新津街道长江路39号2栋123房</text>
-							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" />
+							<text class="text2">{{addresstext1 || '请选择地址'}}</text>
+							<input type="text" class="text3" placeholder="填写联系电话" v-if="isjiujin == 1" :disabled="true" v-model="addressphone1" />
 							<u-icon name="arrow-right"></u-icon>
 						</view>
 						<view class="down">
-							(购买地址)
+							({{isjiujin == 1 ? '购买地址' : '骑手自行选择购买商店'}})
 						</view>
 					</view>
 					<view class="address-item" @tap="toaddress(2)">
 						<view class="top u-flex u-col-center">
 							<text class="text1" style="background-color: #E8380A;">终</text>
-							<text class="text2">汕头市龙胡区新津街道长江路39号2栋123房</text>
-							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" />
+							<text class="text2">{{addresstext2 || '请选择地址'}}</text>
+							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" v-model="addressphone2" />
 							<u-icon name="arrow-right"></u-icon>
 						</view>
 						<view class="down">
@@ -66,18 +70,18 @@
 						</view>
 					</view>
 				</view>
-				<view class="qujian-time u-flex u-col-center u-row-between">
+				<view class="qujian-time u-flex u-col-center u-row-between" @click="show = true">
 					<text class="text1">送达时间:</text>
-					<input type="text" placeholder="选择时间" />
+					<input type="text" placeholder="选择时间" v-model="time" :disabled="true" />
 					<u-icon name="arrow-right"></u-icon>
 				</view>
 				<view class="xieyi-box u-flex u-col-center u-row-right">
 					<u-checkbox v-model="checked" active-color="#09AA8C"></u-checkbox>
 					<text @tap="checked = !checked">同意</text>
-					<text style="color: #3BBBA3;">《跑腿协议》</text>
+					<text style="color: #3BBBA3;" @click="toxieyi(6)">《跑腿协议》</text>
 				</view>
 				<view>
-					<x-button>确认下单</x-button>
+					<x-button @click="xiadan(1)">确认下单</x-button>
 				</view>
 			</view>
 			<view v-else>
@@ -85,8 +89,8 @@
 					<view class="address-item" @tap="toaddress(1)">
 						<view class="top u-flex u-col-center">
 							<text class="text1" style="background-color: #029FE9;">起</text>
-							<text class="text2">汕头市龙胡区新津街道长江路39号2栋123房</text>
-							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" />
+							<text class="text2">{{addresstext1 || '请选择地址'}}</text>
+							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" v-model="addressphone1" />
 							<u-icon name="arrow-right"></u-icon>
 						</view>
 						<view class="down">
@@ -96,8 +100,8 @@
 					<view class="address-item" @tap="toaddress(2)">
 						<view class="top u-flex u-col-center">
 							<text class="text1" style="background-color: #E8380A;">终</text>
-							<text class="text2">汕头市龙胡区新津街道长江路39号2栋123房</text>
-							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" />
+							<text class="text2">{{addresstext2 || '请选择地址'}}</text>
+							<input type="text" class="text3" placeholder="填写联系电话" :disabled="true" v-model="addressphone2" />
 							<u-icon name="arrow-right"></u-icon>
 						</view>
 						<view class="down">
@@ -105,20 +109,20 @@
 						</view>
 					</view>
 				</view>
-				<view class="qujian-time u-flex u-col-center u-row-between">
+				<view class="qujian-time u-flex u-col-center u-row-between" @click="show = true">
 					<text class="text1">取件时间:</text>
-					<input type="text" placeholder="选择时间" />
+					<input type="text" placeholder="选择时间" v-model="time" :disabled="true"/>
 					<u-icon name="arrow-right"></u-icon>
 				</view>
 				<view class="wupin-name u-flex u-col-center u-row-between">
 					<text class="text1">物品名称:</text>
 					<view class="wupin-right u-flex u-col-center">
-						<input type="text" placeholder="文件、蛋糕、鲜花、餐饮等" />
-						<u-icon name="arrow-down-fill"></u-icon>
+						<input type="text" placeholder="文件、蛋糕、鲜花、餐饮等" v-model="wupinname" />
+						<u-icon name="arrow-down-fill" @click="showwupin = true"></u-icon>
 					</view>
 				</view>
 				<view class="zhongliang u-flex u-col-center u-row-between">
-					<text class="text1">物品名称:</text>
+					<text class="text1">物品重量:</text>
 					<view style="flex: 1;padding: 0 20rpx;">
 						<u-slider v-model="value" activeColor="#09AA8C" height="15" :step="5"></u-slider>
 					</view>
@@ -128,13 +132,18 @@
 				<view class="xieyi-box u-flex u-col-center u-row-right">
 					<u-checkbox v-model="checked" active-color="#09AA8C"></u-checkbox>
 					<text @tap="checked = !checked">同意</text>
-					<text style="color: #3BBBA3;">《跑腿协议》</text>
+					<text style="color: #3BBBA3;" @click="toxieyi(6)">《跑腿协议》</text>
 				</view>
 				<view>
-					<x-button>确认下单</x-button>
+					<x-button @click="xiadan(1)">确认下单</x-button>
 				</view>
 			</view>
-		</view>
+		</view>
+		<view style="color: #2AA47F;text-align: center;padding: 20rpx 0;" @click="toxieyi(17)">
+			计价方法和计价介绍
+		</view>
+		<u-select v-model="show" mode="mutil-column-auto" :list="timelist" @confirm="confirm"></u-select>
+		<u-select v-model="showwupin" :list="wupinlist" @confirm="confirm1" value-name="id" label-name="title"></u-select>
 	</view>
 </template>
 
@@ -146,69 +155,370 @@
 				longitude: '',
 				latitude1: '',
 				longitude1: '',
-				markers: [],
-				addresstext: '',
-				type: 3,
+				// markers: [],
+				addresstext1: '',
+				addresstextid1:'',
+				addressphone1:'',
+				
+				addresstext2: '',
+				addresstextid2:'',
+				addressphone2:'',
+				type: 1,
 				value: '',
 				checked: false,
 				isfapiao: 1,
-				isjiujin:1
+				isjiujin:1,
+				showwupin:false,
+				wupinlist:[],
+				wupinname:'',
+				timelist:[],
+				time:'',
+				show:false,
+				remark:'',
+				url: this.$url + '/Image/uploadImg',
+				header: {
+					token: uni.getStorageSync("token")
+				},
+				imglist_code:[],
+				price:'',
+				fapiao:'',
+				
 			}
 		},
-		onLoad() {
+		onLoad() {
+			this.gettype()
+			this.gettime()
 			this.myAmapFun.getRegeo({
-				success: (res) => {
+				success: (res) => {
 					this.latitude = res[0].latitude
 					this.longitude = res[0].longitude
 					this.latitude1 = res[0].latitude
-					this.longitude1 = res[0].longitude
-					this.markers.push({
-						id: 1,
-						latitude: res[0].latitude,
-						longitude: res[0].longitude
-					})
+					this.longitude1 = res[0].longitude
+					this.addresstext1 = res[0].name
+					// this.markers.push({
+					// 	id: 1,
+					// 	latitude: res[0].latitude,
+					// 	longitude: res[0].longitude
+					// })
 				}
 			})
-			// uni.getLocation({
-			// 	altitude: true,
-			// 	type: "gcj02",
-			// 	success: (res) => {
-			// 		this.latitude = res.latitude
-			// 		this.longitude = res.longitude
-			// 		this.latitude1 = res.latitude
-			// 		this.longitude1 = res.longitude
-			// 		this.markers.push({
-			// 			id: 2,
-			// 			latitude: res.latitude,
-			// 			longitude: res.longitude
-			// 		})
-			// 		console.log(this.markers);
-			// 	}
-			// })
 		},
 		methods: {
-			toaddress(){
+			changeaddresstype(e){
+				if(e == 2){
+					this.addresstext1 = '骑手就近购买'
+				}else{
+					this.addresstext1 = ''
+				}
+			},
+			uploadstart() {
+				uni.showLoading({
+					mask: true,
+					title: "上传中"
+				})
+			},
+			uploadover() {
+				// console.log(123);
+				uni.hideLoading()
+			},
+			delimg(e) {
+				this.imglist_code.splice(e, 1)
+			},
+			uploadsuccess(e) {
+				// this.imglist.push(e.response.src)
+				this.imglist_code.push(e.response.code)
+				// console.log(e);
+			},
+			confirm1(e){
+				this.wupinname = e[0].label
+			},
+			confirm(e) {
+				this.time = `${e[0].value}-${e[0].label}-${e[1].label} ${e[2].label}`
+			},
+			gettime(){
+				this.$u.post('/Order/getComeTime').then(res => {
+					this.timelist = []
+					res.response.data.forEach(month => {
+						var month1 = []
+						month.data.forEach(day => {
+							var day1 = []
+							day.times.forEach(time => {
+								day1.push({
+									label: time
+								})
+							})
+							month1.push({
+								label: day.day,
+								children: day1
+							})
+						})
+						this.timelist.push({
+							label: month.month,
+							children: month1,
+							value:month.year
+						})
+					})
+					this.time = `${this.timelist[0].value}-${this.timelist[0].label}-${this.timelist[0].children[0].label} ${this.timelist[0].children[0].children[0].label}`
+				})
+			},
+			gettype(){
+				this.$u.post('/OrderRun/thingNameList').then(res => {
+					this.wupinlist = res.response.data
+				})
+			},
+			xiadan(type){
+				if(this.type == 1){
+					if(!this.addresstextid1 || !this.addresstextid1){
+						this.$u.toast("请选择地址")
+						return
+					}
+					if(!this.addresstextid2 || !this.addresstextid2){
+						this.$u.toast("请选择地址")
+						return
+					}
+					if(this.value == 0){
+						this.$u.toast("请选择重量")
+						return
+					}
+					if(!this.checked){
+						this.$u.toast("请勾选协议")
+						return
+					}
+					this.$u.post('/OrderRun/addRunBySend',{
+						content:{
+							come_time:this.time,
+							end_user_address_id:this.addresstextid2,
+							is_check:type,
+							remark:this.wupinname,
+							start_user_address_id:this.addresstextid1,
+							weight:this.value/5,
+						}
+					}).then(res => {
+						if(res.code == 0){
+							if(type == 1){
+								uni.showModal({
+									content:res.msg,
+									confirmText:"立即下单",
+									success: (res) => {
+										if(res.confirm){
+											this.xiadan(0)
+										}
+									}
+								})
+							}else{
+								var orderid = res.response.order_no
+								uni.showModal({
+									content:"下单成功",
+									confirmText:"查看详情",
+									cancelText:"返回首页",
+									success: (res) => {
+										if(res.confirm){
+											uni.navigateTo({
+												url:"../order/order-info?id=" + orderid
+											})
+										}else{
+											uni.switchTab({
+												url:"./home"
+											})
+										}
+									}
+								})
+							}
+							
+						}else{
+							this.$u.toast(res.msg)
+						}
+					})
+				}else if(this.type == 2){
+					if(!this.addresstextid1 || !this.addresstextid1){
+						this.$u.toast("请选择地址")
+						return
+					}
+					if(!this.addresstextid2 || !this.addresstextid2){
+						this.$u.toast("请选择地址")
+						return
+					}
+					if(this.value == 0){
+						this.$u.toast("请选择重量")
+						return
+					}
+					if(!this.checked){
+						this.$u.toast("请勾选协议")
+						return
+					}
+					this.$u.post('/OrderRun/addRunByTake',{
+						content:{
+							come_time:this.time,
+							end_user_address_id:this.addresstextid2,
+							is_check:type,
+							remark:this.wupinname,
+							start_user_address_id:this.addresstextid1,
+							weight:this.value/5,
+						}
+					}).then(res => {
+						if(res.code == 0){
+							if(type == 1){
+								uni.showModal({
+									content:res.msg,
+									confirmText:"立即下单",
+									success: (res) => {
+										if(res.confirm){
+											this.xiadan(0)
+										}
+									}
+								})
+							}else{
+								var orderid = res.response.order_no
+								uni.showModal({
+									content:"下单成功",
+									confirmText:"查看详情",
+									cancelText:"返回首页",
+									success: (res) => {
+										if(res.confirm){
+											uni.navigateTo({
+												url:"../order/order-info?id=" + orderid
+											})
+										}else{
+											uni.switchTab({
+												url:"./home"
+											})
+										}
+									}
+								})
+							}
+							
+						}else{
+							this.$u.toast(res.msg)
+						}
+					})
+				}else if(this.type == 3){
+					if(!this.remark){
+						this.$u.toast("请输入要买的商品")
+						return
+					}
+					if(!this.price){
+						this.$u.toast("请输入预计商品费用")
+						return
+					}
+					if(this.isfapiao == 2){
+						if(!this.fapiao){
+							this.$u.toast("请输入发票抬头")
+							return
+						}
+					}
+					if(this.isjiujin == 1){
+						if(!this.addresstextid1 || !this.addresstextid1){
+							this.$u.toast("请选择地址")
+							return
+						}
+					}
+					if(!this.addresstextid2 || !this.addresstextid2){
+						this.$u.toast("请选择地址")
+						return
+					}
+					if(!this.checked){
+						this.$u.toast("请勾选协议")
+						return
+					}
+					this.$u.post('/OrderRun/addRunByBuy',{
+						content:{
+							come_time:this.time,
+							end_user_address_id:this.addresstextid2,
+							fee:this.price,
+							image_gather_code:this.imglist_code,
+							invoice_title:this.fapiao,
+							is_check:type,
+							is_invoice:this.isfapiao == 1 ? 0 : 1,
+							is_nearby:this.isjiujin == 1 ? 0 : 1,
+							remark:this.remark,
+							start_user_address_id:this.isjiujin == 1 ? this.addresstextid1 : '',
+						}
+					}).then(res => {
+						if(res.code == 0){
+							if(type == 1){
+								uni.showModal({
+									content:res.msg,
+									confirmText:"立即下单",
+									success: (res) => {
+										if(res.confirm){
+											this.xiadan(0)
+										}
+									}
+								})
+							}else{
+								var orderid = res.response.order_no
+								uni.showModal({
+									content:"下单成功",
+									confirmText:"查看详情",
+									cancelText:"返回首页",
+									success: (res) => {
+										if(res.confirm){
+											uni.navigateTo({
+												url:"../order/order-info?id=" + orderid
+											})
+										}else{
+											uni.switchTab({
+												url:"./home"
+											})
+										}
+									}
+								})
+							}
+							
+						}else{
+							this.$u.toast(res.msg)
+						}
+					})
+				}
+			},
+			toxieyi(num){
+				uni.navigateTo({
+					url:"../mine/all-tips?type=" + num
+				})
+			},
+			toaddress(type){
+				if(this.type == 3 && this.isjiujin == 2 && type == 1){
+					return
+				}
 				uni.navigateTo({
-					url:"./change-address"
+					url:"./change-address",
+					events:{
+						changeaddress:(res) => {
+							if(type == 1){
+								this.addresstext1 = res.address
+								this.addresstextid1 = res.id
+								this.addressphone1 = res.phone
+							}else{
+								this.addresstext2 = res.address
+								this.addresstextid2 = res.id
+								this.addressphone2 = res.phone
+							}
+						}
+					}
 				})
 			},
-			regionchange(e) {
+			regionchange(e) {
+				if(this.type == 3 && this.isjiujin == 2){
+					return
+				}
 				if (e.type == 'end' && e.detail.centerLocation.longitude > 0) {
 					this.latitude1 = e.detail.centerLocation.latitude
 					this.longitude1 = e.detail.centerLocation.longitude
 
-					var num = this.markers.length - 1
-					this.markers.push({
-						id: this.markers[num].id + 1,
-						latitude: e.detail.centerLocation.latitude,
-						longitude: e.detail.centerLocation.longitude
-					})
+					// var num = this.markers.length - 1
+					// this.markers.push({
+					// 	id: this.markers[num].id + 1,
+					// 	latitude: e.detail.centerLocation.latitude,
+					// 	longitude: e.detail.centerLocation.longitude
+					// })
 
 					this.myAmapFun.getRegeo({
 						location: this.longitude1 + "," + this.latitude1,
 						success: (res) => {
-							this.addresstext = res[0].name + res[0].desc
-							console.log(res[0].name + res[0].desc);
+							this.addresstext1 = res[0].name + res[0].desc
+							this.addresstextid1 = ''
+							this.addressphone1 = ''
+							// console.log(res[0].name + res[0].desc);
 						},
 						fail: (err) => {
 							console.log(err);
@@ -224,10 +534,11 @@
 </script>
 
 <style lang="scss">
-	.paotui {
+	.paotui {
+		background-color: #fff;
 		.paotui-box {
 			padding: 10rpx 30rpx 30rpx 30rpx;
-			background-color: #fff;
+			
 
 			.feiyong-box {
 				padding: 20rpx 0;

+ 234 - 45
pages/index/weixiu.vue

@@ -3,17 +3,17 @@
 		<view class="qiehuan-box u-flex u-col-center u-row-right">
 			<text @tap="tochange">切换地址</text>
 		</view>
-		<view class="address-box">
+		<view class="address-box" v-if="address.id">
 			<view class="user-top u-flex u-col-center">
-				<text>用户姓名</text>
-				<text>15916663977</text>
+				<text>{{address.name}}</text>
+				<text>{{address.phone}}</text>
 			</view>
 			<view class="address-text">
-				广东省汕头市龙湖区地址广东省汕头市龙湖区地址广东省汕头市龙湖区地址
+				{{address.address}}{{address.location_address}}
 			</view>
 		</view>
-		<view class="yuyue-time u-flex u-col-center u-row-between">
-			<text class="text1">预约上门时间</text>
+		<view class="yuyue-time u-flex u-col-center u-row-between" @tap="show = true">
+			<text class="text1">{{time || '预约上门时间'}}</text>
 			<view class="right u-flex u-col-center">
 				<text>选择时间</text>
 				<image src="../../static/images/fuwu-time.png" mode=""></image>
@@ -21,32 +21,45 @@
 		</view>
 		<view class="title-text">需求描述</view>
 		<view class="type-box u-flex u-col-center">
-			<text :class="type == 1 ? 'text' : ''" @click="type = 1">水</text>
-			<text :class="type == 2 ? 'text' : ''" @click="type = 2">电</text>
+			<text :class="type == index ? 'text' : ''" @click="changetype(index)" v-for="(item,index) in typelist"
+				:key="index">{{item.title}}</text>
 		</view>
-		<view class="change-type u-flex u-col-center u-row-between">
-			<text class="text">水管</text>
-			<u-icon name="arrow-down-fill"></u-icon>
-		</view>
-		<view class="upload-img u-flex u-col-center u-flex-wrap">
-			<image src="../../static/images/648.png" mode=""></image>
+		<picker mode="selector" :range="typechild" range-key="title" @change="changetypechild">
+			<view class="change-type u-flex u-col-center u-row-between">
+				<text class="text">{{typechildtext}}</text>
+				<u-icon name="arrow-down-fill"></u-icon>
+			</view>
+		</picker>
+		<view class="upload-img u-flex u-col-center u-flex-wrap">
+			<u-upload :custom-btn="true" width="154rpx" height="154rpx" :action="url" :show-progress="true" :header="header" :formData="$getdata()"
+				:max-count="8" @on-success="uploadsuccess" @on-remove="delimg" name="img" @on-uploaded="uploadover"
+				@on-choose-complete='uploadstart'>
+				<image class="upload" slot="addBtn" src="../../static/images/648.png" mode=""></image>
+			</u-upload>
 		</view>
 		<view class="upload-tips">
 			*您可以提供故障器件或故障现象的照片(选填)
+		</view>
+		<view class="textarea">
+			<textarea placeholder="您可以选择或填写故障的具体情况" v-model="text" />
+		</view>
+		<view class="upload-tips">
+			*您可以选择或填写故障的具体情况(选填)
+		</view>
+		<view class="type-box u-flex u-col-center">
+			<text @click="changetext(item.title)" v-for="(item,index) in guzhanglist" :key="index">{{item.title}}</text>
 		</view>
-		<view class="textarea">
-			<textarea placeholder="您可以选择或填写故障的具体情况" />
-		</view>
-		<view class="upload-tips">
-			*您可以选择或填写故障的具体情况(选填)
-		</view>
-		<view class="type-box u-flex u-col-center">
-			<text :class="type == 1 ? 'text' : ''" @click="type = 1">漏水</text>
-			<text :class="type == 2 ? 'text' : ''" @click="type = 2">漏水</text>
+		<view class="xieyi-box u-flex u-col-center u-row-right">
+			<u-checkbox v-model="xieyi" active-color="rgba(8, 170, 140, 1)">同意</u-checkbox>
+			<text class="text1" @tap="toxieyi(13)">《水电维修服务协议》</text>
+		</view>
+		<view style="margin: 56rpx 0;">
+			<x-button color="#000" @click="yuyue(1)">确认预约</x-button>
 		</view>
-		<view style="margin: 56rpx 0;">
-			<x-button color="#000">确认预约</x-button>
+		<view style="text-align: center;color: rgba(8, 170, 140, 1);padding-bottom: 20rpx;" @click="toxieyi(18)">
+			计价方法和计价介绍
 		</view>
+		<u-select v-model="show" mode="mutil-column-auto" :list="timelist" @confirm="confirm"></u-select>
 	</view>
 </template>
 
@@ -54,17 +67,183 @@
 	export default {
 		data() {
 			return {
-				type: 1
+				type: 0,
+				typelist: [],
+				typechild: [],
+				typechildtext: '',
+				typechildid: '',
+				timelist: [],
+				time: '',
+				show: false,
+				guzhanglist:[],
+				guzhang:0,
+				text:'',
+				address:{},
+				url: this.$url + '/Image/uploadImg',
+				header: {
+					token: uni.getStorageSync("token")
+				},
+				imglist_code:[],
+				xieyi:false
 			}
 		},
 		onLoad() {
-
+			this.getdata()
+		},
+		onShow() {
+			if(!this.address.id){
+				this.getaddress()
+			}
 		},
-		methods: {
-			tochange(){
+		methods: {
+			toxieyi(type) {
 				uni.navigateTo({
-					url:"../mine/address-list"
+					url: "../mine/all-tips?type=" + type
 				})
+			},
+			yuyue(type){
+				if(!this.xieyi){
+					this.$u.toast("请勾选协议")
+					return
+				}
+				if(!this.address.id){
+					this.$u.toast("请选择地址")
+					return
+				}
+				if(this.imglist_code.length == 0){
+					this.$u.toast("请上传图片")
+					return
+				}
+				this.$u.post('/OrderRepair/add',{
+					content:{
+						is_check:type,
+						user_address_id:this.address.id,
+						classify_id:this.typechildid,
+						come_time:this.time,
+						remark:this.text,
+						image_gather_code:this.imglist_code
+					}
+				}).then(res => {
+					if(res.code == 0){
+						if(type == 1){
+							uni.showModal({
+								content:res.msg,
+								confirmText:"立即下单",
+								success: (res) => {
+									if(res.confirm){
+										this.yuyue(0)
+									}
+								}
+							})
+						}else{
+							var orderid = res.response.order_no
+							uni.showModal({
+								content:"下单成功",
+								confirmText:"查看详情",
+								cancelText:"返回首页",
+								success: (res) => {
+									if(res.confirm){
+										uni.navigateTo({
+											url:"../order/order-info?id=" + orderid
+										})
+									}else{
+										uni.switchTab({
+											url:"./home"
+										})
+									}
+								}
+							})
+						}
+						
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			uploadstart() {
+				uni.showLoading({
+					mask: true,
+					title: "上传中"
+				})
+			},
+			uploadover() {
+				// console.log(123);
+				uni.hideLoading()
+			},
+			delimg(e) {
+				this.imglist_code.splice(e, 1)
+			},
+			uploadsuccess(e) {
+				// this.imglist.push(e.response.src)
+				this.imglist_code.push(e.response.code)
+				// console.log(e);
+			},
+			getaddress(){
+				this.$u.post('/UserAddress/list').then(res => {
+					this.address = res.response.data[0] || {}
+				})
+			},
+			changetext(text){
+				this.text = this.text + text
+			},
+			confirm(e) {
+				this.time = `${e[0].value}-${e[0].label}-${e[1].label} ${e[2].label}`
+			},
+			changetypechild(e) {
+				this.typechildtext = this.typechild[e.detail.value].title
+				this.typechildid = this.typechild[e.detail.value].id
+				this.guzhanglist = this.typechild[e.detail.value].tag
+			},
+			changetype(index) {
+				this.type = index
+				this.typechild = this.typelist[this.type].child
+				this.typechildtext = this.typechild[0].title
+				this.typechildid = this.typechild[0].id
+				this.guzhanglist = this.typechild[0].tag
+			},
+			getdata() {
+				this.$u.post('/OrderRepair/allByRepair').then(res => {
+					this.typelist = res.response.data
+					this.typechild = this.typelist[this.type].child
+					this.typechildtext = this.typechild[0].title
+					this.typechildid = this.typechild[0].id
+					this.guzhanglist = this.typechild[0].tag
+				})
+				this.$u.post('/Order/getComeTime').then(res => {
+					this.timelist = []
+					res.response.data.forEach(month => {
+						var month1 = []
+						month.data.forEach(day => {
+							var day1 = []
+							day.times.forEach(time => {
+								day1.push({
+									label: time
+								})
+							})
+							month1.push({
+								label: day.day,
+								children: day1
+							})
+						})
+						this.timelist.push({
+							label: month.month,
+							children: month1,
+							value:month.year
+						})
+					})
+					this.time = `${this.timelist[0].value}-${this.timelist[0].label}-${this.timelist[0].children[0].label} ${this.timelist[0].children[0].children[0].label}`
+				})
+			},
+			tochange() {
+				uni.navigateTo({
+					url: "../mine/address-list",
+					events:{
+						changeadd:(res)  => {
+							this.address = res
+						}
+					}
+					
+				})
 			}
 		}
 	}
@@ -72,28 +251,38 @@
 
 <style lang="scss">
 	.weixiu {
-		.textarea{
-			width: 685rpx;
-			border: 1rpx solid #A0A0A0;
-			background-color: #fff;
-			border-radius: 20rpx;
-			padding: 22rpx;
-			margin: 0 auto;
-			textarea{
-				width: 100%;
+		.xieyi-box {
+			padding: 0 24rpx;
+			margin-bottom: 35rpx;
+		
+			.text1 {
+				color: rgba(8, 170, 140, 1);
 			}
 		}
-		.upload-tips {
-			padding: 30rpx;
-			font-size: 25rpx;
-			font-family: SimHei;
-			font-weight: 400;
+		.textarea {
+			width: 685rpx;
+			border: 1rpx solid #A0A0A0;
+			background-color: #fff;
+			border-radius: 20rpx;
+			padding: 22rpx;
+			margin: 0 auto;
+
+			textarea {
+				width: 100%;
+			}
+		}
+
+		.upload-tips {
+			padding: 30rpx;
+			font-size: 25rpx;
+			font-family: SimHei;
+			font-weight: 400;
 		}
 
 		.upload-img {
 			padding: 0 30rpx;
 
-			image {
+			.upload {
 				width: 154rpx;
 				height: 154rpx;
 				border-radius: 20rpx;

+ 41 - 0
pages/index/wenzhang.vue

@@ -0,0 +1,41 @@
+<template>
+	<view style="padding: 24rpx;">
+		<rich-text :nodes="content"></rich-text>
+	</view>
+</template>
+
+<script>
+	export default {
+		data(){
+			return{
+				id:'',
+				content:''
+			}
+		},
+		onLoad(option) {
+			this.id = option.id
+			
+		},
+		onShow() {
+			this.getdata()
+		},
+		methods:{
+			getdata(){
+				this.$u.post('/Auth/getProtocolById',{
+					content:{
+						id:this.id
+					}
+				}).then(res => {
+					uni.setNavigationBarTitle({
+						title:res.response.title || ''
+					})
+					this.content = res.response.content
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	
+</style>

+ 90 - 15
pages/mine/address-list.vue

@@ -1,19 +1,17 @@
 <template>
 	<view class="address-list">
-		<view class="address-item" v-for="(item,index) in 2" :key="index">
+		<view class="address-item" v-for="(item,index) in list" :key="index" @tap="changeaddress(item)">
 			<view class="header u-flex u-col-center u-row-right">
-				<text>删除</text>
-				<text>修改</text>
+				<text @tap.stop="del(item)">删除</text>
+				<text @tap.stop="toset(item)">修改</text>
 			</view>
-			<view class="moren">设为默认地址</view>
+			<view class="moren" v-if="item.is_default == 0" @tap.stop="setmoren(item)">设为默认地址</view>
+			<view class="moren" v-if="item.is_default == 1" style="color: #F08A53;">默认地址</view>
 			<view class="name">
-				啦啦啦
-			</view>
-			<view class="tel">
-				18888888888
+				{{item.name}} {{item.phone}}
 			</view>
 			<view class="address-text">
-				啦啦啦
+				{{item.location_address}} {{item.address}}
 			</view>
 		</view>
 		<view style="height: 120rpx;"></view>
@@ -27,16 +25,93 @@
 	export default {
 		data() {
 			return {
-
+				page: 1,
+				list: [],
+				count: 0,
+				type:0
 			}
+		},
+		onLoad(option) {
+			this.type = option.type
 		},
-		onLoad() {
-
+		onShow() {
+			this.page = 1
+			this.getlist()
+		},
+		onReachBottom() {
+			if (this.count != this.list.length) {
+				this.page++
+				this.getlist()
+			}
 		},
-		methods: {
+		methods: {
+			changeaddress(item){
+				const eventChannel = this.getOpenerEventChannel();
+				eventChannel.emit('changeadd', item);
+				uni.navigateBack()
+			},
+			del(item) {
+				uni.showModal({
+					content: "确定删除吗?",
+					success: (res) => {
+						if (res.confirm) {
+							this.$u.post('/UserAddress/delete', {
+								content: {
+									id: item.id
+								}
+							}).then(res => {
+								this.$u.toast(res.msg)
+								if (res.code == 0) {
+									setTimeout(() => {
+										this.page = 1
+										this.getlist()
+									}, 800)
+								}
+							})
+						}
+					}
+				})
+			},
+			toset(item) {
+				uni.navigateTo({
+					url: "./address-set?item=" + encodeURIComponent(JSON.stringify(item))
+				})
+			},
+			setmoren(item) {
+				this.$u.post('/UserAddress/quickSetDefault', {
+					content: {
+						id: item.id
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							this.page = 1
+							this.getlist()
+						}, 800)
+					}
+
+				})
+			},
+			getlist() {
+				this.$u.post('/UserAddress/list', {
+					content: {
+						limit: 10,
+						list_type: 'page',
+						page: this.page
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if (this.page == 1) {
+						this.list = res.response.data
+					} else {
+						this.list = this.list.concat(res.response.data)
+					}
+				})
+			},
 			toadd() {
-				uni.navigateTo({
-					url:"./address-set"
+				uni.navigateTo({
+					url: "./address-set"
 				})
 			}
 		}

+ 91 - 9
pages/mine/address-set.vue

@@ -3,27 +3,27 @@
 		<view class="form-box">
 			<view class="row-input u-flex u-col-center">
 				<text class="text">联系人:</text>
-				<input type="text" placeholder="请输入联系人" />
+				<input type="text" placeholder="请输入联系人" v-model="name"/>
 			</view>
 			<view class="row-input u-flex u-col-center">
 				<text class="text">联系电话:</text>
-				<input type="text" placeholder="请输入联系电话" />
+				<input type="text" placeholder="请输入联系电话" v-model="tel"/>
 			</view>
 			<view class="row-input u-flex u-col-center" @tap="openmap">
 				<text class="text">定位地址:</text>
-				<input type="text" placeholder="请选择地址" :disabled="true"/>
+				<input type="text" placeholder="请选择地址" :disabled="true" v-model="address"/>
 				<u-icon name="arrow-right" color="#09AA8C"></u-icon>
 			</view>
 		</view>
 		<view class="textarea">
-			<textarea></textarea>
+			<textarea v-model="addresstext"></textarea>
 		</view>
 		<view class="moren-box u-flex u-col-center u-row-right">
 			<text class="text">默认地址</text>
 			<u-switch v-model="checked" active-color="#09AA8C"></u-switch>
 		</view>
 		<view class="text2">
-			<x-button>修改地址</x-button>
+			<x-button @click="save">{{id ? '修改地址' : '保存地址'}}</x-button>
 		</view>
 	</view>
 </template>
@@ -32,16 +32,98 @@
 	export default {
 		data() {
 			return {
-				checked: false
+				checked: false,
+				name:'',
+				tel:'',
+				address:'',
+				addresstext:'',
+				latitude:'',
+				longitude:'',
+				id:''
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			if(option.item){
+				var item = JSON.parse(decodeURIComponent(option.item))
+				this.name = item.name
+				this.tel = item.phone
+				this.address = item.location_address
+				this.addresstext = item.address
+				this.latitude = item.lat
+				this.longitude = item.lng
+				this.id = item.id
+				this.checked = item.is_default == 1 ? true : false
+			}
 		},
-		methods: {
+		methods: {
+			save(){
+				if(!this.name){
+					this.$u.toast("请输入联系人")
+					return
+				}
+				if(!this.tel){
+					this.$u.toast("请输入手机号")
+					return
+				}
+				if(!this.address){
+					this.$u.toast("请选择地址")
+					return
+				}
+				if(!this.addresstext){
+					this.$u.toast("请输入详细地址")
+					return
+				}
+				if(this.id){
+					this.$u.post('/UserAddress/update',{
+						content:{
+							address:this.addresstext,
+							id:this.id,
+							is_default:this.checked ? 1 : 0,
+							is_user_add:1,
+							lat:this.latitude,
+							lng:this.longitude,
+							location_address:this.address,
+							name:this.name,
+							phone:this.tel,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if(res.code == 0){
+							setTimeout(() => {
+								uni.navigateBack()
+							},800)
+						}
+					})
+				}else{
+					this.$u.post('/UserAddress/add',{
+						content:{
+							address:this.addresstext,
+							is_default:this.checked ? 1 : 0,
+							is_user_add:1,
+							lat:this.latitude,
+							lng:this.longitude,
+							location_address:this.address,
+							name:this.name,
+							phone:this.tel,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if(res.code == 0){
+							setTimeout(() => {
+								uni.navigateBack()
+							},800)
+						}
+					})
+				}
+				
+			},
 			openmap(){
 				uni.chooseLocation({
 					success: (res) => {
+						this.address = res.name
+						this.addresstext = res.address
+						this.latitude = res.latitude
+						this.longitude = res.longitude
 						console.log(res);
 					}
 				})

+ 40 - 0
pages/mine/all-tips.vue

@@ -0,0 +1,40 @@
+<template>
+	<view class="all-tips">
+		<rich-text :nodes="content"></rich-text>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				content: ''
+			}
+		},
+		onLoad(option) {
+			// type类型:0注册协议1登录协议2关于我们3绑定手机号说明,4绑定问答说明,5安全设置说明,6跑腿协议,7申请成为服务人员协议,8开通服务协议,9实名认证协议,10广告文章,
+			// 11商品平台用户服务协议,12代驾计价方式与介绍,13水电工服务三方协议,14隐私政策,15软件使用协议,16代驾服务三方协议,17跑腿计费介绍与方式,18水电维修计费介绍与方式
+			this.getdata(option.type)
+		},
+		methods: {
+			getdata(type) {
+				this.$u.post('/Auth/getProtocol', {
+					content: {
+						type: type
+					}
+				}).then(res => {
+					this.content = res.response.content
+					uni.setNavigationBarTitle({
+						title: res.response.title
+					})
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.all-tips {
+		padding: 24rpx;
+	}
+</style>

+ 6 - 1
pages/mine/anquan.vue

@@ -13,7 +13,7 @@
 				<u-icon name="arrow-right"></u-icon>
 			</view>
 		</view>
-		<view class="other u-flex u-col-center u-row-right">
+		<view class="other u-flex u-col-center u-row-right" @tap="totips">
 			<u-icon name="question-circle" color="#56AC9B" size="38"></u-icon>
 			<text class="text2">安全设置介绍</text>
 		</view>
@@ -31,6 +31,11 @@
 
 		},
 		methods: {
+			totips(){
+				uni.navigateTo({
+					url:"./all-tips?type=5"
+				})
+			},
 			towen(){
 				uni.navigateTo({
 					url:"./wenda-list"

+ 132 - 0
pages/mine/bangding.vue

@@ -0,0 +1,132 @@
+<template>
+	<view class="bangding">
+		<view class="form-box">
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">手机号</text>
+				<input type="number" placeholder="请输入找回密码手机号" v-model="phone" :disabled="true" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">验证码</text>
+				<input type="number" placeholder="请输入短信验证码" v-model="code" />
+				<text class="text2" @click="getCode">{{tips}}</text>
+			</view>
+		</view>
+		<!-- <view class="xieyi u-flex u-col-center u-row-center">
+			<u-checkbox v-model="checked" active-color="#08AA8C;"></u-checkbox>
+			<view>
+				<text @tap="checked = !checked">阅读并同意</text>
+				<text style="color: #08AA8C;">《登录/注册协议》</text>
+			</view>
+		</view> -->
+		<view>
+			<x-button @click="bangding">绑定</x-button>
+		</view>
+		<u-verification-code :seconds="seconds" ref="uCode" @change="codeChange">
+		</u-verification-code>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				phone: '',
+				code: '',
+				checked: false,
+				tips: '获取验证码',
+				// refCode: null,
+				seconds: 60,
+			}
+		},
+		onLoad(option) {
+			this.phone = option.phone
+		},
+		methods: {
+			bangding() {
+				if (!this.code) {
+					this.$u.toast("请输入验证码")
+					return
+				}
+				uni.getUserProfile({
+					desc: "获取用户信息",
+					success: (user) => {
+						console.log(user);
+						this.$u.post('/Auth/phoneCaptchaLoginRegister', {
+							content: {
+								code: this.code,
+								headimgurl:user.userInfo.avatarUrl,
+								nickname:user.userInfo.nickName,
+								phone: this.phone,
+							}
+						}).then(res => {
+							this.$u.toast(res.msg)
+							if (res.code == 0) {
+								uni.setStorageSync("token", res.response.token)
+								setTimeout(() => {
+									uni.switchTab({
+										url: "./mine"
+									})
+								}, 800)
+							}
+						})
+					}
+				})
+			},
+			codeChange(text) {
+				this.tips = text;
+			},
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					this.$u.post('/Auth/smsMobileCaptcha', {
+						content: {
+							account_phone: this.phone,
+							captcha_type: 0,
+							phone: this.phone,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if (res.code == 0) {
+							this.$refs.uCode.start();
+						}
+					})
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.bangding {
+		.xieyi {
+			margin-top: 28rpx;
+		}
+
+		.form-box {
+			padding: 36rpx;
+
+			.form-item {
+				height: 100rpx;
+
+				.text2 {
+					width: 180rpx;
+					text-align: right;
+				}
+
+				.text {
+					width: 150rpx;
+					font-size: 33rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
+
+				input {
+					flex: 1;
+					border-bottom: 4rpx solid #56C5B1;
+				}
+			}
+		}
+	}
+</style>

+ 148 - 47
pages/mine/change-pwd.vue

@@ -1,41 +1,43 @@
 <template>
-	<view class="change-pwd">
-		<view class="header u-flex u-col-center">
-			<text>手机号:</text>
-			<text>12f23f23(已绑定)</text>
+	<view class="change-pwd" v-if="userdata.id">
+		<view class="header u-flex u-col-center">
+			<text>手机号:</text>
+			<text>{{userdata.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}(已绑定)</text>
 		</view>
-		<view class="form-box">
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">验证码</text>
-				<input type="number" placeholder="请输入短信验证码"/>
-				<text class="text1">获取验证码</text>
+		<view class="form-box" v-if="userdata.is_set_password == 0">
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">验证码</text>
+				<input type="number" placeholder="请输入短信验证码" v-model="code"/>
+				<text class="text1" @click="getCode">{{tips}}</text>
 			</view>
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">重复密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
+				<input type="number" placeholder="请输入账号密码" v-model="pwd1" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">重复密码</text>
+				<input type="number" placeholder="请输入账号密码" v-model="pwd2" />
 			</view>
-		</view>
-		<view class="form-box">
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">原密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">新密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">重复密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
-			</view>
 		</view>
-		<view class="tijiao">
-			<x-button>设置密码</x-button>
+		<view class="form-box" v-if="userdata.is_set_password == 1">
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">原密码</text>
+				<input type="number" placeholder="请输入账号密码" v-model="pwd3" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">新密码</text>
+				<input type="number" placeholder="请输入账号密码" v-model="pwd4" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">重复密码</text>
+				<input type="number" placeholder="请输入账号密码" v-model="pwd5" />
+			</view>
 		</view>
+		<view class="tijiao">
+			<x-button @click="save">设置密码</x-button>
+		</view>
+		<u-verification-code :seconds="seconds" ref="uCode" @change="codeChange">
+		</u-verification-code>
 	</view>
 </template>
 
@@ -43,35 +45,134 @@
 	export default {
 		data() {
 			return {
-
+				userdata:{},
+				code:'',
+				pwd1:'',
+				pwd2:'',
+				pwd3:'',
+				pwd4:'',
+				pwd5:'',
+				tips: '获取验证码',
+				// refCode: null,
+				seconds: 60,
 			}
 		},
 		onLoad() {
-
+			this.getuser()
 		},
-		methods: {
-
+		methods: {
+			save(){
+				if(this.userdata.is_set_password == 0){
+					if(!this.code){
+						this.$u.toast("请输入验证码")
+						return
+					}
+					if(!this.pwd1){
+						this.$u.toast("请输入密码")
+						return
+					}
+					if(this.pwd1 != this.pwd2){
+						this.$u.toast("两次密码不一致")
+						return
+					}
+					this.$u.post('/UserPassword/accountPhoneCaptchaSetPassword',{
+						content:{
+							code:this.code,
+							password:this.$md5(this.pwd1)
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if(res.code == 0){
+							setTimeout(() => {
+								uni.navigateBack()
+							},800)
+						}
+					})
+				}
+				if(this.userdata.is_set_password == 1){
+					if(!this.pwd3){
+						this.$u.toast("请输入原密码")
+						return
+					}
+					if(!this.pwd4){
+						this.$u.toast("请输入新密码")
+						return
+					}
+					if(this.pwd4 != this.pwd5){
+						this.$u.toast("两次密码不一致")
+						return
+					}
+					this.$u.post('/UserPassword/updateOldPassword',{
+						content:{
+							old_password:this.$md5(this.pwd3),
+							password:this.$md5(this.pwd4)
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if(res.code == 0){
+							setTimeout(() => {
+								uni.navigateBack()
+							},800)
+						}
+					})
+				}
+			},
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						this.userdata = {}
+					}
+				})
+			},
+			codeChange(text) {
+				this.tips = text;
+			},
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					this.$u.post('/Auth/smsMobileCaptcha', {
+						content: {
+							account_phone: this.userdata.phone,
+							captcha_type: 3,
+							phone: this.userdata.phone,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if (res.code == 0) {
+							this.$refs.uCode.start();
+						}
+					})
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
 		}
 	}
 </script>
 
 <style lang="scss">
 	.change-pwd {
-		.header{
-			font-size: 33rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			padding: 42rpx 33rpx 21rpx 33rpx;
-			border-bottom: 4rpx solid #08AA8C;
-			text:last-child{
-				color: #08AA8C;
-			}
+		.header {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			padding: 42rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #08AA8C;
+
+			text:last-child {
+				color: #08AA8C;
+			}
 		}
+
 		.tijiao {
 			width: 303rpx;
 			height: 104rpx;
 			margin: 200rpx auto;
-			
+
 		}
 
 
@@ -80,9 +181,9 @@
 
 			.form-item {
 				height: 100rpx;
-				
+
 				.text1 {
-					width:180rpx;
+					width: 180rpx;
 					text-align: right;
 				}
 
@@ -93,7 +194,7 @@
 					font-weight: 400;
 				}
 
-				input {
+				input {
 					padding: 0 10rpx;
 					flex: 1;
 					border-bottom: 4rpx solid #56C5B1;

+ 88 - 29
pages/mine/change-tel.vue

@@ -1,27 +1,29 @@
 <template>
-	<view class="change-tel">
-		<view class="header u-flex u-col-center">
-			<text>手机号:</text>
-			<text>12f23f23(已绑定)</text>
+	<view class="change-tel">
+		<view class="header u-flex u-col-center">
+			<text>手机号:</text>
+			<text>{{tel.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}(已绑定)</text>
 		</view>
 		<view class="form-box">
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">新手机号</text>
-				<input type="number" placeholder="请输入手机号"/>
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">验证码</text>
-				<input type="number" placeholder="请输入短信验证码"/>
-				<text class="text1">获取验证码</text>
+				<input type="number" placeholder="请输入手机号" v-model="phone" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">验证码</text>
+				<input type="number" placeholder="请输入短信验证码" v-model="code" />
+				<text class="text1" @click="getCode">{{tips}}</text>
 			</view>
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
+				<input type="number" password placeholder="请输入账号密码" v-model="pwd" />
 			</view>
 		</view>
 		<view class="tijiao">
-			<x-button>确定更换</x-button>
+			<x-button @click="save">确定更换</x-button>
 		</view>
+		<u-verification-code :seconds="seconds" ref="uCode" @change="codeChange">
+		</u-verification-code>
 	</view>
 </template>
 
@@ -29,35 +31,92 @@
 	export default {
 		data() {
 			return {
-
+				tel: '',
+				phone: '',
+				code: '',
+				pwd: '',
+				tips: '获取验证码',
+				// refCode: null,
+				seconds: 60,
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			this.tel = option.tel
 		},
 		methods: {
-
+			save() {
+				if (!this.phone) {
+					this.$u.toast("请输入手机号")
+					return
+				}
+				if (!this.code) {
+					this.$u.toast("请输入验证码")
+					return
+				}
+				if (!this.pwd) {
+					this.$u.toast("请输入密码")
+					return
+				}
+				this.$u.post('/UserBindPhone/bindRetrievePasswordPhone', {
+					content: {
+						bind_phone: this.phone,
+						code: this.code,
+						password: this.$md5(this.pwd)
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					}
+				})
+			},
+			codeChange(text) {
+				this.tips = text;
+			},
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					this.$u.post('/Auth/smsMobileCaptcha', {
+						content: {
+							// account_phone: this.phone,
+							captcha_type: 2,
+							phone: this.phone,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if (res.code == 0) {
+							this.$refs.uCode.start();
+						}
+					})
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
 		}
 	}
 </script>
 
 <style lang="scss">
 	.change-tel {
-		.header{
-			font-size: 33rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			padding: 42rpx 33rpx 21rpx 33rpx;
-			border-bottom: 4rpx solid #08AA8C;
-			text:last-child{
-				color: #08AA8C;
-			}
+		.header {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			padding: 42rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #08AA8C;
+
+			text:last-child {
+				color: #08AA8C;
+			}
 		}
+
 		.tijiao {
 			width: 303rpx;
 			height: 104rpx;
 			margin: 200rpx auto;
-			
+
 		}
 
 
@@ -66,9 +125,9 @@
 
 			.form-item {
 				height: 100rpx;
-				
+
 				.text1 {
-					width:180rpx;
+					width: 180rpx;
 					text-align: right;
 				}
 
@@ -79,7 +138,7 @@
 					font-weight: 400;
 				}
 
-				input {
+				input {
 					padding: 0 10rpx;
 					flex: 1;
 					border-bottom: 4rpx solid #56C5B1;

+ 27 - 19
pages/mine/forget-tel.vue

@@ -3,24 +3,11 @@
 		<view class="form-box">
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">手机号</text>
-				<input type="number" />
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">验证码</text>
-				<input type="number" />
-				<text class="text2">获取验证码</text>
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">新密码</text>
-				<input type="number" />
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">重复密码</text>
-				<input type="number" />
+				<input type="number" placeholder="请输入找回密码手机号" v-model="tel"/>
 			</view>
 		</view>
 		<view class="tijiao">
-			<x-button>确认提交</x-button>
+			<x-button @click="tonext">下一步</x-button>
 		</view>
 	</view>
 </template>
@@ -29,14 +16,35 @@
 	export default {
 		data() {
 			return {
-
+				tel:'',
+				type:''//1手机号找回2密保找回
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			this.type = option.type
 		},
 		methods: {
-
+			tonext(){
+				this.$u.post('/Auth/checkPhone',{
+					content:{
+						phone:this.tel
+					}
+				}).then(res => {
+					if(res.code == 0){
+						if(this.type == 1){
+							uni.navigateTo({
+								url:"./forget-tel1?tel=" + this.tel
+							})
+						}else{
+							uni.navigateTo({
+								url:"./forget-wen?tel=" + this.tel
+							})
+						}
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			}
 		}
 	}
 </script>

+ 170 - 0
pages/mine/forget-tel1.vue

@@ -0,0 +1,170 @@
+<template>
+	<view class="forget-tel1">
+		<view class="title u-flex u-col-center">
+			<text>帐号:</text>
+			<text>{{tel.replace(/(\d{3})\d{4}(\d{4})/, '*******$2')}}</text>
+		</view>
+		<view class="form-box">
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">手机号</text>
+				<input type="number" placeholder="请输入找回密码手机号" v-model="phone" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">验证码</text>
+				<input type="number" placeholder="请输入短信验证码" v-model="code" />
+				<text class="text2" @click="getCode">{{tips}}</text>
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">新密码</text>
+				<input type="number" placeholder="请输入密码" v-model="pwd" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">重复密码</text>
+				<input type="number" placeholder="请再输入密码" v-model="pwd1" />
+			</view>
+		</view>
+		<view class="tijiao">
+			<x-button @click="tijiao">确认提交</x-button>
+		</view>
+		<u-verification-code :seconds="seconds" ref="uCode" @change="codeChange">
+		</u-verification-code>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tel: '',
+				phone: '',
+				code: '',
+				pwd: '',
+				pwd1: '',
+				checked: false,
+				tips: '获取验证码',
+				// refCode: null,
+				seconds: 60,
+			}
+		},
+		onLoad(option) {
+			this.tel = option.tel
+		},
+		methods: {
+			tijiao() {
+				if (!this.phone) {
+					this.$u.toast("请输入手机号")
+					return
+				}
+				if (!this.code) {
+					this.$u.toast("请输入验证码")
+					return
+				}
+				if (!this.pwd) {
+					this.$u.toast("请输入密码")
+					return
+				}
+				if (!this.pwd1) {
+					this.$u.toast("请再输入密码")
+					return
+				}
+				if (this.pwd1 != this.pwd) {
+					this.$u.toast("两次密码不一致")
+					return
+				}
+				this.$u.post('/Auth/phoneCaptchaSetPassword', {
+					content: {
+						bind_phone: this.phone,
+						code: this.code,
+						password: this.$md5(this.pwd),
+						phone: this.tel,
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							uni.navigateBack({
+								delta: 3
+							})
+						}, 800)
+					}
+				})
+
+			},
+			codeChange(text) {
+				this.tips = text;
+			},
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					this.$u.post('/Auth/smsMobileCaptcha', {
+						content: {
+							account_phone: this.tel,
+							captcha_type: 1,
+							phone: this.phone,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if (res.code == 0) {
+							this.$refs.uCode.start();
+						}
+					})
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.forget-tel1 {
+		min-height: 100vh;
+		background-color: #FFFFFF;
+
+		.title {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			color: #000000;
+			padding: 41rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #57C5B0;
+
+			text:last-child {
+				color: #08AA8C;
+			}
+		}
+
+		.tijiao {
+			width: 303rpx;
+			height: 104rpx;
+			margin: 200rpx auto;
+
+		}
+
+
+		.form-box {
+			padding: 36rpx;
+
+			.form-item {
+				height: 100rpx;
+
+				.text2 {
+					width: 180rpx;
+					text-align: right;
+				}
+
+				.text {
+					width: 150rpx;
+					font-size: 33rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
+
+				input {
+					flex: 1;
+					border-bottom: 4rpx solid #56C5B1;
+				}
+			}
+		}
+	}
+</style>

+ 157 - 102
pages/mine/forget-wen.vue

@@ -1,103 +1,158 @@
-<template>
-	<view class="forget-wen">
-		<view class="title">
-			请选择您设置的问题 
-		</view>
-		<view class="wenda-box">
-			<view class="text1">
-				你明白什么叫牛逼吗?
-			</view>
-			<view class="text2">
-				换一个问题
-			</view>
-			<view class="input-box u-flex u-col-center u-row-between">
-				<text>答案</text>
-				<input type="text" placeholder="请输入您设置的问题答案" />
-			</view>
-			<view class="tijiao">
-				<x-button @click="tonext">下一步</x-button>
-				<!-- <text @tap="tonext"></text> -->
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data(){
-			return{
-				
-			}
-		},
-		onLoad() {
-			
-		},
-		methods:{
-			tonext(){
-				uni.navigateTo({
-					url:"./forget-wen1"
-				})
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.forget-wen{
-		min-height: 100vh;
-		background-color: #fff;
-		.wenda-box{
-			padding: 0 33rpx;
-			.tijiao {
-				width: 303rpx;
-				height: 104rpx;
-				margin: 200rpx auto;
-				position: relative;
-				
-			}
-			
-			.input-box{
-				height: 100rpx;
-				margin-bottom: 72rpx;
-				text{
-					font-size: 33rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					margin-right: 20rpx;
-				}
-				input{
-					flex: 1;
-					font-size: 33rpx;
-					border-bottom: 4rpx solid #1DB196;
-					padding: 10rpx 0;
-				}
-			}
-			.text1{
-				padding: 34rpx 0 40rpx 0;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-			}
-			.text2{
-				width: 181rpx;
-				height: 65rpx;
-				text-align: center;
-				line-height: 65rpx;
-				border-radius: 20rpx;
-				border: 2rpx solid #1DB196;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #08AA8C;
-			}
-		}
-		.title{
-			font-size: 33rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			color: #000000;
-			padding: 41rpx 33rpx 21rpx 33rpx;
-			border-bottom: 4rpx solid #57C5B0;
-		}
-	}
+<template>
+	<view class="forget-wen">
+		<view class="title">
+			<text>请选择您设置的问题</text>
+			<text>({{tel.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}})</text>
+		</view>
+		<view class="wenda-box">
+			<view class="text1">
+				{{typetext}}
+			</view>
+			<picker mode="selector" :range="typelist" range-key="problem" @change="changetype">
+				<view class="text2">
+					换一个问题
+				</view>
+			</picker>
+			<view class="input-box u-flex u-col-center u-row-between">
+				<text>答案</text>
+				<input type="text" placeholder="请输入您设置的问题答案" v-model="daan" />
+			</view>
+			<view class="tijiao">
+				<x-button @click="tonext">下一步</x-button>
+				<!-- <text @tap="tonext"></text> -->
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tel: '',
+				typelist: [],
+				typeid: '',
+				typetext: '',
+				daan: ''
+			}
+		},
+		onLoad(option) {
+			this.tel = option.tel
+			this.gettype()
+		},
+		methods: {
+			gettype() {
+				this.$u.post('/UserSafetyProblem/all').then(res => {
+					this.typelist = res.response.data
+					this.typeid = this.typelist[0].key
+					this.typetext = this.typelist[0].problem
+				})
+			},
+			changetype(e) {
+				this.typeid = this.typelist[e.detail.value].key
+				this.typetext = this.typelist[e.detail.value].problem
+			},
+			tonext() {
+				if (!this.daan) {
+					this.$u.toast("请输入问题答案")
+					return
+				}
+				this.$u.post('/Auth/checkPhoneUserSafetyProblemAnswer', {
+					content: {
+						answer: this.$md5(this.daan),
+						phone: this.tel,
+						safety_problem_key: this.typeid,
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						uni.navigateTo({
+							url: "./forget-wen1?content=" + encodeURIComponent(JSON.stringify({
+								answer: this.$md5(this.daan),
+								phone: this.tel,
+								safety_problem_key: this.typeid,
+							}))
+						})
+					} else {
+						this.$u.toast("答案错误")
+					}
+				})
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.forget-wen {
+		min-height: 100vh;
+		background-color: #fff;
+
+		.wenda-box {
+			padding: 0 33rpx;
+
+			.tijiao {
+				width: 303rpx;
+				height: 104rpx;
+				margin: 200rpx auto;
+				position: relative;
+
+			}
+
+			.input-box {
+				height: 100rpx;
+				margin-bottom: 72rpx;
+
+				text {
+					font-size: 33rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					margin-right: 20rpx;
+				}
+
+				input {
+					flex: 1;
+					font-size: 33rpx;
+					border-bottom: 4rpx solid #1DB196;
+					padding: 10rpx 0;
+				}
+			}
+
+			.text1 {
+				padding: 34rpx 0 40rpx 0;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+			}
+
+			.text2 {
+				width: 181rpx;
+				height: 65rpx;
+				text-align: center;
+				line-height: 65rpx;
+				border-radius: 20rpx;
+				border: 2rpx solid #1DB196;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
+			}
+		}
+
+		.title {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			color: #000000;
+			padding: 41rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #57C5B0;
+
+			text:last-child {
+				margin-left: 10rpx;
+				font-size: 28rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
+			}
+		}
+	}
 </style>

+ 57 - 21
pages/mine/forget-wen1.vue

@@ -1,21 +1,21 @@
 <template>
-	<view class="forget-wen1">
-		<view class="header u-flex u-col-center">
-			<text>手机号:</text>
-			<text>12f23f23</text>
+	<view class="forget-wen1">
+		<view class="header u-flex u-col-center">
+			<text>手机号:</text>
+			<text>{{phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}</text>
 		</view>
 		<view class="form-box">
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">新密码</text>
-				<input type="number" />
+				<input type="number" v-model="pwd" placeholder="请输入密码"/>
 			</view>
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">重复密码</text>
-				<input type="number" />
+				<input type="number" v-model="pwd1" placeholder="请再次输入密码"/>
 			</view>
 		</view>
 		<view class="tijiao">
-			<x-button>确认提交</x-button>
+			<x-button @click="save">确认提交</x-button>
 		</view>
 	</view>
 </template>
@@ -24,14 +24,47 @@
 	export default {
 		data() {
 			return {
-
+				phone: '',
+				answer: '',
+				safety_problem_key:'',
+				pwd:'',
+				pwd1:''
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			var content = JSON.parse(decodeURIComponent(option.content))
+			this.phone = content.phone
+			this.answer = content.answer
+			this.safety_problem_key = content.safety_problem_key
 		},
 		methods: {
-
+			save(){
+				if(!this.pwd){
+					this.$u.toast("请输入密码")
+					return
+				}
+				if(this.pwd != this.pwd1){
+					this.$u.toast("两次密码不一致")
+					return
+				}
+				this.$u.post('/Auth/phoneSafetyProblemAnswerSetPassword',{
+					content:{
+						answer:this.answer,
+						password:this.$md5(this.pwd),
+						phone:this.phone,
+						safety_problem_key:this.safety_problem_key,
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if(res.code == 0){
+						setTimeout(() => {
+							uni.navigateBack({
+								delta:4
+							})
+						},800)
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -40,21 +73,24 @@
 	.forget-wen1 {
 		min-height: 100vh;
 		background-color: #FFFFFF;
-		.header{
-			font-size: 33rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			padding: 42rpx 33rpx 21rpx 33rpx;
-			border-bottom: 4rpx solid #08AA8C;
-			text:last-child{
-				color: #08AA8C;
-			}
+
+		.header {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			padding: 42rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #08AA8C;
+
+			text:last-child {
+				color: #08AA8C;
+			}
 		}
+
 		.tijiao {
 			width: 303rpx;
 			height: 104rpx;
 			margin: 200rpx auto;
-			
+
 		}
 
 

+ 2 - 2
pages/mine/forget.vue

@@ -34,12 +34,12 @@
 		methods: {
 			towen(){
 				uni.navigateTo({
-					url:"./forget-wen"
+					url:"./forget-tel?type=2"
 				})
 			},
 			totel(){
 				uni.navigateTo({
-					url:"./forget-tel"
+					url:"./forget-tel?type=1"
 				})
 			}
 		}

+ 775 - 362
pages/mine/kaitong-fuwu.vue

@@ -1,364 +1,777 @@
-<template>
-	<view class="kaitong-fuwu">
-		<view class="header-box">
-			<view class="status-box">
-				资质审核:审核通过
-			</view>
-			<view class="status-box">
-				开通服务审核:审核通过
-			</view>
-			<view class="status-title">
-				预开通服务
-			</view>
-			<view class="item-box u-flex u-col-center u-row-between">
-				<image src="../../static/images/t4.png" mode=""></image>
-				<view class="item-right">
-					<view class="top u-flex u-col-center u-row-between">
-						<text>代驾</text>
-						<text></text>
-					</view>
-					<view class="content">
-						   水道工程维修申请
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="title">
-			个人资料
-		</view>
-		<view class="user-box u-flex u-col-center">
-			<view class="user-left u-flex-col u-col-center">
-				<image src="../../static/images/648.png" mode=""></image>
-				<text>头像</text>
-			</view>
-			<view class="user-right">
-				<view class="input-box u-flex u-col-center">
-					<text class="text">真实姓名</text>
-					<input type="text" placeholder="请输入姓名" />
-				</view>
-				<view class="input-box u-flex u-col-center">
-					<text class="text">联系电话</text>
-					<input type="number" placeholder="请输入联系电话" />
-				</view>
-				<view class="input-box u-flex u-col-center">
-					<text class="text">性别:</text>
-					<u-radio-group v-model="value" active-color="#08AA8C">
-						<u-radio :name="1">
-							<text style="color: #08AA8C;">男</text>
-						</u-radio>
-						<u-radio :name="2">
-							<text style="color: #08AA8C;">女</text>
-						</u-radio>
-					</u-radio-group>
-				</view>
-			</view>
-		</view>
-		<view class="jianjie-box">
-			<textarea placeholder="个人技能简介填写" />
-		</view>
-		<view class="title">
-			身份证信息
-		</view>
-		<view class="card-input u-flex u-col-center u-row-between">
-			<text>身份证号</text>
-			<input type="text" placeholder="请输入身份证号" />
-		</view>
-		<view class="upload-card u-flex u-col-center">
-			<view class="card-item u-flex-col u-col-center">
-				<view class="upload u-flex u-col-center u-row-center">
-					<u-icon name="plus" size="50" color="#AAAAAA"></u-icon>
-				</view>
-				<text class="text1">身份证正面</text>
-			</view>
-			<view class="card-item u-flex-col u-col-center">
-				<view class="upload u-flex u-col-center u-row-center">
-					<u-icon name="plus" size="50" color="#AAAAAA"></u-icon>
-				</view>
-				<text class="text1">身份证背面</text>
-			</view>
-		</view>
-		<view class="baoxian-box">
-			<view class="baoxian-title">
-				人身意外险信息
-			</view>
-			<view class="baoxian-input u-flex u-col-center">
-				<text>保险公司名称:</text>
-				<input type="text" />
-			</view>
-			<view class="baoxian-input u-flex u-col-center">
-				<text>保险合同编号:</text>
-				<input type="text" />
-			</view>
-			<view class="baoxian-input u-flex u-col-center">
-				<text>保险有效时间:</text>
-			</view>
-			<view class="change-time u-flex u-col-center">
-				<image src="../../static/images/1150.png" mode=""></image>
-				<text class="text1">请选择时间</text>
-				<text class="text2">至</text>
-				<image src="../../static/images/1150.png" mode=""></image>
-				<text class="text1">请选择时间</text>
-			</view>
-		</view>
-		<view class="upload-image u-flex-col">
-			<view class="upload u-flex u-col-center u-row-center">
-				<u-icon name="plus" size="50" color="#AAAAAA"></u-icon>
-			</view>
-			<text class="text1">*保险合同图片,请拍摄完整图片</text>
-		</view>
-		<view class="jineng-box">
-			<view class="jineng-title">
-				擅长技能
-			</view>
-			<view class="jineng-label u-flex u-col-center u-flex-wrap">
-				<text>水管道</text>
-				<text>水龙头</text>
-			</view>
-		</view>
-		<view class="xieyi-box u-flex u-col-center u-row-right">
-			<u-checkbox v-model="xieyi" active-color="rgba(8, 170, 140, 1)">同意开通</u-checkbox>
-			<text class="text1">《服务协议》</text>
-		</view>
-		<view>
-			<x-button :width="385" :height="132">服务审核已通过</x-button>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data(){
-			return{
-				value:1,
-				xieyi:false
-			}
-		},
-		onLoad() {
-			
-		},
-		methods:{
-			
-		}
-	}
-</script>
-
-<style lang="scss">
-	.kaitong-fuwu{
-		padding-bottom: 40rpx;
-		.xieyi-box{
-			padding: 0 24rpx;
-			margin-bottom: 35rpx;
-			.text1{
-				color: rgba(8, 170, 140, 1);
-			}
-		}
-		.jineng-box{
-			padding: 0 24rpx;
-			margin-bottom: 30rpx;
-			.jineng-title{
-				margin-bottom: 13rpx;
-				
-			}
-			.jineng-label{
-				text{
-					padding: 15rpx  20rpx;
-					border-radius: 10rpx;
-					background-color: #09AA8C;
-					font-size: 25rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #FFFFFF;
-					margin-right: 10rpx;
-				}
-			}
-		}
-		.upload-image{
-			padding: 0 24rpx;
-			.upload{
-				width: 177rpx;
-				height: 177rpx;
-				border: 1rpx solid #AAAAAA;
-				background-color: #D7D7D7;
-				border-radius: 10rpx;
-				margin-bottom: 10rpx;
-			}
-			.text1{
-				margin-bottom: 26rpx;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #08AA8C;
-			}
-		}
-		.baoxian-box{
-			margin: 20rpx auto;
-			width: 707rpx;
-			// height: 374rpx;
-			padding: 20rpx;
-			background-color: #fff;
-			border-radius: 10rpx;
-			.change-time{
-				image{
-					width: 42rpx;
-					height: 42rpx;
-				}
-				.text1{
-					color: rgba(170, 170, 170, 1);
-					font-size: 31rpx;
-					margin: 0 10rpx;
-				}
-				.text2{
-					color: rgba(170, 170, 170, 1);
-					font-size: 31rpx;
-					margin-right: 10rpx;
-				}
-			}
-			.baoxian-input{
-				height: 80rpx;
-				text{
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-				}
-				input{
-					padding: 10rpx 0;
-					border-bottom: 1rpx solid #B6B6B6;
-					flex: 1;
-					margin-left: 20rpx;
-				}
-			}
-			.baoxian-title{
-				font-size: 31rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				margin-bottom: 20rpx;
-			}
-		}
-		.upload-card{
-			margin: 24rpx;
-			padding-bottom: 20rpx;
-			border-bottom: 1rpx solid #B3B6B5;
-			.card-item{
-				margin-right: 20rpx;
-				.upload{
-					width: 220rpx;
-					height: 139rpx;
-					border-radius: 10rpx;
-					background-color: #D7D7D7;
-					border: 1rpx solid #B9BCBB;
-					margin-bottom: 10rpx;
-				}
-				.text1{
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #707070;
-				}
-			}
-		}
-		.card-input{
-			margin: 0 24rpx;
-			text{
-				margin-right: 20rpx;
-			}
-			input{
-				flex: 1;
-				border-bottom: 2rpx solid #BAC0BE;
-				padding: 20rpx 0;
-			}
-		}
-		.jianjie-box{
-			width: 711rpx;
-			border: 1rpx solid #ADADAD;
-			border-radius: 20rpx;
-			padding: 20rpx;
-			margin: 20rpx auto;
-		}
-		.user-box{
-			padding: 0 24rpx;
-			.user-right{
-				flex: 1;
-				.input-box{
-					padding: 22rpx 0;
-					border-bottom: 2rpx solid #BEC4C2;
-					.text{
-						margin-right: 10rpx;
+<template>
+	<view class="kaitong-fuwu">
+		<view class="header-box">
+			<view class="status-box" v-if="facilitator_examine.status === -1" style="color: red;">
+				资质审核:审核失败
+			</view>
+			<view class="status-box" v-if="facilitator_examine.status === 0" style="color: #E7DC61;">
+				资质审核:审核中
+			</view>
+			<view class="status-box" v-if="facilitator_examine.status === 1" style="color: #08AA8C;">
+				资质审核:审核通过
+			</view>
+			<view class="status-box" v-if="facilitator_qualifications_examine.status === -1" style="color: red;">
+				开通服务审核:{{facilitator_qualifications_examine.procedure_remark}}
+			</view>
+			<view class="status-box" v-if="facilitator_qualifications_examine.status === 0" style="color: #E7DC61;">
+				开通服务审核:{{facilitator_qualifications_examine.procedure_remark}}
+			</view>
+			<view class="status-box" v-if="facilitator_qualifications_examine.status === 1" style="color: #08AA8C;">
+				开通服务审核:{{facilitator_qualifications_examine.procedure_remark}}
+			</view>
+			<view class="status-title">
+				预开通服务
+			</view>
+			<view class="item-box u-flex u-col-center u-row-between" v-if="datainfo.image">
+				<image :src="datainfo.image" mode=""></image>
+				<view class="item-right">
+					<view class="top u-flex u-col-center u-row-between">
+						<text>{{datainfo.title}}</text>
+						<text></text>
+					</view>
+					<view class="content">
+						{{datainfo.desc}}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="title">
+			个人资料
+		</view>
+		<view class="user-box u-flex u-col-center">
+			<view class="user-left u-flex-col u-col-center">
+				<image @tap="changeimg(1)" v-if="head" :src="head" mode=""></image>
+				<image @tap="changeimg(1)" v-else src="../../static/images/648.png" mode=""></image>
+				<text>头像</text>
+			</view>
+			<view class="user-right">
+				<view class="input-box u-flex u-col-center">
+					<text class="text">真实姓名</text>
+					<input type="text" placeholder="请输入姓名" v-model="name" :disabled="isedit" />
+				</view>
+				<view class="input-box u-flex u-col-center">
+					<text class="text">联系电话</text>
+					<input type="number" placeholder="请输入联系电话" v-model="tel" :disabled="isedit" />
+				</view>
+				<view class="input-box u-flex u-col-center">
+					<text class="text">性别:</text>
+					<u-radio-group v-model="value" active-color="#08AA8C" :disabled="isedit">
+						<u-radio :name="1">
+							<text style="color: #08AA8C;">男</text>
+						</u-radio>
+						<u-radio :name="2">
+							<text style="color: #08AA8C;">女</text>
+						</u-radio>
+					</u-radio-group>
+				</view>
+			</view>
+		</view>
+		<view class="jianjie-box">
+			<textarea placeholder="个人简介填写" v-model="jianjie" :disabled="isedit" />
+		</view>
+		<view class="title">
+			身份证信息
+		</view>
+		<view class="card-input u-flex u-col-center u-row-between">
+			<text>身份证号</text>
+			<input type="idcard" placeholder="请输入身份证号" v-model="card" :disabled="isedit" />
+		</view>
+		<view class="upload-card u-flex u-col-center">
+			<view class="card-item u-flex-col u-col-center">
+				<image class="upload" v-if="cardz" :src="cardz" mode="" @tap="changeimg(2)"></image>
+				<view v-else class="upload u-flex u-col-center u-row-center" @tap="changeimg(2)">
+					<u-icon name="plus" size="50" color="#AAAAAA"></u-icon>
+				</view>
+				<text class="text1">身份证正面</text>
+			</view>
+			<view class="card-item u-flex-col u-col-center">
+				<image class="upload" v-if="cardf" :src="cardf" mode="" @tap="changeimg(3)"></image>
+				<view v-else class="upload u-flex u-col-center u-row-center" @tap="changeimg(3)">
+					<u-icon name="plus" size="50" color="#AAAAAA"></u-icon>
+				</view>
+				<text class="text1">身份证背面</text>
+			</view>
+		</view>
+		<view class="baoxian-box">
+			<view class="baoxian-title">
+				人身意外险信息
+			</view>
+			<view class="baoxian-input u-flex u-col-center">
+				<text>保险公司名称:</text>
+				<input type="text" placeholder="请输入保险公司名称" v-model="bxname" :disabled="isedit" />
+			</view>
+			<view class="baoxian-input u-flex u-col-center">
+				<text>保险合同编号:</text>
+				<input type="text" placeholder="请输入保险合同编号" v-model="bxnumber" :disabled="isedit" />
+			</view>
+			<view class="baoxian-input u-flex u-col-center">
+				<text>保险有效时间:</text>
+			</view>
+			<view class="change-time u-flex u-col-center">
+				<image src="../../static/images/1150.png" mode=""></image>
+				<text class="text1" @tap="showstart = true">{{starttime || '请选择时间'}}</text>
+				<text class="text2">至</text>
+				<image src="../../static/images/1150.png" mode=""></image>
+				<text class="text1" @tap="showend = true">{{endtime || '请选择时间'}}</text>
+			</view>
+		</view>
+		<view class="upload-image u-flex-col">
+			<u-upload :custom-btn="true" width="177rpx" height="177rpx" :action="url" :show-progress="true"
+				:disabled="isedit" :file-list="imglist" :deletable="!isedit" :header="header" :formData="$getdata()"
+				:max-count="8" @on-success="uploadsuccess" @on-remove="delimg" name="img" @on-uploaded="uploadover"
+				@on-choose-complete='uploadstart'>
+				<image class="upload" slot="addBtn" src="../../static/images/648.png" mode=""></image>
+			</u-upload>
+			<text class="text1">*保险合同图片,请拍摄完整图片</text>
+		</view>
+		<view class="jineng-box" v-if="datainfo.child.length > 0">
+			<view class="jineng-title">
+				擅长技能
+			</view>
+			<view class="jineng-label u-flex u-col-center u-flex-wrap">
+				<text :class="jineng.includes(item.id) ? 'text' : ''" @tap="changejineng(item)"
+					v-for="(item,index) in datainfo.child" :key="index">{{item.title}}</text>
+			</view>
+		</view>
+		<view class="upload-image u-flex-col" v-for="(item,index) in classify_qualifications" :key="index">
+			<view style="font-size: 28rpx;color: #5B3E30;padding: 10rpx 0;">{{item.title}}</view>
+			<u-upload :custom-btn="true" width="177rpx" height="177rpx" :action="url" :show-progress="true"
+				:header="header" :formData="$getdata()" :file-list="item.imglist" :max-count="item.number" @on-success="uploadsuccess1"
+				@on-remove="delimg1" name="img" :index='index' @on-uploaded="uploadover"
+				@on-choose-complete='uploadstart' :disabled="isedit1" :deletable="!isedit1">
+				<image class="upload" slot="addBtn" src="../../static/images/648.png" mode=""></image>
+			</u-upload>
+			<view class="text1" style="font-size: 24rpx;color: #000;">
+				<text>{{item.desc}}</text>
+				<text style="color: red;">{{item.is_require == 1 ? '必填' : '选填'}}</text>
+			</view>
+		</view>
+		<view class="xieyi-box u-flex u-col-center u-row-right">
+			<u-checkbox v-model="xieyi" active-color="rgba(8, 170, 140, 1)">同意</u-checkbox>
+			<text class="text1" @tap="toxieyi">《开通服务协议》</text>
+		</view>
+		<view>
+			<x-button :width="385" :height="82" fontSize="26rpx" v-if="facilitator_qualifications_examine.status === 0">
+				正在审核中</x-button>
+			<x-button :width="385" :height="82" fontSize="26rpx" v-if="facilitator_qualifications_examine.status === 1">
+				服务审核已通过</x-button>
+			<x-button :width="385" :height="82" fontSize="26rpx" v-if="facilitator_qualifications_examine.status === -1"
+				@click="tijiao">重新提交开通服务申请</x-button>
+			<x-button :width="385" :height="82" fontSize="26rpx"
+				v-if="facilitator_qualifications_examine.status == undefined" @click="tijiao">提交开通服务申请</x-button>
+		</view>
+		<u-picker v-model="showstart" mode="time" :params="params" @confirm="changestart"></u-picker>
+		<u-picker v-model="showend" mode="time" :params="params" @confirm="changeend"></u-picker>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				value: 1,
+				head: '',
+				head_code: '',
+				name: '',
+				tel: '',
+				jianjie: '',
+				cardz: '',
+				cardzimg: [],
+				cardz_code: '',
+				cardf: '',
+				cardfimg: [],
+				cardf_code: '',
+				card: '',
+				bxname: '',
+				bxnumber: '',
+				xieyi: false,
+				id: '',
+				datainfo: {
+					child:[]
+				},
+				url: this.$url + '/Image/uploadImg',
+				header: {
+					token: uni.getStorageSync("token")
+				},
+				imglist: [],
+				imglist_code: [],
+				jineng: [],
+				facilitator_qualifications_examine: {},
+				facilitator_examine: {},
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: false,
+					minute: false,
+					second: false
+				},
+				showstart: false,
+				showend: false,
+				starttime: '',
+				endtime: '',
+				isedit: false,
+				isedit1:false,
+				classify_qualifications: []
+			}
+		},
+		onLoad(option) {
+			this.id = option.id
+			this.getdata()
+		},
+		methods: {
+			uploadstart() {
+				uni.showLoading({
+					mask: true,
+					title: "上传中"
+				})
+			},
+			uploadover() {
+				uni.hideLoading()
+			},
+			delimg1(e, lists, index) {
+				// console.log(e,index);
+				this.classify_qualifications[index].imgcode.splice(index, 1)
+			},
+			uploadsuccess1(e, key, lists, index) {
+				// console.log(this.classify_qualifications[index]);
+				this.classify_qualifications[index].imgcode.push(e.response.code)
+				// console.log(e);
+			},
+			changestart(e) {
+				this.starttime = `${e.year}-${e.month}-${e.day}`
+			},
+			changeend(e) {
+				this.endtime = `${e.year}-${e.month}-${e.day}`
+			},
+			tijiao() {
+				if (!this.name) {
+					this.$u.toast("请输入真实姓名")
+					return
+				}
+				if (!this.tel) {
+					this.$u.toast("请输入联系方式")
+					return
+				}
+				if (!this.head) {
+					this.$u.toast("请上传头像")
+					return
+				}
+				if (!this.jianjie) {
+					this.$u.toast("请输入简介")
+					return
+				}
+				if (!this.card) {
+					this.$u.toast("请输入身份证")
+					return
+				}
+				if (!this.cardz) {
+					this.$u.toast("请上传身份证正面")
+					return
+				}
+				if (!this.cardf) {
+					this.$u.toast("请上传身份证反面")
+					return
+				}
+				if (!this.bxname) {
+					this.$u.toast("请输入保险公司名称")
+					return
+				}
+				if (!this.bxnumber) {
+					this.$u.toast("请输入保险合同编号")
+					return
+				}
+				if (!this.starttime) {
+					this.$u.toast("请选择时间")
+					return
+				}
+				if (!this.endtime) {
+					this.$u.toast("请选择时间")
+					return
+				}
+				if (this.imglist_code.length == 0) {
+					this.$u.toast("请上传保险合同图片")
+					return
+				}
+				if (this.classify_qualifications.length > 0) {
+					for (let i = 0; i < this.classify_qualifications.length; i++) {
+						if (this.classify_qualifications[i].is_require == 1) {
+							console.log(this.classify_qualifications[i]);
+							if (this.classify_qualifications[i].imgcode.length == 0) {
+								this.$u.toast(`请上传${this.classify_qualifications[i].title}`)
+								return
+							}
+						}
+
+
+					}
+				}
+				if (!this.xieyi) {
+					this.$u.toast("请勾选协议")
+					return
+				}
+				if (this.facilitator_qualifications_examine.status == -1) {
+					var type = 1
+				} else {
+					var type = 0
+				}
+				var credentials_gather_code = []
+				this.classify_qualifications.forEach(val => {
+					credentials_gather_code.push({
+						classify_qualifications_id: val.id,
+						image_code: val.imgcode
+					})
+				})
+				// console.log({
+				// 		desc: this.jianjie,
+				// 		headimgurl_image_code: this.head_code,
+				// 		id_card: this.card,
+				// 		id_card_back_code: this.cardf_code,
+				// 		id_card_positive_code: this.cardz_code,
+				// 		insure_company: this.bxname,
+				// 		insure_end_time: this.endtime,
+				// 		insure_gather_code: JSON.stringify(this.imglist_code),
+				// 		insure_no: this.bxnumber,
+				// 		insure_state_time: this.starttime,
+				// 		name: this.name,
+				// 		phone: this.tel,
+				// 		qualifications: JSON.stringify([{
+				// 			classify_id: this.id,
+				// 			expertise_classify_ids: this.jineng,
+				// 			credentials_gather_code: credentials_gather_code,
+				// 			id: this.facilitator_qualifications_examine.id
+				// 		}]),
+				// 		sex: this.value,
+				// 		type: type
+				// 	});
+				this.$u.post('/FacilitatorExamine/applySave', {
+					content: {
+						desc: this.jianjie,
+						headimgurl_image_code: this.head_code,
+						id_card: this.card,
+						id_card_back_code: this.cardf_code,
+						id_card_positive_code: this.cardz_code,
+						insure_company: this.bxname,
+						insure_end_time: this.endtime,
+						insure_gather_code: JSON.stringify(this.imglist_code),
+						insure_no: this.bxnumber,
+						insure_state_time: this.starttime,
+						name: this.name,
+						phone: this.tel,
+						qualifications: JSON.stringify([{
+							classify_id: this.id,
+							expertise_classify_ids: this.jineng,
+							credentials_gather_code: credentials_gather_code,
+							id: this.facilitator_qualifications_examine.id
+						}]),
+						sex: this.value,
+						type: type
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					}
+				})
+			},
+			delimg(e) {
+				this.imglist_code.splice(e, 1)
+			},
+			changejineng(item) {
+				if (this.jineng.indexOf(item.id) > -1) {
+					this.jineng.splice(this.jineng.indexOf(item.id), 1)
+				} else {
+					this.jineng.push(item.id)
+				}
+			},
+			uploadsuccess(e) {
+				// this.imglist.push(e.response.src)
+				this.imglist_code.push(e.response.code)
+				// console.log(e);
+			},
+			changeimg(type) {
+				if (this.isedit) {
+					return
+				}
+				uni.chooseImage({
+					count: 1,
+					success: (res) => {
+						var image = res.tempFilePaths[0]
+						uni.showLoading({
+							title: "上传中"
+						})
+						uni.uploadFile({
+							url: this.$url + '/Image/uploadImg',
+							filePath: image,
+							name: 'img',
+							formData: this.$getdata(),
+							header: {
+								token: uni.getStorageSync("token")
+							},
+							success: res => {
+								uni.hideLoading()
+								// console.log(JSON.parse(res.data));
+								this.$u.toast(JSON.parse(res.data).msg)
+								if (JSON.parse(res.data).code == 0) {
+									if (type == 1) {
+										this.head = JSON.parse(res.data).response.src
+									}
+									if (type == 2) {
+										this.cardz = JSON.parse(res.data).response.src
+									}
+									if (type == 3) {
+										this.cardf = JSON.parse(res.data).response.src
+									}
+								}
+							}
+						})
+					}
+				})
+			},
+			toxieyi() {
+				uni.navigateTo({
+					url: "./all-tips?type=8"
+				})
+			},
+			getdata() {
+				this.$u.post('/FacilitatorExamine/getExamineByClassifyId', {
+					content: {
+						classify_id: this.id
+					}
+				}).then(res => {
+					this.datainfo = res.response.classify
+					var other = res.response.facilitator_qualifications_examine.credentials_gather || []
+					res.response.classify_qualifications.forEach(val => {
+						val.imglist = []
+						val.imgcode = []
+						other.forEach(item => {
+							if (val.id == item.classify_qualifications_id) {
+								item.image.forEach(img => {
+									val.imglist.push({
+										name: img.src,
+										url: img.src
+									})
+									val.imgcode.push(img.code)
+								})
+							}
+						})
+						this.classify_qualifications.push(JSON.parse(JSON.stringify(val)))
+					})
+					this.facilitator_qualifications_examine = res.response.facilitator_qualifications_examine
+					this.facilitator_examine = res.response.facilitator_examine
+					
+					if(this.facilitator_qualifications_examine.status === 0 || this.facilitator_qualifications_examine.status === 1){
+						this.isedit1 = true
+					} else {
+						this.isedit1 = false
 					}
-				}
-			}
-			.user-left{
-				margin-right: 30rpx;
-				image{
-					width: 189rpx;
-					height: 189rpx;
-					margin-bottom: 10rpx;
-				}
-				text{
-					font-size: 25rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #AAAAAA;
-				}
-			}
-		}
-		.title{
-			font-size: 31rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			padding: 10rpx 24rpx;
-		}
-		.header-box{
-			padding: 0 18rpx;
-			width: 707rpx;
-			// height: 352rpx;
-			margin: 20rpx auto;
-			background-color: #fff;
-			border-radius: 20rpx;
-			.item-box{
-				margin-bottom: 20rpx;
-				padding-bottom: 20rpx;
-				image{
-					width: 126rpx;
-					height: 126rpx;
-					margin-right: 33rpx;
-				}
-				.item-right{
-					flex: 1;
-					height: 126rpx;
-					border-radius: 20rpx;
-					border: 4rpx solid #09AA8C;
-					padding: 14rpx;
-					.content{
-						font-size: 25rpx;
-						font-family: SimHei;
-						font-weight: 400;
-						color: rgba(112, 112, 112, 1);
-					}
-					.top{
-						margin-bottom: 10rpx;
-						font-size: 25rpx;
-						font-family: SimHei;
-						font-weight: 400;
-						text:last-child{
-							color: rgba(8, 170, 140, 1);
-						}
-					}
-				}
-			}
-			.status-title{
-				padding: 24rpx 0;
-				font-size: 31rpx;
-				font-family: SimHei;
-				font-weight: 400;
-			}
-			.status-box{
-				padding: 16rpx 0;
-				border-bottom: 1rpx solid #E3E3E3;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #08AA8C;
-			}
-		}
-	}
+					
+					if (this.facilitator_examine.status === 0 || this.facilitator_examine.status === 1) {
+						this.isedit = true
+					} else {
+						this.isedit = false
+					}
+
+					this.name = this.facilitator_examine.name
+					this.tel = this.facilitator_examine.phone
+					this.value = this.facilitator_examine.sex
+					this.jianjie = this.facilitator_examine.desc
+					this.head = this.facilitator_examine.headimgurl_image
+					this.head_code = this.facilitator_examine.headimgurl_image_code
+					this.card = this.facilitator_examine.id_card
+					this.cardz = this.facilitator_examine.id_card_positive
+					this.cardz_code = this.facilitator_examine.id_card_positive_code
+					this.cardf = this.facilitator_examine.id_card_back
+					this.cardf_code = this.facilitator_examine.id_card_back_code
+					this.bxname = this.facilitator_examine.insure_company
+					this.bxnumber = this.facilitator_examine.insure_no
+					this.starttime = this.facilitator_examine.insure_state_time
+					this.endtime = this.facilitator_examine.insure_end_time
+					var img = this.facilitator_examine.insure_gather || []
+					this.imglist = []
+					this.imglist_code = []
+					img.forEach(val => {
+						this.imglist.push({
+							url: val.src,
+							name: val.src
+						})
+						this.imglist_code.push(val.code)
+					})
+					var arr = this.facilitator_qualifications_examine.expertise_classify_ids || []
+					arr.forEach(val => {
+						this.jineng.push(Number(val.classify_id))
+					})
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.kaitong-fuwu {
+		padding-bottom: 40rpx;
+
+		.xieyi-box {
+			padding: 0 24rpx;
+			margin-bottom: 35rpx;
+
+			.text1 {
+				color: rgba(8, 170, 140, 1);
+			}
+		}
+
+		.jineng-box {
+			padding: 0 24rpx;
+			margin-bottom: 30rpx;
+
+			.jineng-title {
+				margin-bottom: 13rpx;
+
+			}
+
+			.jineng-label {
+				.text {
+					background-color: #09AA8C;
+					color: #FFFFFF;
+				}
+
+				text {
+					padding: 15rpx 20rpx;
+					border-radius: 10rpx;
+					color: #09AA8C;
+					font-size: 25rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					border: 1rpx solid #09AA8C;
+					margin-right: 10rpx;
+				}
+			}
+		}
+
+		.upload-image {
+			padding: 0 24rpx;
+
+			.upload {
+				width: 177rpx;
+				height: 177rpx;
+				// border: 1rpx solid #AAAAAA;
+				// background-color: #D7D7D7;
+				// border-radius: 10rpx;
+				// margin-bottom: 10rpx;
+			}
+
+			.text1 {
+				margin-bottom: 26rpx;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
+			}
+		}
+
+		.baoxian-box {
+			margin: 20rpx auto;
+			width: 707rpx;
+			// height: 374rpx;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 10rpx;
+
+			.change-time {
+				image {
+					width: 42rpx;
+					height: 42rpx;
+				}
+
+				.text1 {
+					color: rgba(170, 170, 170, 1);
+					font-size: 31rpx;
+					margin: 0 10rpx;
+				}
+
+				.text2 {
+					color: rgba(170, 170, 170, 1);
+					font-size: 31rpx;
+					margin-right: 10rpx;
+				}
+			}
+
+			.baoxian-input {
+				height: 80rpx;
+
+				text {
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
+
+				input {
+					padding: 10rpx 0;
+					border-bottom: 1rpx solid #B6B6B6;
+					flex: 1;
+					margin-left: 20rpx;
+				}
+			}
+
+			.baoxian-title {
+				font-size: 31rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				margin-bottom: 20rpx;
+			}
+		}
+
+		.upload-card {
+			margin: 24rpx;
+			padding-bottom: 20rpx;
+			border-bottom: 1rpx solid #B3B6B5;
+
+			.card-item {
+				margin-right: 20rpx;
+
+				.upload {
+					width: 220rpx;
+					height: 139rpx;
+					border-radius: 10rpx;
+					background-color: #D7D7D7;
+					border: 1rpx solid #B9BCBB;
+					margin-bottom: 10rpx;
+				}
+
+				.text1 {
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #707070;
+				}
+			}
+		}
+
+		.card-input {
+			margin: 0 24rpx;
+
+			text {
+				margin-right: 20rpx;
+			}
+
+			input {
+				flex: 1;
+				border-bottom: 2rpx solid #BAC0BE;
+				padding: 20rpx 0;
+			}
+		}
+
+		.jianjie-box {
+			width: 711rpx;
+			border: 1rpx solid #ADADAD;
+			border-radius: 20rpx;
+			padding: 20rpx;
+			margin: 20rpx auto;
+		}
+
+		.user-box {
+			padding: 0 24rpx;
+
+			.user-right {
+				flex: 1;
+
+				.input-box {
+					padding: 22rpx 0;
+					border-bottom: 2rpx solid #BEC4C2;
+
+					.text {
+						margin-right: 10rpx;
+					}
+				}
+			}
+
+			.user-left {
+				margin-right: 30rpx;
+
+				image {
+					width: 189rpx;
+					height: 189rpx;
+					margin-bottom: 10rpx;
+				}
+
+				text {
+					font-size: 25rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #AAAAAA;
+				}
+			}
+		}
+
+		.title {
+			font-size: 31rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			padding: 10rpx 24rpx;
+		}
+
+		.header-box {
+			padding: 0 18rpx;
+			width: 707rpx;
+			// height: 352rpx;
+			margin: 20rpx auto;
+			background-color: #fff;
+			border-radius: 20rpx;
+
+			.item-box {
+				margin-bottom: 20rpx;
+				padding-bottom: 20rpx;
+
+				image {
+					width: 126rpx;
+					height: 126rpx;
+					margin-right: 33rpx;
+				}
+
+				.item-right {
+					flex: 1;
+					height: 126rpx;
+					border-radius: 20rpx;
+					border: 4rpx solid #09AA8C;
+					padding: 14rpx;
+
+					.content {
+						font-size: 25rpx;
+						font-family: SimHei;
+						font-weight: 400;
+						color: rgba(112, 112, 112, 1);
+					}
+
+					.top {
+						margin-bottom: 10rpx;
+						font-size: 25rpx;
+						font-family: SimHei;
+						font-weight: 400;
+
+						text:last-child {
+							color: rgba(8, 170, 140, 1);
+						}
+					}
+				}
+			}
+
+			.status-title {
+				padding: 24rpx 0;
+				font-size: 31rpx;
+				font-family: SimHei;
+				font-weight: 400;
+			}
+
+			.status-box {
+				padding: 16rpx 0;
+				border-bottom: 1rpx solid #E3E3E3;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
+			}
+		}
+	}
 </style>

+ 127 - 44
pages/mine/login-code.vue

@@ -15,6 +15,10 @@
 				<text class="text2" @click="getCode">{{tips}}</text>
 			</view>
 		</view>
+		<view class="other-login u-flex u-col-center u-row-between">
+			<text @tap="tologin">手机号密码登录</text>
+			<text></text>
+		</view>
 		<view class="login-butt u-flex u-col-center u-row-center">
 			<image class="image1" src="../../static/images/login1-2.png" mode=""></image>
 			<view class="butt u-flex u-col-center u-row-center" @tap="login">
@@ -26,9 +30,22 @@
 			<u-checkbox v-model="checked" active-color="#08AA8C;"></u-checkbox>
 			<view>
 				<text @tap="checked = !checked">阅读并同意</text>
-				<text style="color: #08AA8C;">《注册/注册协议》</text>
+				<text style="color: #08AA8C;" @tap="toxieyi(1)">《软件使用协议》</text>
+				<text style="color: #08AA8C;" @tap="toxieyi(2)">《隐私政策》</text>
 			</view>
 		</view>
+		<view class="u-flex u-col-center u-row-center" style="margin-top: 20rpx;" v-if="checked">
+			<button type="default" style="border: none;background-color: rgba(0,0,0,0);" class="button"
+				open-type="getPhoneNumber" @getphonenumber="wxlogin">
+				<image src="../../static/images/wxpic.png" style="width: 100rpx;height: 100rpx;" mode=""></image>
+			</button>
+		</view>
+		<view class="u-flex u-col-center u-row-center" style="margin-top: 20rpx;" v-else>
+			<button type="default" style="border: none;background-color: rgba(0,0,0,0);" class="button"
+				@click="opentips">
+				<image src="../../static/images/wxpic.png" style="width: 100rpx;height: 100rpx;" mode=""></image>
+			</button>
+		</view>
 		<u-verification-code :seconds="seconds" ref="uCode" @change="codeChange">
 		</u-verification-code>
 	</view>
@@ -37,66 +54,122 @@
 <script>
 	export default {
 		data() {
-			return {
-				tel:'',
-				code:'',
+			return {
+				tel: '',
+				code: '',
 				checked: false,
 				tips: '获取验证码',
 				// refCode: null,
 				seconds: 60,
+				code1: ''
 			}
 		},
-		onLoad() {
-
+		onShow() {
+			if (!this.code1) {
+				uni.login({
+					provider: "weixin",
+					success: (code) => {
+						this.code1 = code.code
+					}
+				})
+			}
 		},
 		methods: {
-			login(){
-				if(!this.tel){
-					this.$u.toast("请输入手机号")
-					return
-				}
-				if(!this.code){
-					this.$u.toast("请输入验证码")
-					return
-				}
-				if(!this.checked){
-					this.$u.toast("请勾选协议")
-					return
+			toxieyi(type){
+				if(type == 1){
+					uni.navigateTo({
+						url:"./all-tips?type=0"
+					})
+				}else{
+					uni.navigateTo({
+						url:"./all-tips?type=14"
+					})
 				}
-				this.$u.post('/Auth/phoneCaptchaLoginRegister',{
-					content:{
-						code:this.code,
-						phone:this.tel,
+				
+			},
+			opentips() {
+				this.$u.toast("请勾选登录/注册协议")
+			},
+			wxlogin(e) {
+				if (!e.detail.encryptedData) {
+					return
+				}
+				console.log(e);
+				this.$u.post('/Auth/thirdPartyLogin', {
+					content: {
+						encrypted_data: e.detail.encryptedData,
+						iv: e.detail.iv,
+						login_code: this.code1,
+						type: 2
 					}
 				}).then(res => {
-					this.$u.toast(res.msg)
-					if(res.code == 0){
-						uni.setStorageSync("token",res.response.token)
-						setTimeout(() => {
-							uni.switchTab({
-								url:"./mine"
-							})
-						},800)
+					this.code1 = ''
+					if (res.response.status == 0) {
+						uni.navigateTo({
+							url: "./bangding?phone=" + res.response.phone
+						})
+					} else {
+						this.$u.toast(res.msg)
+						if(res.code == 0){
+							uni.setStorageSync("token", res.response.token)
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 800)
+						}
+						
 					}
-				})
+				})
+			},
+			tologin() {
+				uni.navigateTo({
+					url: "./login"
+				})
+			},
+			login() {
+				if (!this.tel) {
+					this.$u.toast("请输入手机号")
+					return
+				}
+				if (!this.code) {
+					this.$u.toast("请输入验证码")
+					return
+				}
+				if (!this.checked) {
+					this.$u.toast("请勾选协议")
+					return
+				}
+				this.$u.post('/Auth/phoneCaptchaLoginRegister', {
+					content: {
+						code: this.code,
+						phone: this.tel,
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						uni.setStorageSync("token", res.response.token)
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					}
+				})
 			},
 			codeChange(text) {
 				this.tips = text;
 			},
 			getCode() {
 				if (this.$refs.uCode.canGetCode) {
-					// 模拟向后端请求验证码
-					this.$u.post('/Auth/smsMobileCaptcha',{
-						content:{
-							account_phone:this.tel,
-							captcha_type:0,
-							phone:this.tel,
-						}
-					}).then(res => {
-						this.$u.toast(res.msg)
-						if(res.code == 0){
-								this.$refs.uCode.start();
-						}
+					// 模拟向后端请求验证码
+					this.$u.post('/Auth/smsMobileCaptcha', {
+						content: {
+							account_phone: this.tel,
+							captcha_type: 0,
+							phone: this.tel,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if (res.code == 0) {
+							this.$refs.uCode.start();
+						}
 					})
 				} else {
 					this.$u.toast('倒计时结束后再发送');
@@ -108,10 +181,20 @@
 
 <style lang="scss">
 	.login-code {
+		.button:after {
+			border: none;
+		}
+
 		.xieyi {
 			margin-top: 28rpx;
 		}
 
+		.other-login {
+			margin-bottom: 30rpx;
+			padding: 0 24rpx;
+			color: #08AA8C;
+		}
+
 		.login-butt {
 			width: 750rpx;
 			height: 254rpx;
@@ -154,7 +237,7 @@
 
 		.login-box {
 			padding: 0 28rpx;
-			margin-bottom: 80rpx;
+			margin-bottom: 30rpx;
 
 			.input {
 				margin-bottom: 20rpx;

+ 78 - 21
pages/mine/login.vue

@@ -29,12 +29,21 @@
 			<u-checkbox v-model="checked" active-color="#08AA8C;"></u-checkbox>
 			<view>
 				<text @tap="checked = !checked">阅读并同意</text>
-				<text style="color: #08AA8C;">《注册/注册协议》</text>
+				<text style="color: #08AA8C;" @tap="toxieyi(1)">《软件使用协议》</text>
+				<text style="color: #08AA8C;" @tap="toxieyi(2)">《隐私政策》</text>
 			</view>
 		</view>
-		<view class="u-flex u-col-center u-row-center" style="margin-top: 20rpx;">
-			<image src="../../static/images/wxpic.webp" style="width: 100rpx;height: 100rpx;" @tap="wxlogin" mode="">
-			</image>
+		<view class="u-flex u-col-center u-row-center" style="margin-top: 20rpx;" v-if="checked">
+			<button type="default" style="border: none;background-color: rgba(0,0,0,0);" class="button"
+				open-type="getPhoneNumber" @getphonenumber="wxlogin">
+				<image src="../../static/images/wxpic.png" style="width: 100rpx;height: 100rpx;" mode=""></image>
+			</button>
+		</view>
+		<view class="u-flex u-col-center u-row-center" style="margin-top: 20rpx;" v-else>
+			<button type="default" style="border: none;background-color: rgba(0,0,0,0);" class="button"
+				@click="opentips">
+				<image src="../../static/images/wxpic.png" style="width: 100rpx;height: 100rpx;" mode=""></image>
+			</button>
 		</view>
 	</view>
 </template>
@@ -47,7 +56,8 @@
 				checked: false,
 				tel: '',
 				pwd: '',
-				code:''
+				code:'',
+				code1:''
 			}
 		},
 		onLoad() {
@@ -59,17 +69,61 @@
 				}
 			})
 		},
-
-		methods: {
-			wxlogin() {
-				uni.getUserProfile({
-					desc: "授权登录",
-					success: (res) => {
-						console.log(res);
-					},
-					fail: (err) => {
-						console.log(err);
-					}
+		onShow() {
+			if (!this.code1) {
+				uni.login({
+					provider: "weixin",
+					success: (code) => {
+						this.code1 = code.code
+					}
+				})
+			}
+		},
+		methods: {
+			toxieyi(type){
+				if(type == 1){
+					uni.navigateTo({
+						url:"./all-tips?type=0"
+					})
+				}else{
+					uni.navigateTo({
+						url:"./all-tips?type=14"
+					})
+				}
+				
+			},
+			opentips() {
+				this.$u.toast("请勾选协议")
+			},
+			wxlogin(e) {
+				if (!e.detail.encryptedData) {
+					return
+				}
+				console.log(e);
+				this.$u.post('/Auth/thirdPartyLogin', {
+					content: {
+						encrypted_data: e.detail.encryptedData,
+						iv: e.detail.iv,
+						login_code: this.code1,
+						type: 2
+					}
+				}).then(res => {
+					this.code1 = ''
+					if (res.response.status == 0) {
+						uni.navigateTo({
+							url: "./bangding?phone=" + res.response.phone
+						})
+					} else {
+						this.$u.toast(res.msg)
+						if(res.code == 0){
+							uni.setStorageSync("token", res.response.token)
+							setTimeout(() => {
+								uni.navigateBack({
+									delta:2
+								})
+							}, 800)
+						}
+					}
 				})
 			},
 			login() {
@@ -95,15 +149,15 @@
 					uni.setStorageSync("token", res.response.token)
 					if (res.code == 0) {
 						setTimeout(() => {
-							uni.navigateBack()
+							uni.navigateBack({
+								delta:2
+							})
 						}, 800)
 					}
 				})
 			},
 			tologin() {
-				uni.navigateTo({
-					url: "./login-code"
-				})
+				uni.navigateBack()
 			},
 			toforget() {
 				uni.navigateTo({
@@ -115,7 +169,10 @@
 </script>
 
 <style lang="scss">
-	.login {
+	.login {
+		.button:after {
+			border: none;
+		}
 		.xieyi {
 			margin-top: 28rpx;
 		}

+ 210 - 94
pages/mine/mine.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="mine">
-		<x-navbar title="我的" :active="3"></x-navbar>
+		<x-navbar title="我的" ref="nav" :active="3"></x-navbar>
 		<view class="header-box u-flex u-col-center u-row-between">
-			<image v-if="userdata.id" :src="userdata.detail.headimgurl_image_src || '../../static/images/head-img.png'" class="head" mode="" @tap="touser"></image>
-			<image v-else src="../../static/images/mine1-1.png" class="head" mode="" @tap="touser"></image>
+			<image v-if="userdata.id && userdata.detail.headimgurl_image_src" :src="userdata.detail.headimgurl_image_src" class="head" mode="" @tap="touser"></image>
+			<image v-else src="../../static/images/head-img.jpeg" class="head" mode="" @tap="touser"></image>
 			<view class="name" @tap="touser" v-if="userdata.id">
 				{{userdata.detail.nickname}}
-			</view>
-			<view class="name1" @tap="tologin" v-else>
-				点击登录
+			</view>
+			<view class="name1" @tap="tologin" v-else>
+				点击登录
 			</view>
 			<image @tap="toyaoqing" src="../../static/images/mine1-2.png" class="code" mode=""></image>
 		</view>
@@ -22,7 +22,7 @@
 			<text class="text3">查看详情</text>
 			<u-icon name="arrow-right" color="#707070"></u-icon>
 		</view> -->
-		<view v-if="userdata.id">
+		<view v-if="userdata.is_facilitator == 2">
 			<view class="row-box1 u-flex u-col-center u-row-between">
 				<text class="text1">您已是服务提供者</text>
 				<text class="text2" @tap="tofuwu">进入服务中心</text>
@@ -30,31 +30,32 @@
 			</view>
 			<view class="row-box2 u-flex u-col-center">
 				<text class="text1">在线接单状态</text>
-				<u-switch v-model="checked" size="35" active-color="#08AA8C"></u-switch>
+				<u-switch v-model="checked" size="35" active-color="#08AA8C" @change="changeswitch"></u-switch>
 			</view>
 			<view class="row-box3 u-flex u-col-center">
-				<text class="text1">接单时间:9:00 至 23:30</text>
-				<x-button :width="178" :height="46" color="#000" fontSize="30rpx">设置时间</x-button>
+				<text class="text1">接单时间:{{jiedantime || '暂未设置'}}</text>
+				<picker mode="multiSelector" :range="timedata" @change="changetime">
+					<x-button :width="178" :height="46" color="#000" fontSize="30rpx">设置时间</x-button>
+				</picker>
 			</view>
 			<view class="order-box">
 				<view class="box-title">
 					服务订单
 				</view>
 				<view class="order-tabs u-flex u-col-center">
-					<view class="item u-flex-col u-col-center">
+					<view class="item u-flex-col u-col-center" @click="toorder(5)">
 						<image src="../../static/images/mine1-5.png" mode=""></image>
 						<text class="text1">接新单</text>
-						<text class="text2">2</text>
+						<text class="text2" v-if="ordercount.pending_count > 0">{{ordercount.pending_count}}</text>
 					</view>
-					<view class="item u-flex-col u-col-center">
+					<view class="item u-flex-col u-col-center" @click="toorder(6)">
 						<image src="../../static/images/mine1-5.png" mode=""></image>
 						<text class="text1">进行中</text>
-						<text class="text2">2</text>
+						<text class="text2" v-if="ordercount.received_count > 0">{{ordercount.received_count}}</text>
 					</view>
-					<view class="item u-flex-col u-col-center">
+					<view class="item u-flex-col u-col-center" @click="toorder(7)">
 						<image src="../../static/images/mine1-5.png" mode=""></image>
 						<text class="text1">已完成</text>
-						<text class="text2">2</text>
 					</view>
 				</view>
 			</view>
@@ -65,52 +66,32 @@
 			</view>
 			<view class="order-box">
 				<view class="fuwu-tabs u-flex u-col-center u-row-between">
-					<text :class="fuwutype == 1 ? 'text' : ''">已开通项目</text>
-					<text :class="fuwutype == 2 ? 'text' : ''">申请中项目</text>
+					<text :class="fuwutype == 1 ? 'text' : ''" @tap="getfuwu(1)">已开通项目</text>
+					<text :class="fuwutype == 0 ? 'text' : ''" @tap="getfuwu(0)">申请中项目</text>
 				</view>
 				<view class="fuwu-list u-flex u-col-center">
-					<view class="item u-flex-col u-col-center">
-						<view class="image u-flex u-col-center u-row-center">
-							<image src="../../static/images/t1.png" mode=""></image>
-							<text class="text2">已通过</text>
-						</view>
-						<view class="name">
-							代驾
-						</view>
-					</view>
-					<view class="item u-flex-col u-col-center">
+					<view class="item u-flex-col u-col-center" v-for="(item,index) in fuwulist" :key="index" @tap="toinfo(item)">
 						<view class="image u-flex u-col-center u-row-center">
-							<image src="../../static/images/t2.png" mode=""></image>
-							<text class="text2">已通过</text>
+							<image :src="item.classify_image" mode=""></image>
+							<text class="text2" v-if="fuwutype == 1" style="color: #2AA47F;">通过</text>
+							<text class="text2" v-if="fuwutype == 0">审核中</text>
 						</view>
 						<view class="name">
-							跑腿
-						</view>
-					</view>
-					<view class="item u-flex-col u-col-center">
-						<view class="image u-flex u-col-center u-row-center">
-							<image src="../../static/images/t3.png" mode=""></image>
-							<text class="text2">已通过</text>
-						</view>
-						<view class="name">
-							电工
-						</view>
-					</view>
-					<view class="item u-flex-col u-col-center">
-						<view class="image u-flex u-col-center u-row-center">
-							<image src="../../static/images/t4.png" mode=""></image>
-							<text class="text2">已通过</text>
-						</view>
-						<view class="name">
-							水工
+							{{item.classify_title}}
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
-
+		<view class="list-box" v-if="userdata.is_facilitator == 0 || userdata.is_facilitator == 1">
+			<view class="item" @tap="toshenqing">
+				<text>服务人员</text>
+				<text style="flex: 1;text-align: right;margin-right: 10rpx;font-size: 24rpx;">申请成为服务人员</text>
+				<u-icon name="arrow-right"></u-icon>
+			</view>
+		</view>
 		<view class="list-box">
-			<view class="item" @tap="toshop" v-if="userdata.is_business == 1">
+			<view class="item" @tap="toshop" v-if="userdata.is_business_admin == 1">
 				<text>我的店铺</text>
 				<u-icon name="arrow-right"></u-icon>
 			</view>
@@ -126,7 +107,7 @@
 				<text>应用设置</text>
 				<u-icon name="arrow-right"></u-icon>
 			</view>
-			<view class="item">
+			<view class="item" @tap="toabout">
 				<text>关于我们</text>
 				<u-icon name="arrow-right"></u-icon>
 			</view>
@@ -139,38 +120,144 @@
 </template>
 
 <script>
+	import time from '../../common/time.js'
 	export default {
 		data() {
 			return {
 				checked: true,
-				fuwutype: 1,
-				userdata:{}
+				fuwutype: 1,
+				userdata: {},
+				jiedantime: '',
+				timedata: [],
+				ordercount: {},
+				fuwulist: []
 			}
 		},
 		onLoad() {
-
-		},
-		onShow() {
-			if(uni.getStorageSync("token")){
-				this.getuser()
-			}else{
-				this.userdata = {}
-			}
+			this.timedata.push(time)
+			this.timedata.push(time)
 		},
-		methods: {
-			getuser(){
-				this.$u.post('/User/getDetail').then(res => {
-					if(res.code == 0){
-						this.userdata = res.response
-					}else{
-						this.userdata = {}
-					}
-				})
-			},
-			tologin(){
-				uni.navigateTo({
-					url:"./login"
-				})
+		onShow() {
+			if (uni.getStorageSync("token")) {
+				this.getuser()
+				this.getfuwu(this.fuwutype)
+				this.getorder()
+				this.$u.post('/UserMessage/getMessageReadFalseCount').then(res => {
+					if (res.code == 0) {
+						this.$refs.nav.count = res.response.count
+					}
+				})
+			} else {
+				this.userdata = {}
+				this.$refs.nav.count = 0
+				uni.removeTabBarBadge({
+					index: 1,
+				})
+			}
+		},
+		methods: {
+			toorder(num) {
+				uni.setStorageSync("ordertype",num)
+				uni.switchTab({
+					url:'../order/order'
+				})
+			},
+			toinfo(item) {
+				uni.navigateTo({
+					url: "./kaitong-fuwu?id=" + item.classify_id
+				})
+			},
+			getfuwu(type) {
+				this.fuwutype = type
+				this.$u.post('/FacilitatorExamine/getQualificationsExamineList', {
+					content: {
+						status: this.fuwutype
+					}
+				}).then(res => {
+					this.fuwulist = res.response.data
+				})
+			},
+			getorder() {
+				this.$u.post('/Order/getOrderStatusCount').then(res => {
+					this.ordercount = res.response.facilitator
+					var num = 0
+					num = num + res.response.facilitator.pending_count
+					num = num + res.response.facilitator.received_count
+					num = num + res.response.user.comments_count
+					num = num + res.response.user.pending_count
+					num = num + res.response.user.received_count
+					uni.setTabBarBadge({
+						text: num.toFixed(0).toString(),
+						index: 1,
+					})
+				})
+			},
+			changeswitch(e) {
+				this.$u.post('/Facilitator/setOrdersStatus', {
+					content: {
+						is_orders: e ? 1 : 0
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					setTimeout(() => {
+						this.getuser()
+					}, 800)
+				})
+			},
+			changetime(e) {
+				this.$u.post('/Facilitator/setOrdersTime', {
+					content: {
+						orders_state_time: this.timedata[0][e.detail.value[0]],
+						orders_end_time: this.timedata[1][e.detail.value[1]]
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							this.getuser()
+						}, 800)
+					}
+				})
+			},
+			toshenqing() {
+				uni.showModal({
+					content: "请确定本人操作提交",
+					success: (res) => {
+						if (res.confirm) {
+							uni.navigateTo({
+								url: "./more-fuwu"
+							})
+						}
+					}
+				})
+			},
+			toabout() {
+				uni.navigateTo({
+					url: "./all-tips?type=2"
+				})
+			},
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+						if (this.userdata.facilitator.is_orders == 0) {
+							this.checked = false
+						} else {
+							this.checked = true
+						}
+						this.jiedantime = this.userdata.facilitator.orders_state_time + "至" + this.userdata
+							.facilitator.orders_end_time
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						this.userdata = {}
+					}
+				})
+			},
+			tologin() {
+				uni.navigateTo({
+					url: "./login-code"
+				})
 			},
 			toshop() {
 				uni.navigateTo({
@@ -183,19 +270,38 @@
 				})
 			},
 			toyaoqing() {
-				uni.navigateTo({
-					url: "./yaoqing"
-				})
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "./yaoqing"
+					})
+				} else {
+					uni.navigateTo({
+						url: "./login-code"
+					})
+				}
 			},
 			tosetting() {
-				uni.navigateTo({
-					url: "./setting"
-				})
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "./setting"
+					})
+				} else {
+					uni.navigateTo({
+						url: "./login-code"
+					})
+				}
+
 			},
 			toaddress() {
-				uni.navigateTo({
-					url: "./address-list"
-				})
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "./address-list"
+					})
+				} else {
+					uni.navigateTo({
+						url: "./login-code"
+					})
+				}
 			},
 			tofuwu() {
 				uni.navigateTo({
@@ -203,9 +309,16 @@
 				})
 			},
 			touser() {
-				uni.navigateTo({
-					url: "./userinfo"
-				})
+				if (uni.getStorageSync("token")) {
+					uni.navigateTo({
+						url: "./userinfo"
+					})
+				} else {
+					uni.navigateTo({
+						url: "./login-code"
+					})
+				}
+
 			}
 		}
 	}
@@ -219,7 +332,7 @@
 
 			.item {
 				height: 89rpx;
-				border-top: 1rpx solid #ABB1AF;
+				border-top: 2rpx solid #E3F7F0;
 				display: flex;
 				align-items: center;
 				justify-content: space-between;
@@ -243,6 +356,7 @@
 					.name {
 						font-size: 29rpx;
 						font-family: SimHei;
+						color: #08AA8C;
 					}
 
 					.image {
@@ -414,12 +528,14 @@
 				height: 133rpx;
 				border-radius: 100rpx;
 			}
-			.name1{
-				color: #2AA47F;
-				text-align: left;
-				flex: 1;
-				margin: 0 28rpx;
+
+			.name1 {
+				color: #2AA47F;
+				text-align: left;
+				flex: 1;
+				margin: 0 28rpx;
 			}
+
 			.name {
 				flex: 1;
 				margin: 0 28rpx;

+ 17 - 46
pages/mine/more-fuwu.vue

@@ -1,51 +1,18 @@
 <template>
 	<view class="more-fuwu">
 		<view class="list-box">
-			<view class="item-box u-flex u-col-center u-row-between">
-				<image src="../../static/images/t1.png" mode=""></image>
+			<view class="item-box u-flex u-col-center u-row-between" v-for="(item,index) in list" :key="index" @tap="tokaitong(item)">
+				<image :src="item.image" mode=""></image>
 				<view class="item-right">
 					<view class="top u-flex u-col-center u-row-between">
-						<text>代驾</text>
-						<text>已通过</text>
+						<text>{{item.title}}</text>
+						<text v-if="item.qualifications_status == null" style="color: #999;">未申请</text>
+						<text v-if="item.qualifications_status === -1" style="color: red;">不通过</text>
+						<text v-if="item.qualifications_status === 0" style="color: #E7DC61;">审核中</text>
+						<text v-if="item.qualifications_status === 1">已通过</text>
 					</view>
 					<view class="content">
-						   代驾申请须知
-					</view>
-				</view>
-			</view>
-			<view class="item-box u-flex u-col-center u-row-between">
-				<image src="../../static/images/t2.png" mode=""></image>
-				<view class="item-right">
-					<view class="top u-flex u-col-center u-row-between">
-						<text>跑腿</text>
-						<text>已通过</text>
-					</view>
-					<view class="content">
-						   跑腿申请
-					</view>
-				</view>
-			</view>
-			<view class="item-box u-flex u-col-center u-row-between">
-				<image src="../../static/images/t3.png" mode=""></image>
-				<view class="item-right">
-					<view class="top u-flex u-col-center u-row-between">
-						<text>电</text>
-						<text>已通过</text>
-					</view>
-					<view class="content">
-						   电申请
-					</view>
-				</view>
-			</view>
-			<view class="item-box u-flex u-col-center u-row-between">
-				<image src="../../static/images/t4.png" mode=""></image>
-				<view class="item-right">
-					<view class="top u-flex u-col-center u-row-between">
-						<text>水</text>
-						<text>已通过</text>
-					</view>
-					<view class="content">
-						   水申请
+						   {{item.desc}}
 					</view>
 				</view>
 			</view>
@@ -57,16 +24,20 @@
 	export default {
 		data(){
 			return{
-				
+				list:[]
 			}
 		},
-		onLoad() {
-			
+		onShow() {
+			this.getdata()
 		},
 		methods:{
-			tokaitong(){
+			async getdata(){
+				var res = await this.$u.post('/FacilitatorExamine/allClassify')
+				this.list = res.response.data
+			},
+			tokaitong(item){
 				uni.navigateTo({
-					url:"./kaitong-fuwu"
+					url:"./kaitong-fuwu?id=" + item.id
 				})
 			}
 		}

+ 84 - 70
pages/mine/setting.vue

@@ -1,24 +1,24 @@
 <template>
 	<view class="setting">
 		<view class="form-box">
-			<view class="row-box u-flex u-col-center u-row-between" @tap="totel">
+			<!-- <view class="row-box u-flex u-col-center u-row-between" @tap="totel">
 				<text class="text1">手机号</text>
 				<text class="text2">设置</text>
 				<u-icon name="arrow-right" color="#08AA8C"></u-icon>
-			</view>
-			<view class="row-box u-flex u-col-center u-row-between" @tap="topwd">
-				<text class="text1">密码设置</text>
-				<text class="text2">未设置</text>
-				<u-icon name="arrow-right" color="#08AA8C"></u-icon>
-			</view>
-			<view class="row-box u-flex u-col-center u-row-between" @tap="toanquan">
-				<text class="text1">帐号安全</text>
-				<text class="text2">设置</text>
-				<u-icon name="arrow-right" color="#08AA8C"></u-icon>
+			</view> -->
+			<view class="row-box u-flex u-col-center u-row-between" @tap="topwd">
+				<text class="text1">密码设置</text>
+				<text class="text2">{{userdata.is_set_password == 1 ? '修改密码' : '未设置'}}</text>
+				<u-icon name="arrow-right" color="#08AA8C"></u-icon>
+			</view>
+			<view class="row-box u-flex u-col-center u-row-between" @tap="toanquan">
+				<text class="text1">帐号安全</text>
+				<text class="text2">设置</text>
+				<u-icon name="arrow-right" color="#08AA8C"></u-icon>
 			</view>
-		</view>
-		<view class="button-down">
-			<x-button @click="toout">退出登录</x-button>
+		</view>
+		<view class="button-down">
+			<x-button @click="toout">退出登录</x-button>
 		</view>
 	</view>
 </template>
@@ -27,71 +27,85 @@
 	export default {
 		data() {
 			return {
-
+				userdata: {}
 			}
 		},
-		onLoad() {
-
+		onShow() {
+			this.getuser()
 		},
-		methods: {
-			toout(){
-				uni.showModal({
-					content:"确认退出登录?",
-					success: (res) => {
-						if(res.confirm){
-							uni.removeStorageSync("token")
-							this.$u.toast("退出成功")
-							setTimeout(() => {
-								uni.navigateBack()
-							},800)
-						}
-					}
-				})
-			},
-			toanquan(){
-				uni.navigateTo({
-					url:'./anquan'
-				})
+		methods: {
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						this.userdata = {}
+					}
+				})
+			},
+			toout() {
+				uni.showModal({
+					content: "确认退出登录?",
+					success: (res) => {
+						if (res.confirm) {
+							uni.removeStorageSync("token")
+							this.$u.toast("退出成功")
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 800)
+						}
+					}
+				})
 			},
-			totel(){
-				uni.navigateTo({
-					url:"./change-tel"
-				})
-			},
-			topwd(){
-				uni.navigateTo({
-					url:"./change-pwd"
-				})
+			toanquan() {
+				uni.navigateTo({
+					url: './anquan'
+				})
+			},
+			totel() {
+				uni.navigateTo({
+					url: "./change-tel"
+				})
+			},
+			topwd() {
+				uni.navigateTo({
+					url: "./change-pwd"
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	.setting {
-		.form-box{
-			padding: 0 30rpx;
-			margin-bottom: 86rpx;
-			.row-box{
-				height: 100rpx;
-				border-bottom: 2rpx solid #DADADA;
-				.text1{
-					font-size: 33rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #08AA8C;
-				}
-				.text2{
-					text-align: right;
-					flex: 1;
-					margin: 0 20rpx;
-					font-size: 33rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #08AA8C;
-					
-				}
-			}
-		}
+	.setting {
+		.form-box {
+			padding: 0 30rpx;
+			margin-bottom: 86rpx;
+
+			.row-box {
+				height: 100rpx;
+				border-bottom: 2rpx solid #DADADA;
+
+				.text1 {
+					font-size: 33rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #08AA8C;
+				}
+
+				.text2 {
+					text-align: right;
+					flex: 1;
+					margin: 0 20rpx;
+					font-size: 33rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #08AA8C;
+
+				}
+			}
+		}
 	}
 </style>

+ 101 - 29
pages/mine/tel-add.vue

@@ -1,27 +1,29 @@
 <template>
-	<view class="tel-add">
-		<view class="header u-flex u-col-center">
-			<text>账号:</text>
-			<text>12f23f23(已绑定)</text>
+	<view class="tel-add">
+		<view class="header u-flex u-col-center">
+			<text>账号:</text>
+			<text>{{userdata.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}</text>
 		</view>
 		<view class="form-box">
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">手机号</text>
-				<input type="number" placeholder="请输入手机号"/>
-			</view>
-			<view class="form-item u-flex u-col-center u-row-between">
-				<text class="text">验证码</text>
-				<input type="number" placeholder="请输入短信验证码"/>
-				<text class="text1">获取验证码</text>
+				<input type="number" placeholder="请输入手机号" v-model="tel" />
+			</view>
+			<view class="form-item u-flex u-col-center u-row-between">
+				<text class="text">验证码</text>
+				<input type="number" placeholder="请输入短信验证码" v-model="code" />
+				<text class="text1" @click="getCode">{{tips}}</text>
 			</view>
 			<view class="form-item u-flex u-col-center u-row-between">
 				<text class="text">密码</text>
-				<input type="number" placeholder="请输入账号密码"/>
+				<input type="number" password placeholder="请输入账号密码" v-model="pwd" />
 			</view>
 		</view>
 		<view class="tijiao">
-			<x-button>确认设置</x-button>
-		</view>
+			<x-button @click="save">确认设置</x-button>
+		</view>
+		<u-verification-code :seconds="seconds" ref="uCode" @change="codeChange">
+		</u-verification-code>
 	</view>
 </template>
 
@@ -29,35 +31,105 @@
 	export default {
 		data() {
 			return {
-
+				userdata: {
+					phone:''
+				},
+				tel: '',
+				code: '',
+				pwd: '',
+				tips: '获取验证码',
+				// refCode: null,
+				seconds: 60,
 			}
 		},
 		onLoad() {
-
+			this.getuser()
 		},
 		methods: {
-
+			save() {
+				if (!this.tel) {
+					this.$u.toast("请输入手机号")
+					return
+				}
+				if (!this.code) {
+					this.$u.toast("请输入验证码")
+					return
+				}
+				if (!this.pwd) {
+					this.$u.toast("请输入密码")
+					return
+				}
+				this.$u.post('/UserBindPhone/bindRetrievePasswordPhone', {
+					content: {
+						bind_phone: this.tel,
+						code: this.code,
+						password: this.$md5(this.pwd)
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					}
+				})
+			},
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						this.userdata = {}
+					}
+				})
+			},
+			codeChange(text) {
+				this.tips = text;
+			},
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+					// 模拟向后端请求验证码
+					this.$u.post('/Auth/smsMobileCaptcha', {
+						content: {
+							account_phone: this.tel,
+							captcha_type: 2,
+							phone: this.tel,
+						}
+					}).then(res => {
+						this.$u.toast(res.msg)
+						if (res.code == 0) {
+							this.$refs.uCode.start();
+						}
+					})
+				} else {
+					this.$u.toast('倒计时结束后再发送');
+				}
+			},
 		}
 	}
 </script>
 
 <style lang="scss">
 	.tel-add {
-		.header{
-			font-size: 33rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			padding: 42rpx 33rpx 21rpx 33rpx;
-			border-bottom: 4rpx solid #08AA8C;
-			text:last-child{
-				color: #08AA8C;
-			}
+		.header {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			padding: 42rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #08AA8C;
+
+			text:last-child {
+				color: #08AA8C;
+			}
 		}
+
 		.tijiao {
 			width: 303rpx;
 			height: 104rpx;
 			margin: 200rpx auto;
-			
+
 		}
 
 
@@ -66,9 +138,9 @@
 
 			.form-item {
 				height: 100rpx;
-				
+
 				.text1 {
-					width:180rpx;
+					width: 180rpx;
 					text-align: right;
 				}
 
@@ -79,7 +151,7 @@
 					font-weight: 400;
 				}
 
-				input {
+				input {
 					padding: 0 10rpx;
 					flex: 1;
 					border-bottom: 4rpx solid #56C5B1;

+ 62 - 8
pages/mine/tel-list.vue

@@ -1,18 +1,18 @@
 <template>
 	<view class="tel-list">
-		<view class="header u-flex u-col-center u-row-right">
+		<view class="header u-flex u-col-center u-row-right" @tap="totips">
 			<u-icon name="info-circle" size="33" color="#08AA8C"></u-icon>
 			<text class="text">说明</text>
 		</view>
-		<view class="item" v-for="(item,index) in 2" :key="index">
+		<view class="item" v-for="(item,index) in list" :key="index">
 			<view class="top u-flex u-col-center u-row-right">
-				<text>删除</text>
+				<text @tap="del(item)">删除</text>
 			</view>
 			<view class="text2">
-				手机号1  159****3977
+				手机号{{index+1}}  {{item.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}
 			</view>
 			<view class="text2">
-				2022-03-15 14:20:11 
+				{{item.create_time}}
 			</view>
 		</view>
 		<view style="height: 120rpx;"></view>
@@ -26,13 +26,67 @@
 	export default {
 		data(){
 			return{
-				
+				page:1,
+				list:[],
+				count:0
 			}
 		},
-		onLoad() {
-			
+		onShow() {
+			this.page = 1
+			this.getlist()
+		},
+		onReachBottom() {
+			if(this.count != this.list.length){
+				this.page++
+				this.getlist()
+			}
 		},
 		methods:{
+			totips(){
+				uni.navigateTo({
+					url:"./all-tips?type=3"
+				})
+			},
+			del(item){
+				uni.showModal({
+					content:"确定删除吗?",
+					success: (res) => {
+						if(res.confirm){
+							this.$u.post('/UserBindPhone/delete',{
+								content:{
+									id:item.id
+								}
+							}).then(res => {
+								if(res.code == 0){
+									this.$u.toast("删除成功")
+									setTimeout(() => {
+										this.page = 1
+										this.getlist()
+									},800)
+								}else{
+									this.$u.toast(res.msg)
+								}
+							})
+						}
+					}
+				})
+			},
+			getlist(){
+				this.$u.post('/UserBindPhone/getBindRetrievePasswordPhoneList',{
+					content:{
+						limit:10,
+						list_type:'page',
+						page:this.page
+					}
+				}).then(res => {
+					this.count = res.response.data.total
+					if(this.page == 1){
+						this.list = res.response.data.data
+					}else{
+						this.list = this.list.concat(res.response.data.data)
+					}
+				})
+			},
 			toadd(){
 				uni.navigateTo({
 					url:"./tel-add"

+ 75 - 9
pages/mine/userinfo.vue

@@ -2,12 +2,12 @@
 	<view class="userinfo">
 		<view class="user-box">
 			<view class="yaoqing">
-				邀请码:
+				邀请码:{{yqm}}
 			</view>
 			<view class="input-box u-flex u-col-bottom u-row-between">
 				<text class="text">昵称:</text>
-				<input type="text" />
-				<image src="../../static/images/mine1-1.png" class="image" mode=""></image>
+				<input type="text" v-model="nickname" placeholder="请输入昵称"/>
+				<image :src="head" @click="changeimg" class="image" mode=""></image>
 			</view>
 			<view class="input-box u-flex u-col-bottom u-row-between" style="width: 300rpx;">
 				<text class="text">性别:</text>
@@ -21,11 +21,11 @@
 				</u-radio-group>
 			</view>
 			<view class="tel-box u-flex u-col-center u-row-right">
-				<text style="margin-right: 20rpx;">手机号:159****3977</text>
+				<text style="margin-right: 20rpx;">手机号:{{tel.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}</text>
 				<text style="color: #08AA8C;" @tap="tochange">更换绑定</text>
 			</view>
 			<view class="tijiao">
-				<x-button>确认修改</x-button>
+				<x-button @click="save">确认修改</x-button>
 			</view>
 		</view>
 	</view>
@@ -35,16 +35,82 @@
 	export default {
 		data() {
 			return {
-				value: ''
+				value: '',
+				nickname:'',
+				tel:'',
+				userdata:{},
+				yqm:'',
+				head:''
 			}
 		},
 		onLoad() {
-
+			this.getuser()
 		},
-		methods: {
+		methods: {
+			save(){
+				if(!this.nickname){
+					this.$u.toast("请输入昵称")
+					return
+				}
+				this.$u.post('/User/updateDetail',{
+					content:{
+						age:'',
+						headimgurl_image_code:this.userdata.detail.headimgurl_image_code,
+						nickname:this.nickname,
+						sex:this.value
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if(res.code ==  0){
+						this.getuser()
+					}
+				})
+			},
+			changeimg(){
+				uni.chooseImage({
+					count:1,
+					success: (res) => {
+						var image = res.tempFilePaths[0]
+						uni.showLoading({
+							title:"上传中"
+						})
+						uni.uploadFile({
+							url:this.$url + '/User/updateHeadimgurl',
+							filePath:image,
+							name:'img[]',
+							formData:this.$getdata(),
+							header:{
+								token:uni.getStorageSync("token")
+							},
+							success:res => {
+								uni.hideLoading()
+								// console.log(JSON.parse(res.data));
+								this.$u.toast(JSON.parse(res.data).msg)
+								if(JSON.parse(res.data).code == 0){
+									this.head = image
+								}
+							}
+						})
+					}
+				})
+			},
+			getuser(){
+				this.$u.post('/User/getDetail').then(res => {
+					if(res.code == 0){
+						this.userdata = res.response
+						this.nickname = this.userdata.detail.nickname
+						this.value = this.userdata.detail.sex
+						this.tel = this.userdata.phone
+						this.yqm = this.userdata.detail.referral_code
+						this.head = this.userdata.detail.headimgurl_image_src
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			},
 			tochange(){
 				uni.navigateTo({
-					url:"./change-tel"
+					url:"./change-tel?tel=" + this.tel
 				})
 			}
 		}

+ 169 - 110
pages/mine/wenda-add.vue

@@ -1,111 +1,170 @@
-<template>
-	<view class="wenda-add">
-		<view class="title u-flex u-col-center">
-			<text>帐号:</text>
-			<text>159****3977</text>
-		</view>
-		<view class="wenda-box">
-			<view class="text1">
-				你明白什么叫牛逼吗?
-			</view>
-			<view class="text2">
-				换一个问题
-			</view>
-			<view class="input-box u-flex u-col-center u-row-between">
-				<text>答案</text>
-				<input type="text" placeholder="请输入您设置的问题答案" />
-			</view>
-			<view class="input-box u-flex u-col-center u-row-between">
-				<text>密码</text>
-				<input type="text" placeholder="请输入密码" />
-			</view>
-			<view class="tijiao">
-				<x-button @click="tonext">下一步</x-button>
-				<!-- <text @tap="tonext"></text> -->
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data(){
-			return{
-				
-			}
-		},
-		onLoad() {
-			
-		},
-		methods:{
-			tonext(){
-				uni.navigateTo({
-					url:"./forget-wen1"
-				})
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.wenda-add{
-		min-height: 100vh;
-		background-color: #fff;
-		.wenda-box{
-			padding: 0 33rpx;
-			.tijiao {
-				width: 303rpx;
-				height: 104rpx;
-				margin: 200rpx auto;
-				position: relative;
-				
-			}
-			
-			.input-box{
-				height: 100rpx;
-				// margin-bottom: 22rpx;
-				text{
-					font-size: 33rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					margin-right: 20rpx;
-				}
-				input{
-					flex: 1;
-					font-size: 33rpx;
-					border-bottom: 4rpx solid #1DB196;
-					padding: 10rpx 0;
-				}
-			}
-			.text1{
-				padding: 34rpx 0 40rpx 0;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-			}
-			.text2{
-				width: 181rpx;
-				height: 65rpx;
-				text-align: center;
-				line-height: 65rpx;
-				border-radius: 20rpx;
-				border: 2rpx solid #1DB196;
-				font-size: 25rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #08AA8C;
-			}
-		}
-		.title{
-			font-size: 33rpx;
-			font-family: SimHei;
-			font-weight: 400;
-			color: #000000;
-			padding: 41rpx 33rpx 21rpx 33rpx;
-			border-bottom: 4rpx solid #57C5B0;
-			text:last-child{
-				color: #08AA8C;
-			}
-		}
-	}
+<template>
+	<view class="wenda-add">
+		<view class="title u-flex u-col-center">
+			<text>帐号:</text>
+			<text>{{userdata.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}</text>
+		</view>
+		<view class="wenda-box">
+			<view class="text1">
+				{{typetext}}
+			</view>
+			<picker mode="selector" :range="typelist" range-key="problem" @change="changetype">
+				<view class="text2">
+					换一个问题
+				</view>
+			</picker>
+			<view class="input-box u-flex u-col-center u-row-between">
+				<text>答案</text>
+				<input type="text" placeholder="请输入您设置的问题答案" v-model="daan" />
+			</view>
+			<view class="input-box u-flex u-col-center u-row-between">
+				<text>密码</text>
+				<input type="text" placeholder="请输入密码" v-model="pwd" />
+			</view>
+			<view class="tijiao">
+				<x-button @click="save">确认设置</x-button>
+				<!-- <text @tap="tonext"></text> -->
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				userdata: {
+					phone: ''
+				},
+				typelist: [],
+				typeid: '',
+				typetext: '请选择问题',
+				daan: '',
+				pwd: ''
+			}
+		},
+		onLoad() {
+			this.getuser()
+			this.gettype()
+		},
+		methods: {
+			save() {
+				if (!this.daan) {
+					this.$u.toast("请输入答案")
+					return
+				}
+				if (!this.pwd) {
+					this.$u.toast("请输入密码")
+					return
+				}
+				this.$u.post('/UserSafetyProblem/add', {
+					content: {
+						safety_problem_key: this.typeid,
+						answer: this.$md5(this.daan),
+						password:this.$md5(this.pwd)
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					}
+				})
+			},
+			changetype(e) {
+				this.typeid = this.typelist[e.detail.value].key
+				this.typetext = this.typelist[e.detail.value].problem
+			},
+			gettype() {
+				this.$u.post('/UserSafetyProblem/all').then(res => {
+					this.typelist = res.response.data
+					this.typeid = this.typelist[0].key
+					this.typetext = this.typelist[0].problem
+				})
+			},
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+					} else {
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						this.userdata = {}
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.wenda-add {
+		min-height: 100vh;
+		background-color: #fff;
+
+		.wenda-box {
+			padding: 0 33rpx;
+
+			.tijiao {
+				width: 303rpx;
+				height: 104rpx;
+				margin: 200rpx auto;
+				position: relative;
+
+			}
+
+			.input-box {
+				height: 100rpx;
+
+				// margin-bottom: 22rpx;
+				text {
+					font-size: 33rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					margin-right: 20rpx;
+				}
+
+				input {
+					flex: 1;
+					font-size: 33rpx;
+					border-bottom: 4rpx solid #1DB196;
+					padding: 10rpx 0;
+				}
+			}
+
+			.text1 {
+				padding: 34rpx 0 40rpx 0;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+			}
+
+			.text2 {
+				width: 181rpx;
+				height: 65rpx;
+				text-align: center;
+				line-height: 65rpx;
+				border-radius: 20rpx;
+				border: 2rpx solid #1DB196;
+				font-size: 25rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
+			}
+		}
+
+		.title {
+			font-size: 33rpx;
+			font-family: SimHei;
+			font-weight: 400;
+			color: #000000;
+			padding: 41rpx 33rpx 21rpx 33rpx;
+			border-bottom: 4rpx solid #57C5B0;
+
+			text:last-child {
+				color: #08AA8C;
+			}
+		}
+	}
 </style>

+ 62 - 8
pages/mine/wenda-list.vue

@@ -1,18 +1,18 @@
 <template>
 	<view class="wenda-list">
-		<view class="header u-flex u-col-center u-row-right">
+		<view class="header u-flex u-col-center u-row-right" @tap="totips">
 			<u-icon name="info-circle" size="33" color="#08AA8C"></u-icon>
 			<text class="text">说明</text>
 		</view>
-		<view class="item" v-for="(item,index) in 2" :key="index">
+		<view class="item" v-for="(item,index) in list" :key="index">
 			<view class="top u-flex u-col-center u-row-right">
-				<text>删除</text>
+				<text @tap="del(item)">删除</text>
 			</view>
 			<view class="text2">
-				问题1  你明白什么叫牛逼吗?
+				问题{{index+1}}  {{item.safety_problem}}
 			</view>
 			<view class="text2">
-				2022-03-15 14:20:11 
+				{{item.create_time}}
 			</view>
 		</view>
 		<view style="height: 120rpx;"></view>
@@ -26,13 +26,67 @@
 	export default {
 		data(){
 			return{
-				
+				page:1,
+				list:[],
+				count:0
 			}
 		},
-		onLoad() {
-			
+		onShow() {
+			this.page = 1
+			this.getlist()
+		},
+		onReachBottom() {
+			if(this.count != this.list.length){
+				this.page++
+				this.getlist()
+			}
 		},
 		methods:{
+			totips(){
+				uni.navigateTo({
+					url:"./all-tips?type=4"
+				})
+			},
+			del(item){
+				uni.showModal({
+					content:"确认删除吗?",
+					success: (res) => {
+						if(res.confirm){
+							this.$u.post('/UserSafetyProblem/delete',{
+								content:{
+									id:item.id
+								}
+							}).then(res => {
+								if(res.code == 0){
+									this.$u.toast("删除成功")
+									setTimeout(() => {
+										this.page = 1
+										this.getlist()
+									},800)
+								}else{
+									this.$u.toast(res.msg)
+								}
+							})
+						}
+					}
+				})
+			},
+			getlist(){
+				this.$u.post('/UserSafetyProblem/list',{
+					content:{
+						limit:10,
+						list_type:'page',
+						page:this.page
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if(this.page == 1){
+						this.list = res.response.data
+					}else{
+						this.list = this.list.concat(res.response.data)
+					}
+				})
+			},
 			toadd(){
 				uni.navigateTo({
 					url:"./wenda-add"

+ 63 - 0
pages/mine/xiaoxi-info.vue

@@ -0,0 +1,63 @@
+<template>
+	<view class="xiaoxi-info">
+		<view class="xiaoxi-msg">
+			{{datainfo.msg_text}}
+		</view>
+		<view class="xiaoxi-title">
+			{{datainfo.title}}
+		</view>
+		<view class="xiaoxi-right">
+			{{datainfo.create_time}}
+		</view>
+		<view class="xiaoxi-text">
+			{{datainfo.content}}
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data(){
+			return{
+				id:'',
+				datainfo:{}
+			}
+		},
+		onLoad(option) {
+			this.id = option.id
+			this.getdata()
+		},
+		methods:{
+			getdata(){
+				this.$u.post('/UserMessage/get',{
+					content:{
+						id:this.id
+					}
+				}).then(res => {
+					this.datainfo = res.response
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.xiaoxi-info{
+		padding: 20rpx;
+		.xiaoxi-right{
+			font-size: 30rpx;
+			text-align: right;
+			margin-bottom: 30rpx;
+		}
+		.xiaoxi-title{
+			font-size: 32rpx;
+			color: #2AA47F;
+			margin-bottom: 10rpx;
+		}
+		.xiaoxi-msg{
+			font-size: 28rpx;
+			color: #2AA47F;
+			margin-bottom: 10rpx;
+		}
+	}
+</style>

+ 75 - 11
pages/mine/xiaoxi.vue

@@ -1,20 +1,21 @@
 <template>
 	<view class="xiaoxi">
-		<view class="header u-flex u-col-center u-row-right">
+		<view class="header u-flex u-col-center u-row-right" @tap="yuedu">
 			<image src="../../static/images/xiaoxi.png" mode=""></image>
 			<text>一键已读</text>
 		</view>
-		<view class="item" v-for="(item,index) in 2" :key="index">
+		<view class="item" v-for="(item,index) in list" :key="index" @click="toinfo(item)">
 			<view class="top u-flex u-col-center u-row-between">
-				<text>2020-02-02 20:20:20</text>
-				<text :style="{color: index % 2 == 0 ? '#08AA8C' : '#FDCE1C'}">未读信息</text>
+				<text>{{item.create_time}}</text>
+				<text v-if="item.is_read == 1" style="color: #08AA8C;">已读信息</text>
+				<text v-if="item.is_read == 0" style="color: #FDCE1C;">未读信息</text>
 			</view>
 			<view class="item-content u-flex-col">
-				<text>下单成功</text>
-				<text>下单成功</text>
+				<text>{{item.title}}</text>
+				<text>{{item.content}}</text>
 			</view>
 			<view class="down-text">
-				<text>维修信息</text>
+				<text>{{item.msg_text}}{{item.jump_type}}</text>
 			</view>
 		</view>
 	</view>
@@ -24,14 +25,77 @@
 	export default {
 		data() {
 			return {
-
+				page:1,
+				list:[],
+				count:0
 			}
 		},
 		onLoad() {
-
+			this.getlist()
+		},
+		onReachBottom() {
+			if(this.count != this.list.length){
+				this.page++
+				this.getlist()
+			}
 		},
-		methods: {
-
+		methods: {
+			yuedu(){
+				this.$u.post('/UserMessage/setMessageAllReadTrue').then(res => {
+					if(res.code == 0){
+						this.$u.toast("设置成功")
+						setTimeout(() => {
+							this.page = 1
+							this.getlist()
+						},800)
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			toinfo(item){
+				// 跳转类型:0富文本 1链接 2用户订单 3加盟商订单 4服务商资质审核信息
+				if(item.jump_type == 0){
+					uni.navigateTo({
+						url:"./xiaoxi-info?id=" + item.id
+					})
+				}
+				if(item.jump_type == 1){
+					
+				}
+				if(item.jump_type == 2){
+					uni.navigateTo({
+						url:"../order/order-info?id=" + item.source_code
+					})
+				}
+				if(item.jump_type == 3){
+					uni.navigateTo({
+						url:"../order/fuwu-orderinfo?id=" + item.source_code
+					})
+				}
+				if(item.jump_type == 4){
+					uni.navigateTo({
+						url:"/pages/mine/kaitong-fuwu?id=" + item.source_code
+					})
+				}
+				
+			},
+			getlist(){
+				this.$u.post('/UserMessage/list',{
+					content:{
+						limit:10,
+						list_type:'page',
+						page:this.page
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if(this.page == 1){
+						this.list = res.response.data
+					}else{
+						this.list = this.list.concat(res.response.data)
+					}
+				})
+			}
 		}
 	}
 </script>

+ 48 - 5
pages/mine/yaoqing-user.vue

@@ -1,10 +1,23 @@
 <template>
 	<view class="yaoqing-user">
-		<view class="notdata u-flex-col u-col-center u-row-center">
+		<view class="item" v-for="(item,index) in list" :key="index">
+			<view class="top u-flex u-col-center">
+				<image v-if="item.headimgurl_image_src" :src="item.headimgurl_image_src" mode=""></image>
+				<image v-else src="../../static/images/head-img.jpeg" mode=""></image>
+				<view class="right u-flex-col">
+					<text>昵称:{{item.nickname}}</text>
+					<text>邀请码:{{item.referral_code}}</text>
+				</view>
+			</view>
+			<view class="time">
+				{{item.create_time}}
+			</view>
+		</view>
+		<view class="notdata u-flex-col u-col-center u-row-center" v-if="list.length == 0">
 			<image class="image" src="../../static/images/yaoqing1-1.png" mode=""></image>
 			<text class="text1">暂时没有您邀请的用户</text>
 			<text class="text1" style="margin-bottom: 55rpx;">稍后请刷新再试</text>
-			<x-button>点击刷新</x-button>
+			<x-button @click="getlist(1)">点击刷新</x-button>
 		</view>
 	</view>
 </template>
@@ -13,20 +26,50 @@
 	export default {
 		data(){
 			return{
-				
+				list:[]
 			}
 		},
 		onLoad() {
-			
+			this.getlist()
 		},
 		methods:{
-			
+			getlist(a){
+				this.$u.post('/User/getMyTeam').then(res => {
+					if(res.code == 0){
+						this.list = res.response.data
+					}
+					if(a == 1){
+						this.$u.toast("刷新成功")
+					}
+				})
+			}
 		}
 	}
 </script>
 
 <style lang="scss">
 	.yaoqing-user{
+		.item{
+			padding:30rpx 20rpx;
+			background-color: #fff;
+			margin: 20rpx;
+			.time{
+				text-align: right;
+				font-size: 30rpx;
+			}
+			.top{
+				image{
+					width: 110rpx;
+					height: 110rpx;
+					border-radius: 100rpx;
+					margin-right: 20rpx;
+				}
+				.right{
+					flex: 1;
+					
+				}
+			}
+		}
 		.notdata{
 			height: 70vh;
 			.image{

+ 26 - 11
pages/mine/yaoqing.vue

@@ -5,9 +5,10 @@
 			<text>|</text>
 			<text @tap="touser">查看团队</text>
 		</view>
-		<view class="body-box u-flex-col u-col-center">
-			<image src="../../static/images/mine1-2.png" mode=""></image>
-			<text>邀请码:123123123</text>
+		<view class="body-box u-flex-col u-col-center" v-if="userdata.referral_code_url">
+			<uqrcode ref="uQRCode" :text="userdata.referral_code_url" :size="160" />
+			<!-- <image :src="userdata.referral_code_url" mode=""></image> -->
+			<text class="text">邀请码:{{userdata.referral_code || ''}}</text>
 		</view>
 	</view>
 </template>
@@ -16,13 +17,26 @@
 	export default {
 		data(){
 			return{
-				
+				userdata:{}
 			}
 		},
 		onLoad() {
-			
+			this.getuser()
 		},
 		methods:{
+			getuser(){
+				this.$u.post('/User/getDetail').then(res => {
+					if(res.code == 0){
+						this.userdata = res.response.detail
+					}else{
+						this.$u.toast(res.msg)
+						uni.removeStorageSync("token")
+						setTimeout(() => {
+							uni.navigateBack()
+						},800)
+					}
+				})
+			},
 			touser(){
 				uni.navigateTo({
 					url:"./yaoqing-user"
@@ -37,14 +51,15 @@
 		padding: 36rpx 39rpx;
 		.body-box{
 			margin-top: 270rpx;
-			image{
-				width: 320rpx;
-				height: 320rpx;
-				margin-bottom: 30rpx;
-			}
-			text{
+			// image{
+			// 	width: 320rpx;
+			// 	height: 320rpx;
+			// 	margin-bottom: 30rpx;
+			// }
+			.text{
 				font-size: 33rpx;
 				color: rgba(8, 170, 140, 1);
+				margin-top: 30rpx;
 			}
 		}
 		.header{

+ 348 - 93
pages/order/fuwu-orderinfo.vue

@@ -1,77 +1,98 @@
 <template>
-	<view class="fuwu-order-info1">
+	<view class="fuwu-order-info1" v-if="orderdata.order_no">
 		<view class="item1-header">
 			<view class="top u-flex u-col-center">
 				<image src="../../static/images/t-tools.png" mode="" v-if="type == 0"></image>
 				<image src="../../static/images/t-daijia.png" mode="" v-if="type == 1"></image>
 				<image src="../../static/images/t-paotui.png" mode="" v-if="type == 2"></image>
-				<text class="text1">WX164843242876885</text>
-				<text class="text2">己取消</text>
+				<text class="text1">{{orderdata.order_no}}</text>
+				<view v-if="orderdata.order_status == 0">
+					<!-- source_type == 3代表商城 -->
+					<view v-if="orderdata.source_type == 3">
+						<text class="text2" v-if="orderdata.is_payment == 0">待支付</text>
+						<text class="text2" v-if="orderdata.is_payment == 1">待接单</text>
+					</view>
+					<!-- 其余代表维修,代驾,跑腿 -->
+					<text v-else class="text2">待接单</text>
+				</view>
+				<text class="text2" v-if="orderdata.order_status == 1">已接单</text>
+				<text class="text2" v-if="orderdata.order_status == 2">进行中</text>
+				<text class="text2" v-if="orderdata.order_status == 3">待用户评价</text>
+				<text class="text2" v-if="orderdata.order_status == 4">已完成</text>
+				<text class="text2" v-if="orderdata.order_status == -1">已取消</text>
+				<text class="text2" v-if="orderdata.order_status == -2">已过期</text>
 			</view>
 			<view class="down u-flex u-col-center u-row-right">
 				<image src="../../static/images/order1-1.png" mode=""></image>
-				<text>1282.32km</text>
+				<text v-if="orderdata.distance > 1000">{{(orderdata.distance/1000).toFixed(2)}}km</text>
+				<text v-else>{{orderdata.distance.toFixed(2)}}m</text>
 			</view>
 		</view>
-		<view class="order-status u-flex u-col-center" @tap="tojindu()">
+		<view class="order-status u-flex u-col-center" v-if="orderdata.procedure.length > 0" @tap="tojindu()">
 			<u-icon name="car" size="32"></u-icon>
 			<view class="status-right u-flex-col">
-				<text>下单成功,等待接单中</text>
-				<text>2022-04-02 10:52:56</text>
+				<text>{{orderdata.procedure[0].desc}}</text>
+				<text>{{orderdata.procedure[0].create_time}}</text>
 			</view>
 		</view>
 		<view class="weixiu-box" v-if="type == 0">
 			<view class="weixiu-goods u-flex u-col-center">
 				<image src="../../static/images/t4.png" mode=""></image>
 				<view class="goods-right u-flex-col">
-					<text>维修类型:水 水管</text>
-					<text>备注:123456</text>
+					<text>维修类型:{{orderdata.detail.top_classify_title}} {{orderdata.detail.classify_title}}</text>
+					<text>备注:{{orderdata.detail.remark}}</text>
 				</view>
 			</view>
 			<view class="goods-tips">
-				故障器件或故障现象图(无)
+				故障器件或故障现象图{{orderdata.detail.image_gather_code ? '' :'(无)'}}
 			</view>
 			<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;">
-				<image src="../../static/images/648.png" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;"
-					mode=""></image>
+				<image @click="openimage(index)" v-for="(item,index) in orderdata.detail.image_gather" :key="index" :src="item.src" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;" mode=""></image>
 			</view>
 			<view class="shangmen-time">
-				上门时间:2022-04-02 10:52:00
+				上门时间:{{orderdata.detail.come_time}}
 			</view>
 			<view>地址信息:</view>
-			<view>了 15816171622</view>
-			<view>广东省潮州市湘桥区凤东路(潮州 •恒大城东侧约100米)潮州
-				市黄金塘科目二考场 广东省潮州市湘桥区桥东街道黄金塘
-				小学西北茂源混凝士</view>
+			<view>{{orderdata.detail.name}}</view>
+			<view>{{orderdata.detail.province}}{{orderdata.detail.city}}{{orderdata.detail.area}}{{orderdata.detail.location_address}}{{orderdata.detail.address}}</view>
+			<view class="tel-box u-flex u-col-center" @tap.stop='$tophone(orderdata.detail.phone)'>
+				<text class="text1">联系电话:</text>
+				<u-icon name="phone-fill" size="36" color="#0AAE87"></u-icon>
+				<text class="text2" style="color: #0AAE87;">{{orderdata.detail.phone}}</text>
+			</view>
 			<view class="price-box u-flex-col">
-				<text>需付金额:10.00元 + 师傅维修费 +材料费</text>
-				<text>价格说明:上门费用10.00元,扣除优惠费0.00元,需支付10.00</text>
+				<text>需付金额:{{orderdata.detail.payment_price_desc}}</text>
+				<text>价格说明:{{orderdata.detail.price_desc}}</text>
 			</view>
+
 		</view>
 		<view class="daijia-box" v-if="type == 1">
 			<view class="qidian u-flex u-col-center">
 				<text>起</text>
-				<text>广东省汕头市龙湖区汕头高新区科技东路9号超声科技大厦</text>
+				<text>{{orderdata.detail.start_location_address}}</text>
 			</view>
-			<view class="tel-box">
-				15816171622
+			<view class="tel-box u-flex u-col-center">
+				<text class="text1">联系电话:</text>
+				<u-icon name="phone-fill" color="#29B08A"></u-icon>
+				<text class="text2" @click.stop="$tophone(orderdata.detail.start_phone,'接单后才能拨打用户电话')" v-if="orderdata.order_status == 0">{{orderdata.detail.start_phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')}}</text>
+				<text class="text2" @click.stop="$tophone(orderdata.detail.start_phone)" v-else>{{orderdata.detail.start_phone}}</text>
 			</view>
 			<view class="dj-text">
 				(出发位置)
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text style="background-color: #EE3709;">终</text>
-				<text>上车后告知司机位置</text>
+				<text>{{orderdata.detail.end_lng ? orderdata.detail.end_location_address : '上车后告知司机位置'}}</text>
 			</view>
 			<view class="dj-text">
 				(终点位置)
 			</view>
 			<view class="qibu-price">
-				须付金额:¥10.0元
+				须付金额:{{orderdata.detail.payment_price_desc}}
 			</view>
 			<view class="price-tips u-flex-col">
-				<text>价格说明:起步价15.00元+路程费+超程返程费+等待超时费用</text>
-				<text>送达位置:啦啦啦</text>
+				<text>价格说明:{{orderdata.detail.price_desc}}</text>
+				<text style="color: #2BAE94;" v-if="orderdata.detail.actual_location_address">送达位置:{{orderdata.detail.actual_location_address}}</text>
 			</view>
 		</view>
 		<view class="paotui-box" v-if="type == 2">
@@ -79,92 +100,164 @@
 				<view class="order-goods-box u-flex u-col-center">
 					<image src="../../static/images/t2.png" class="goods-img" mode=""></image>
 					<view class="goods-right">
-						<view class="goods-name">
-							跑腿类型:帮我买
-						</view>
-						<view class="goods-jieshao">
-							物品信息:文件 预计商品费用:1.0元
-						</view>
-						<view class="goods-price">
-							<text>预约送达时间:2022-04-04 09:49:00</text>
+						<view class="goods-name" v-if="orderdata.run.type == 0">跑腿类型:帮我送</view>
+						<view class="goods-name" v-if="orderdata.run.type == 1">跑腿类型:帮我取</view>
+						<view class="goods-name" v-if="orderdata.run.type == 2">跑腿类型:帮我买</view>
+						<view class="goods-jieshao" v-if="orderdata.run.type == 2">
+							物品信息:{{orderdata.run.remark}} 预计商品费用:{{orderdata.run.fee}}元
+						</view>
+						<view class="goods-jieshao" v-else>
+							物品信息:{{orderdata.run.remark}} {{orderdata.run.weight}}公斤
+						</view>
+						<view class="goods-price">
+							<text v-if="orderdata.run.type == 2">预约送达时间:{{orderdata.run.come_time}}</text>
+							<text v-else>预约取件时间:{{orderdata.run.come_time}}</text>
 						</view>
 					</view>
 				</view>
-				<view class="taocan-box">
-					商品图(无)
-				</view>
-				<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;">
-					<image src="../../static/images/648.png" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;"
-						mode=""></image>
+				<view class="taocan-box">
+					物品图{{orderdata.run.image_gather_code ? '' :'(无)'}}
+				</view>
+				<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;" v-if="orderdata.run.image_gather">
+					<image @click="openimage(index)" v-for="(item,index) in orderdata.run.image_gather" :key="index" :src="item.src" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;" mode=""></image>
 				</view>
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text>起</text>
-				<text>广东省汕头市龙湖区汕头高新区科技东路9号超声科技大厦</text>
+				<text v-if="orderdata.run.start_location_address">{{orderdata.run.start_location_address}}{{orderdata.run.start_address}}</text>
+				<text v-else>骑手就近购买</text>
 			</view>
 			<view class="tel-box u-flex u-col-center">
-				<text class="text1">了</text>
-				<text class="text2">15816171622</text>
+				<text class="text1">{{orderdata.run.start_name}}</text>
+				<text class="text2">{{orderdata.run.start_phone}}</text>
 			</view>
 			<view class="dj-text">
 				(取件地址)
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text style="background-color: #EE3709;">终</text>
-				<text>上车后告知司机位置</text>
+				<text>{{orderdata.run.end_location_address}}{{orderdata.run.end_address}}</text>
 			</view>
 			<view class="tel-box u-flex u-col-center">
-				<text class="text1">了</text>
-				<text class="text2">15816171622</text>
+				<text class="text1">{{orderdata.run.end_name}}</text>
+				<text class="text2">{{orderdata.run.end_phone}}</text>
 			</view>
 			<view class="dj-text">
 				(送件地址)
 			</view>
 			<view class="price-box u-flex-col u-col-top">
-				<text>需付金额:0.00元+实际商品费用</text>
-				<text>
-					价格说明:价格说明:起步价14.00元,预计距离0.0600公里,距离附加费19998.00元,重量附加费0.00元,特殊时段附加费0.00元,实际商品费用N元,扣除优惠费0.00元,需支付20012.00元+实际商品费用
+				<text>需付金额:{{orderdata.run.payment_price_desc}}</text>
+				<text>
+					价格说明:{{orderdata.run.price_desc}}
 				</text>
 			</view>
 		</view>
-		<view class="jiedan-box">
+		<view class="jiedan-box" v-if="orderdata.order_facilitator">
 			<view class="jiedan-top u-flex u-col-center u-row-between">
 				<text>接单人信息</text>
-				<text>已完成</text>
+				<text v-if="orderdata.order_facilitator.status == 0">待确认</text>
+				<text v-if="orderdata.order_facilitator.status == 1">{{orderdata.source_type == 1 ? '已接单' : '未出发'}}</text>
+				<text v-if="orderdata.order_facilitator.status == 2">{{orderdata.source_type == 1 ? '等待客户' : '已出发'}}</text>
+				<text v-if="orderdata.order_facilitator.status == 3">{{orderdata.source_type == 1 ? '已出发' : '已到达'}}</text>
+				<text v-if="orderdata.order_facilitator.status == 4">已完成</text>
+				<text v-if="orderdata.order_facilitator.status == -1">用户取消</text>
+				<text v-if="orderdata.order_facilitator.status == -2">服务商取消</text>
 			</view>
 			<view class="jiedan-user u-flex u-col-center">
-				<image src="../../static/images/order1-2.png" mode=""></image>
+				<image :src="orderdata.order_facilitator.facilitator.headimgurl_image_src" mode=""></image>
 				<view class="user-right u-flex-col">
-					<text>姓名:1</text>
-					<view class="u-flex u-col-center">
+					<text>姓名:{{orderdata.order_facilitator.facilitator.name}}</text>
+					<view class="u-flex u-col-center" @click="$tophone(orderdata.order_facilitator.facilitator.phone)">
 						<text>联系电话:</text>
 						<u-icon name="phone-fill" color="#0DA98C"></u-icon>
-						<text style="color: #0DA98C;">15816171622</text>
+						<text style="color: #0DA98C;">{{orderdata.order_facilitator.facilitator.phone}}</text>
 					</view>
-					<text>工号:1A7700A9572694E5A6D12DBAB2B99A02</text>
+					<text>工号:{{orderdata.order_facilitator.facilitator.facilitator_uid}}</text>
 				</view>
 			</view>
 			<view class="jiedan-time">
-				接单时间:2022-02-17 14:58:17
+				接单时间:{{orderdata.order_facilitator.create_time}}
 			</view>
 		</view>
 		<view class="order-down u-flex-col">
 			<text v-if="type == 0">维修服务</text>
 			<text v-if="type == 1">代驾服务</text>
 			<text v-if="type == 2">跑腿服务</text>
-			<text>下单时间:2022-04-02 10:52:56</text>
-			<text>接单时间:2022-04-02 10:52:56</text>
-			<text>发货时间:2022-04-02 10:52:56</text>
-			<text>完成时间:2022-04-02 10:52:56</text>
+			<text v-if="orderdata.detail.create_time">下单时间:{{orderdata.detail.create_time}}</text>
+			<text v-if="orderdata.detail.payment_time">付款时间:{{orderdata.detail.payment_time}}</text>
+			<text v-if="orderdata.detail.write_off_time">核销时间:{{orderdata.detail.write_off_time}}</text>
+			<text v-if="orderdata.order_facilitator">接单时间:{{orderdata.order_facilitator.create_time}}</text>
+			<text v-if="orderdata.ing_time">发货时间:{{orderdata.ing_time}}</text>
+			<text v-if="orderdata.complete_time">完成时间:{{orderdata.complete_time}}</text>
 		</view>
 		<view style="height: 120rpx;"></view>
-		<view class="down-box u-flex u-col-center u-row-right">
-			<x-button style="margin-right: 20rpx;" :width="180" :height="60" fontSize="24rpx" borderRadius="20rpx">确认接单
-			</x-button>
-			<x-button style="margin-right: 20rpx;" :width="180" :height="60" fontSize="24rpx" borderRadius="20rpx">确认出发
-			</x-button>
-			<x-button :width="180" :height="60" fontSize="24rpx" borderRadius="20rpx">取消订单</x-button>
+		<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 0">
+			<x-button style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="jiedan">确认接单</x-button>
 		</view>
+		<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 1 && type == 0">
+			<x-button v-if="orderdata.order_facilitator.status == 1" style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="chufa">确认出发</x-button>
+			<x-button v-if="orderdata.order_facilitator.status == 2" style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="daoda">确认到达</x-button>
+			<x-button style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao">取消接单</x-button>
+		</view>
+		<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 1 && type == 1">
+			<x-button v-if="orderdata.order_facilitator.status == 1" style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="chufa">等待客户</x-button>
+			<x-button v-if="orderdata.order_facilitator.status == 2" style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="daoda">确认完成</x-button>
+			<x-button style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao">取消接单</x-button>
+		</view>
+		<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 1 && type == 2">
+			<x-button v-if="orderdata.order_facilitator.status == 1" style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="chufa">确认出发</x-button>
+			<x-button v-if="orderdata.order_facilitator.status == 2" style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="daoda">确认到达</x-button>
+			<x-button style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao">取消接单</x-button>
+		</view>
+		<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 2">
+			<x-button style="margin-right: 20rpx;" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao">取消接单</x-button>
+			<x-button style="margin-right: 20rpx;" v-if="type == 0" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="wancheng">确认完成</x-button>
+			<x-button style="margin-right: 20rpx;" v-if="type == 1" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="wancheng1(orderdata,1)">确认完成</x-button>
+			<x-button style="margin-right: 20rpx;" v-if="type ==2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="wancheng">确认完成</x-button>
+		</view>
+		<u-popup v-model="showover" mode="bottom">
+			<view class="u-flex-col u-col-center" style="padding: 0 24rpx;">
+				<view style="padding: 20rpx 0;text-align: center;">
+					确认完成订单
+				</view>
+				<view style="width: 702rpx;text-align: right;color: #2AA47F;">
+					当前位置:{{overaddress}}
+				</view>
+				<view style="padding: 10rpx 0;width: 702rpx;">
+					{{daijiaitem.order_no}}
+				</view>
+				<view class="u-flex u-col-center" style="width: 702rpx;">
+					<text style="width: 30rpx; line-height:30rpx;border-radius: 100rpx;font-size: 20rpx;color: #fff;background-color: #00A1EF;text-align: center;">起</text>
+					<text style="font-size: 26rpx;margin-left: 10rpx;flex: 1;">{{daijiaitem.detail.start_location_address}}</text>
+				</view>
+				<view style="width: 702rpx;padding: 0 20rpx;font-size: 20rpx;margin-bottom: 14rpx;">
+					(出发位置)
+				</view>
+				<view class="u-flex u-col-center" style="width: 702rpx;">
+					<text style="width: 30rpx; line-height:30rpx;border-radius: 100rpx;font-size: 20rpx;color: #fff;background-color: #f00;text-align: center;">终</text>
+					<text style="font-size: 26rpx;margin-left: 10rpx;flex: 1;">{{daijiaitem.detail.end_lng ? end_location_address : '上车后告知司机位置'}}</text>
+				</view>
+				<view style="width: 702rpx;padding: 0 20rpx;font-size: 20rpx;margin-bottom: 14rpx;">
+					(终点位置)
+				</view>
+				<view style="width:702rpx;color: red;font-size: 30rpx;text-align: right;">
+					需付金额:{{daijiaover.payment_price}}
+				</view>
+				<view style="width: 702rpx;font-size: 22rpx;text-align: right;">
+					起步价:¥{{daijiaover.start_price}}元 公里数:{{daijiaover.points}}km
+				</view>
+				<view style="width: 702rpx;font-size: 22rpx;text-align: right;">
+					总价:¥{{daijiaover.total_price}}元 优惠:¥{{daijiaover.discount_price}}
+				</view>
+				<view style="width: 702rpx;font-size: 22rpx;text-align: right;">
+					价格说明:{{daijiaover.price_desc}}
+				</view>
+				<view style="width: 702rpx;font-size: 20rpx;text-align: right;color: rgba(0,0,0,0.3);margin-bottom: 20rpx;">
+					计价说明:{{daijiaover.price_formula_desc}}
+				</view>
+				<x-button :height='80' style="margin:10rpx 0 30rpx 0;" @click="wancheng1(daijiaitem,0)">确认完成</x-button>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -172,38 +265,199 @@
 	export default {
 		data() {
 			return {
-				type: ''
+				type: '',
+				id: '',
+				lat: '',
+				lng: '',
+				orderdata: {},
+				showover:false,
+				daijiaover:{},
+				overaddress:'',
+				daijiaitem:{}
 			}
 		},
 		onLoad(option) {
-			this.type = option.index
+			this.id = option.id
 		},
 		onShow() {
-			if (this.type == 0) {
-				uni.setNavigationBarTitle({
-					title: "维修服务订单"
+			this.getdata()
+		},
+		methods: {
+			wancheng1(item, type) {
+				this.daijiaitem = item
+				this.myAmapFun.getRegeo({
+					success: (res) => {
+						this.overaddress = res[0].name
+						console.log(res);
+						this.$u.post('/FacilitatorOrder/complete', {
+							content: {
+								is_check: type,
+								lat: res[0].latitude,
+								lng: res[0].longitude,
+								location_address: this.overaddress,
+								order_no: item.order_no,
+							}
+						}).then(res => {
+							if (res.code == 0) {
+								if(type == 1){
+									this.daijiaover = res.response
+									this.showover = true
+								}else{
+									this.showover = false
+									this.getorder()
+								}
+							} else {
+								this.$u.toast(res.msg)
+							}
+						})
+					},
+					fail:(err) => {
+						console.log(err);
+					}
+				})
+			},
+			wancheng(){
+				this.$u.post('/FacilitatorOrder/complete', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						this.getorder()
+					} else {
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			daoda() {
+				this.$u.post('/FacilitatorOrder/arrived', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						this.getorder()
+					} else {
+						this.$u.toast(res.msg)
+					}
 				})
-			}
-			if (this.type == 1) {
-				uni.setNavigationBarTitle({
-					title: "代驾服务订单"
+			},
+			quxiao() {
+				this.$u.post('/FacilitatorOrder/cancel', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						this.getorder()
+					} else {
+						this.$u.toast(res.msg)
+					}
 				})
-			}
-			if (this.type == 2) {
-				uni.setNavigationBarTitle({
-					title: "跑腿服务订单"
+			},
+			chufa() {
+				this.$u.post('/FacilitatorOrder/outset', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						this.getorder()
+					} else {
+						this.$u.toast(res.msg)
+					}
 				})
-			}
-			if (this.type == 3) {
-				uni.setNavigationBarTitle({
-					title: "商品订单"
+			},
+			jiedan() {
+				this.$u.post('/FacilitatorOrder/orders', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						setTimeout(() => {
+							this.getorder()
+						},800)
+						if(this.type == 2){
+							this.$u.toast("接单成功")
+						}else{
+							uni.showModal({
+								content: "是否联系用户",
+								confirmText: "是",
+								cancelText: "否",
+								success: (on) => {
+									if (on.confirm) {
+										this.$tophone(this.orderdata.detail.phone)
+									}
+								}
+							})
+						}
+						
+						
+					} else {
+						this.$u.toast(res.msg)
+					}
 				})
-			}
-		},
-		methods: {
+			},
+			openimage(index) {
+				var arr = []
+				this.orderdata.detail.image_gather.forEach(val => {
+					arr.push(val.src)
+				})
+				uni.previewImage({
+					urls: arr,
+					current: index
+				})
+			},
+			getorder() {
+				this.$u.post('/FacilitatorOrder/get', {
+					content: {
+						lat: this.lat,
+						lng: this.lng,
+						order_no: this.id
+					}
+				}).then(res => {
+					this.type = res.response.source_type
+					this.orderdata = res.response
+					if (this.type == 0) {
+						uni.setNavigationBarTitle({
+							title: "维修服务订单"
+						})
+					}
+					if (this.type == 1) {
+						uni.setNavigationBarTitle({
+							title: "代驾服务订单"
+						})
+					}
+					if (this.type == 2) {
+						uni.setNavigationBarTitle({
+							title: "跑腿服务订单"
+						})
+					}
+					if (this.type == 3) {
+						uni.setNavigationBarTitle({
+							title: "商品订单"
+						})
+					}
+				})
+			},
+			getdata() {
+				this.myAmapFun.getRegeo({
+					success: (res) => {
+						this.lat = res[0].latitude
+						this.lng = res[0].longitude
+						this.getorder()
+					},
+					fail: (err) => {
+						this.lat = 39.865246
+						this.lng = 116.378517
+						this.getorder()
+					}
+				})
+			},
 			tojindu() {
 				uni.navigateTo({
-					url: "./jindu"
+					url: "./jindu?id=" + this.id + "&type=1"
 				})
 			},
 		}
@@ -349,7 +603,7 @@
 			}
 
 			.tel-box {
-				padding: 0 30rpx;
+				padding: 0 15rpx;
 
 				.text1 {}
 
@@ -394,9 +648,9 @@
 				padding-bottom: 20rpx;
 				border-bottom: 1rpx solid #DCDADC;
 
-				text:last-child {
-					color: #2AA47F;
-				}
+				// text:last-child {
+				// 	color: #2AA47F;
+				// }
 			}
 
 			.qibu-price {
@@ -431,6 +685,7 @@
 					width: 150rpx;
 					height: 150rpx;
 					margin-right: 10rpx;
+					border-radius: 100rpx;
 				}
 
 				.user-right {
@@ -524,7 +779,7 @@
 
 			.down {
 				padding-bottom: 10rpx;
-				border-bottom: 1rpx solid #D5D5D5;
+				// border-bottom: 1rpx solid #D5D5D5;
 
 				image {
 					width: 42rpx;

+ 66 - 33
pages/order/jindu.vue

@@ -1,34 +1,34 @@
 <template>
-	<view class="jindu">
+	<view class="jindu" v-if="orderdata.order_no">
 		<view class="order-header u-flex u-col-center">
 			<image src="../../static/images/t-tools.png" mode="" v-if="type == 0"></image>
 			<image src="../../static/images/t-daijia.png" mode="" v-if="type == 1"></image>
 			<image src="../../static/images/t-paotui.png" mode="" v-if="type == 2"></image>
 			<image src="../../static/images/t-jipin.png" mode="" v-if="type == 3"></image>
-			<text class="text1">WX164843242876885</text>
+			<text class="text1">{{orderdata.order_no}}</text>
 			<text class="text2"></text>
 		</view>
 		<view class="image-box u-flex u-col-center" v-if="type == 0">
 			<image src="../../static/images/t4.png" mode=""></image>
 			<view class="image-right u-flex-col">
-				<text>维修类型水 水管</text>
-				<text>备注:</text>
+				<text>维修类型:{{orderdata.detail.top_classify_title}} {{orderdata.detail.classify_title}}</text>
+				<text>备注:{{orderdata.detail.remark}}</text>
 			</view>
 		</view>
 		<view v-if="type == 1">
 			<view class="qidian u-flex u-col-center">
 				<text>起</text>
-				<text>广东省汕头市龙湖区汕头高新区科技东路9号超声科技大厦</text>
+				<text>{{orderdata.detail.start_location_address}}</text>
 			</view>
 			<view class="tel-box">
-				15816171622
+				{{orderdata.detail.start_phone}}
 			</view>
 			<view class="dj-text">
 				(出发位置)
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text style="background-color: #EE3709;">终</text>
-				<text>上车后告知司机位置</text>
+				<text>{{orderdata.detail.end_lng ? orderdata.detail.end_location_address : '上车后告知司机位置'}}</text>
 			</view>
 			<view class="dj-text">
 				(终点位置)
@@ -48,10 +48,17 @@
 				</view>
 			</view>
 		</view>
+		<view class="image-box u-flex u-col-center" v-if="type == 3">
+			<image style="border-radius: 100rpx;" src="../../static/images/shop-order.png" mode=""></image>
+			<view class="image-right u-flex-col">
+				<text>{{orderdata.detail.business_product_redundancy.title}}</text>
+				<text>{{orderdata.detail.business_product_redundancy.desc}}</text>
+			</view>
+		</view>
 		<view class="jindu-box">
-			<view class="item u-flex-col" v-for="(item,index) in 2" :key="index">
-				<text>2020-02-02 12:12:12</text>
-				<text>下单成功</text>
+			<view class="item u-flex-col" v-for="(item,index) in procedure" :key="index">
+				<text>{{item.create_time}}</text>
+				<text>{{item.desc}}</text>
 			</view>
 		</view>
 	</view>
@@ -61,36 +68,61 @@
 	export default {
 		data(){
 			return{
-				type:''
+				type:'',
+				procedure:{},
+				orderdata:{},
+				fuwu:''
 			}
 		},
 		onLoad(option) {
-			this.type = option.index || 0
+			this.id = option.id
+			this.fuwu = option.type
 		},
 		onShow() {
-			if (this.type == 0) {
-				uni.setNavigationBarTitle({
-					title: "维修服务订单"
-				})
-			}
-			if (this.type == 1) {
-				uni.setNavigationBarTitle({
-					title: "代驾服务订单"
-				})
-			}
-			if (this.type == 2) {
-				uni.setNavigationBarTitle({
-					title: "跑腿服务订单"
-				})
-			}
-			if (this.type == 3) {
-				uni.setNavigationBarTitle({
-					title: "商品订单"
-				})
-			}
+			this.getdata()
+			
 		},
 		methods:{
-			
+			getdata(){
+				if(this.fuwu == 1){
+					var api = '/FacilitatorOrder/get'
+				}else if(this.fuwu == 2){
+					var  api = '/BusinessAdmin/getOrder'
+				}else{
+					var  api = '/Order/get'
+				}
+				this.$u.post(api,{
+					content:{
+						lat: 39.865246,
+						lng: 116.378517,
+						order_no:this.id,
+					}
+				}).then(res => {
+					this.procedure = res.response.procedure
+					this.orderdata = res.response
+					this.type = res.response.source_type
+					if (this.type == 0) {
+						uni.setNavigationBarTitle({
+							title: "维修服务订单"
+						})
+					}
+					if (this.type == 1) {
+						uni.setNavigationBarTitle({
+							title: "代驾服务订单"
+						})
+					}
+					if (this.type == 2) {
+						uni.setNavigationBarTitle({
+							title: "跑腿服务订单"
+						})
+					}
+					if (this.type == 3) {
+						uni.setNavigationBarTitle({
+							title: "商品订单"
+						})
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -120,6 +152,7 @@
 				width: 100rpx;
 				height: 100rpx;
 				margin-right: 10rpx;
+				// border-radius: 100rpx;
 			}
 			.image-right{
 				flex: 1;

+ 368 - 122
pages/order/order-info.vue

@@ -1,71 +1,85 @@
 <template>
-	<view class="order-info1">
+	<view class="order-info1" v-if="orderdata.id">
 		<view class="order-header u-flex u-col-center">
 			<image src="../../static/images/t-tools.png" mode="" v-if="type == 0"></image>
 			<image src="../../static/images/t-daijia.png" mode="" v-if="type == 1"></image>
 			<image src="../../static/images/t-paotui.png" mode="" v-if="type == 2"></image>
 			<image src="../../static/images/t-jipin.png" mode="" v-if="type == 3"></image>
-			<text class="text1">WX164843242876885</text>
-			<text class="text2">己取消</text>
+			<text class="text1">{{orderdata.order_no}}</text>
+			<view v-if="orderdata.order_status == 0">
+				<!-- source_type == 3代表商城 -->
+				<view v-if="orderdata.source_type == 3">
+					<text class="text2" v-if="orderdata.is_payment == 0">待支付</text>
+					<text class="text2" v-if="orderdata.is_payment == 1">待接单</text>
+				</view>
+				<!-- 其余代表维修,代驾,跑腿 -->
+				<text v-else class="text2">待接单</text>
+			</view>
+			<text class="text2" v-if="orderdata.order_status == 1">已接单</text>
+			<text class="text2" v-if="orderdata.order_status == 2">进行中</text>
+			<text class="text2" v-if="orderdata.order_status == 3">待用户评价</text>
+			<text class="text2" v-if="orderdata.order_status == 4">已完成</text>
+			<text class="text2" v-if="orderdata.order_status == -1">已取消</text>
+			<text class="text2" v-if="orderdata.order_status == -2">已过期</text>
 		</view>
-		<view class="order-status u-flex u-col-center" v-if="type != 3" @tap="tojindu()">
-			<u-icon name="car" size="32"></u-icon>
-			<view class="status-right u-flex-col">
-				<text>下单成功,等待接单中</text>
-				<text>2022-04-02 10:52:56</text>
-			</view>
+		<view class="order-status u-flex u-col-center" v-if="orderdata.procedure.length > 0" @tap="tojindu()">
+			<u-icon name="car" size="32"></u-icon>
+			<view class="status-right u-flex-col">
+				<text>{{orderdata.procedure[0].desc}}</text>
+				<text>{{orderdata.procedure[0].create_time}}</text>
+			</view>
 		</view>
 		<view class="weixiu-box" v-if="type == 0">
 			<view class="weixiu-goods u-flex u-col-center">
 				<image src="../../static/images/t4.png" mode=""></image>
 				<view class="goods-right u-flex-col">
-					<text>维修类型:水 水管</text>
-					<text>备注:123456</text>
+					<text>维修类型:{{orderdata.detail.top_classify_title}} {{orderdata.detail.classify_title}}</text>
+					<text>备注:{{orderdata.detail.remark}}</text>
 				</view>
 			</view>
 			<view class="goods-tips">
-				故障器件或故障现象图(无)
+				故障器件或故障现象图{{orderdata.detail.image_gather_code ? '' :'(无)'}}
 			</view>
-			<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;">
-				<image src="../../static/images/648.png" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;"
-					mode=""></image>
+			<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;" v-if="orderdata.detail.image_gather">
+				<image @click="openimage(index)" v-for="(item,index) in orderdata.detail.image_gather" :key="index" :src="item.src" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;" mode=""></image>
 			</view>
 			<view class="shangmen-time">
-				上门时间:2022-04-02 10:52:00
+				上门时间:{{orderdata.detail.come_time}}
 			</view>
 			<view>地址信息:</view>
-			<view>了 15816171622</view>
-			<view>广东省潮州市湘桥区凤东路(潮州 •恒大城东侧约100米)潮州
-				市黄金塘科目二考场 广东省潮州市湘桥区桥东街道黄金塘
-				小学西北茂源混凝士</view>
+			<view>{{orderdata.detail.name}} {{orderdata.detail.phone}}</view>
+			<view>{{orderdata.detail.province}}{{orderdata.detail.city}}{{orderdata.detail.area}}{{orderdata.detail.location_address}}{{orderdata.detail.address}}</view>
 			<view class="price-box u-flex-col">
-				<text>需付金额:10.00元 + 师傅维修费 +材料费</text>
-				<text>价格说明:上门费用10.00元,扣除优惠费0.00元,需支付10.00</text>
+				<text>需付金额:{{orderdata.detail.payment_price_desc}}</text>
+				<text>价格说明:{{orderdata.detail.price_desc}}</text>
 			</view>
 		</view>
 		<view class="daijia-box" v-if="type == 1">
 			<view class="qidian u-flex u-col-center">
 				<text>起</text>
-				<text>广东省汕头市龙湖区汕头高新区科技东路9号超声科技大厦</text>
+				<text>{{orderdata.detail.start_location_address}}</text>
 			</view>
 			<view class="tel-box">
-				15816171622
+				{{orderdata.detail.start_phone}}
 			</view>
 			<view class="dj-text">
 				(出发位置)
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text style="background-color: #EE3709;">终</text>
-				<text>上车后告知司机位置</text>
+				<text>{{orderdata.detail.end_location_address || '上车后告知司机位置'}}</text>
 			</view>
 			<view class="dj-text">
 				(终点位置)
 			</view>
 			<view class="qibu-price">
-				须付金额:¥10.0元
-			</view>
-			<view class="price-tips">
-				价格说明:起步价15.00元+路程费+超程返程费+等待超时费用
+				须付金额:{{orderdata.detail.payment_price_desc}}
+			</view>
+			<view class="price-tips">
+				<view>
+					价格说明:{{orderdata.detail.price_desc}}
+				</view>
+				<view style="color: #2AA47F;" v-if="orderdata.detail.actual_location_address">送达位置:{{orderdata.detail.actual_location_address}}</view>
 			</view>
 		</view>
 		<view class="paotui-box" v-if="type == 2">
@@ -73,51 +87,55 @@
 				<view class="order-goods-box u-flex u-col-center">
 					<image src="../../static/images/t2.png" class="goods-img" mode=""></image>
 					<view class="goods-right">
-						<view class="goods-name">
-							跑腿类型:帮我买
-						</view>
-						<view class="goods-jieshao">
-							物品信息:文件 预计商品费用:1.0元
-						</view>
-						<view class="goods-price">
-							<text>预约送达时间:2022-04-04 09:49:00</text>
+						<view class="goods-name" v-if="orderdata.run.type == 0">跑腿类型:帮我送</view>
+						<view class="goods-name" v-if="orderdata.run.type == 1">跑腿类型:帮我取</view>
+						<view class="goods-name" v-if="orderdata.run.type == 2">跑腿类型:帮我买</view>
+						<view class="goods-jieshao" v-if="orderdata.run.type == 2">
+							物品信息:{{orderdata.run.remark}} 预计商品费用:{{orderdata.run.fee}}元
+						</view>
+						<view class="goods-jieshao" v-else>
+							物品信息:{{orderdata.run.remark}} {{orderdata.run.weight}}公斤
+						</view>
+						<view class="goods-price">
+							<text v-if="orderdata.run.type == 2">预约送达时间:{{orderdata.run.come_time}}</text>
+							<text v-else>预约取件时间:{{orderdata.run.come_time}}</text>
 						</view>
 					</view>
 				</view>
 				<view class="taocan-box">
-					商品图(无)
-				</view>
-				<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;">
-					<image src="../../static/images/648.png" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;"
-						mode=""></image>
+					物品图{{orderdata.run.image_gather_code ? '' :'(无)'}}
+				</view>
+				<view class="u-flex u-col-center u-flex-wrap" style="margin-bottom: 20rpx;" v-if="orderdata.run.image_gather">
+					<image @click="openimage(index)" v-for="(item,index) in orderdata.run.image_gather" :key="index" :src="item.src" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;" mode=""></image>
 				</view>
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text>起</text>
-				<text>广东省汕头市龙湖区汕头高新区科技东路9号超声科技大厦</text>
+				<text v-if="orderdata.run.start_location_address">{{orderdata.run.start_location_address}}{{orderdata.run.start_address}}</text>
+				<text v-else>骑手就近购买</text>
 			</view>
 			<view class="tel-box u-flex u-col-center">
-				<text class="text1"></text>
-				<text class="text2">15816171622</text>
+				<text class="text1">{{orderdata.run.start_name}}</text>
+				<text class="text2">{{orderdata.run.start_phone}}</text>
 			</view>
 			<view class="dj-text">
 				(取件地址)
 			</view>
 			<view class="qidian u-flex u-col-center">
 				<text style="background-color: #EE3709;">终</text>
-				<text>上车后告知司机位置</text>
+				<text>{{orderdata.run.end_location_address}}{{orderdata.run.end_address}}</text>
 			</view>
 			<view class="tel-box u-flex u-col-center">
-				<text class="text1"></text>
-				<text class="text2">15816171622</text>
+				<text class="text1">{{orderdata.run.end_name}}</text>
+				<text class="text2">{{orderdata.run.end_phone}}</text>
 			</view>
 			<view class="dj-text">
 				(送件地址)
 			</view>
 			<view class="price-box u-flex-col u-col-top">
-				<text>需付金额:0.00元+实际商品费用</text>
+				<text>需付金额:{{orderdata.run.payment_price_desc}}</text>
 				<text>
-					价格说明:价格说明:起步价14.00元,预计距离0.0600公里,距离附加费19998.00元,重量附加费0.00元,特殊时段附加费0.00元,实际商品费用N元,扣除优惠费0.00元,需支付20012.00元+实际商品费用
+					价格说明:{{orderdata.run.price_desc}}
 				</text>
 			</view>
 		</view>
@@ -126,10 +144,8 @@
 				<view class="address-title">
 					收货信息
 				</view>
-				<view class="address-text">了 15816171622</view>
-				<view class="address-text">广东省潮州市湘桥区凤东路(潮州 •恒大城东侧约100米)潮州
-					市黄金塘科目二考场 广东省潮州市湘桥区桥东街道黄金塘
-					小学西北茂源混凝士</view>
+				<view class="address-text">{{orderdata.detail.name}} {{orderdata.detail.phone}}</view>
+				<view class="address-text">{{orderdata.detail.address}}{{orderdata.detail.location_address}}</view>
 			</view>
 			<view class="goods-title">
 				商品信息
@@ -139,91 +155,210 @@
 					<image src="../../static/images/shop-order.png" class="goods-img" mode=""></image>
 					<view class="goods-right">
 						<view class="goods-name">
-							这是名字这是名字这是名字
+							{{orderdata.detail.business_product_redundancy.title}}
 						</view>
 						<view class="goods-jieshao">
-							这是名字这是名字这是名字
+							{{orderdata.detail.business_product_redundancy.desc}}
 						</view>
 						<view class="goods-price">
-							<text>¥50.0</text>
-							<text>门市价:¥100</text>
+							<text>¥{{orderdata.detail.business_product_specifications_redundancy.sale_price}}</text>
+							<text>门市价:¥{{orderdata.detail.business_product_specifications_redundancy.original_price}}</text>
 						</view>
 					</view>
 				</view>
 				<view class="taocan-box">
-					套餐1:鸡翅+鸡翅
+					{{orderdata.detail.business_product_specifications_redundancy.title}}:{{orderdata.detail.business_product_specifications_redundancy.desc}}
 				</view>
 			</view>
 			<view class="taocan-count u-flex u-col-center">
-				<text>套餐1</text>
-				<text>x1</text>
-				<text>¥50</text>
+				<text>{{orderdata.detail.business_product_specifications_redundancy.title}}</text>
+				<text>x{{orderdata.detail.number}}</text>
+				<text>¥{{orderdata.detail.payment_price}}</text>
 			</view>
 			<view class="price-box u-flex u-col-center u-row-right">
-				<text>商品原价:¥100</text>
-				<text>优惠:¥100</text>
-				<text>配送费:¥100</text>
+				<text>商品原价:¥{{orderdata.detail.original_sale_price}}</text>
+				<text>优惠:¥{{orderdata.detail.discount_amount}}</text>
+				<text>配送费:¥{{orderdata.detail.express_delivery_price}}</text>
 			</view>
 			<view class="shuoming-title">
-				快递费用说明:123
+				快递费用说明:{{orderdata.detail.express_delivery_price_text}}
 			</view>
 			<view class="shuoming-title">
-				优惠金额说明:23
+				优惠金额说明:{{orderdata.detail.discount_amount_text}}
 			</view>
 			<view class="peisong-type">
-				配送方式:到家
+				配送方式:{{orderdata.detail.pickup_method == 1 ? '到家' : orderdata.detail.pickup_method == 2 ? '到店' : '送货上门'}}
 			</view>
 			<view class="goods-title" style="padding-bottom: 0;">
 				商家信息
 			</view>
 			<view class="fapiao">
-				商家信息:测试商家
+				商家信息:{{orderdata.detail.business.title}}
 			</view>
 			<view class="fapiao">
-				购买须知:购买该商品需要在2020-12-12前使用
+				{{orderdata.detail.business_product_redundancy.purchase_note}}
 			</view>
 		</view>
-		<view class="jiedan-box" v-if="type != 3">
+		<view class="jiedan-box" v-if="orderdata.order_facilitator">
 			<view class="jiedan-top u-flex u-col-center u-row-between">
 				<text>接单人信息</text>
-				<text>已完成</text>
-			</view>
-			<view class="jiedan-user u-flex u-col-center">
-				<image src="../../static/images/order1-2.png" mode=""></image>
-				<view class="user-right u-flex-col">
-					<text>姓名:1</text>
-					<view class="u-flex u-col-center">
-						<text>联系电话:</text>
-						<u-icon name="phone-fill" color="#0DA98C"></u-icon>
-						<text style="color: #0DA98C;">15816171622</text>
-					</view>
-					<text>工号:1A7700A9572694E5A6D12DBAB2B99A02</text>
-				</view>
-			</view>
-			<view class="jiedan-time">
-				接单时间:2022-02-17 14:58:17
+				<text v-if="orderdata.order_facilitator.status == 0">待确认</text>
+				<text v-if="orderdata.order_facilitator.status == 1">{{orderdata.source_type == 1 ? '已接单' : '未出发'}}</text>
+				<text v-if="orderdata.order_facilitator.status == 2">{{orderdata.source_type == 1 ? '等待客户' : '已出发'}}</text>
+				<text v-if="orderdata.order_facilitator.status == 3">{{orderdata.source_type == 1 ? '已出发' : '已到达'}}</text>
+				<text v-if="orderdata.order_facilitator.status == 4">已完成</text>
+				<text v-if="orderdata.order_facilitator.status == -1">用户取消</text>
+				<text v-if="orderdata.order_facilitator.status == -2">服务商取消</text>
+			</view>
+			<view class="jiedan-user u-flex u-col-center">
+				<image :src="orderdata.order_facilitator.facilitator.headimgurl_image_src" mode=""></image>
+				<view class="user-right u-flex-col">
+					<text>姓名:{{orderdata.order_facilitator.facilitator.name}}</text>
+					<view class="u-flex u-col-center" @click="$tophone(orderdata.order_facilitator.facilitator.phone)">
+						<text>联系电话:</text>
+						<u-icon name="phone-fill" color="#0DA98C"></u-icon>
+						<text style="color: #0DA98C;">{{orderdata.order_facilitator.facilitator.phone}}</text>
+					</view>
+					<text>工号:{{orderdata.order_facilitator.facilitator.facilitator_uid}}</text>
+				</view>
+			</view>
+			<view class="jiedan-time">
+				接单时间:{{orderdata.order_facilitator.create_time}}
 			</view>
 		</view>
-		<view class="fapiao">
-			是否需要发票:否
+		<view class="fapiao u-flex-col">
+			<text>是否需要发票:{{orderdata.is_invoice == 1 ? '是' : '否'}}</text>
+			<text v-if="orderdata.is_invoice == 1">发票抬头:{{orderdata.invoice_title}}</text>
 		</view>
 		<view class="order-down u-flex-col">
 			<text v-if="type == 0">维修服务</text>
 			<text v-if="type == 1">代驾服务</text>
 			<text v-if="type == 2">跑腿服务</text>
 			<text v-if="type == 3">购买商品</text>
-			<text>下单时间:2022-04-02 10:52:56</text>
-			<text>接单时间:2022-04-02 10:52:56</text>
-			<text>发货时间:2022-04-02 10:52:56</text>
+			<text v-if="orderdata.detail.create_time">下单时间:{{orderdata.detail.create_time}}</text>
+			<text v-if="orderdata.detail.payment_time">付款时间:{{orderdata.detail.payment_time}}</text>
+			<text v-if="orderdata.detail.write_off_time">核销时间:{{orderdata.detail.write_off_time}}</text>
+			<text v-if="orderdata.order_facilitator">接单时间:{{orderdata.order_facilitator.create_time}}</text>
+			<text v-if="orderdata.ing_time">发货时间:{{orderdata.ing_time}}</text>
+			<text v-if="orderdata.complete_time">完成时间:{{orderdata.complete_time}}</text>
+		</view>
+		<view style="height: 120rpx;"></view>
+		<view v-if="type == 0">
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 0">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 1">
+				<x-button v-if="orderdata.order_facilitator.status == 1" class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 2">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 3">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="openpingjia()">评价订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 4">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == -1 || orderdata.order_status == -2">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="shanchu()">删除订单</x-button>
+			</view>
+		</view>
+		<view v-if="type == 1">
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 0">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 1">
+				<x-button v-if="orderdata.order_facilitator.status == 1" class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 2">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 3">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="openpingjia()">评价订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 4">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == -1 || orderdata.order_status == -2">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="shanchu()">删除订单</x-button>
+			</view>
+		</view>
+		<view v-if="type == 2">
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 0">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 1">
+				<x-button v-if="orderdata.order_facilitator.status == 1" class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 2">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 3">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="openpingjia()">评价订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 4">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == -1 || orderdata.order_status == -2">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="shanchu()">删除订单</x-button>
+			</view>
 		</view>
-		<view style="height: 120rpx;"></view>
-		<view class="down-box u-flex u-col-center u-row-right">
-			<x-button style="margin-right: 20rpx;" :width="180" :height="60" fontSize="24rpx" borderRadius="20rpx">取消订单
-			</x-button>
-			<x-button style="margin-right: 20rpx;" :width="180" :height="60" fontSize="24rpx" borderRadius="20rpx">评价订单
-			</x-button>
-			<x-button :width="180" :height="60" fontSize="24rpx" borderRadius="20rpx" @click="tojindu">服务进度</x-button>
+		<view v-if="type == 3">
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 0 && orderdata.is_payment == 0">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="topay()">去付款</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 0 && orderdata.is_payment == 1">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="quxiao()">取消订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="hexiao()">核销码</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == -1">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="shanchu()">删除订单</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 3">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="openpingjia()">评价订单</x-button>
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
+			<view class="down-box u-flex u-col-center u-row-right" v-if="orderdata.order_status == 4">
+				<x-button class="text2" :width="110" :height="53" borderRadius="20rpx" fontSize="19rpx" @click="tojindu()">服务进度</x-button>
+			</view>
 		</view>
+		<u-popup v-model="show" mode="bottom">
+			<view class="hexiaoma u-flex-col u-col-center">
+				<view style="color: #2AA47F;padding: 20rpx;">核销码</view>
+				<uqrcode style="margin-bottom: 40rpx;" ref="uQRCode" :text="hexiaourl" :size="160" />
+			</view>
+		</u-popup>
+		<u-popup v-model="pingjia" mode="bottom">
+			<view class="pingjia-box u-flex-col u-col-center">
+				<text style="padding: 20rpx;">评价服务订单</text>
+				<view class="dianzan-box u-flex u-col-center u-row-center" style="padding: 20rpx 0;">
+					<view class="dianzan-item u-flex-col u-col-center" style="padding: 0 30rpx;" @tap="dianzan = true">
+						<u-icon name="thumb-up" size="46" :color="dianzan ? '#2AA47F' : '#999'"></u-icon>
+						<text>点赞</text>
+					</view>
+					<view class="dianzan-item u-flex-col u-col-center u-row-center" style="padding: 0 30rpx;" @tap="dianzan = false">
+						<u-icon name="thumb-down" size="46" :color="!dianzan ? '#2AA47F' : '#999'"></u-icon>
+						<text>差评</text>
+					</view>
+				</view>
+				<x-button :height='80' style="margin:10rpx 0 30rpx 0;" @click="topingjia">评价订单</x-button>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -231,38 +366,144 @@
 	export default {
 		data() {
 			return {
-				type: ''
+				type: '',//0维修1代驾2跑腿3商品
+				orderdata: {},
+				show: false,
+				hexiaourl: '',
+				pingjia: false,
+				dianzan: true
 			}
 		},
 		onLoad(option) {
-			this.type = option.index
+			this.id = option.id
 		},
 		onShow() {
-			if (this.type == 0) {
-				uni.setNavigationBarTitle({
-					title: "维修服务订单"
+			this.getdata()
+		},
+		methods: {
+			openimage(index){
+				var arr  = []
+				this.orderdata.detail.image_gather.forEach(val => {
+					arr.push(val.src)
+				})
+				uni.previewImage({
+					urls:arr,
+					current:index
+				})
+			},
+			topingjia() {
+				this.$u.post('/Order/comment', {
+					content: {
+						evaluate_level: this.dianzan ? 5 : 1,
+						order_no: this.id
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						this.pingjia = false
+						setTimeout(() => {
+							this.getdata()
+						}, 800)
+					}
 				})
-			}
-			if (this.type == 1) {
-				uni.setNavigationBarTitle({
-					title: "代驾服务订单"
+			},
+			openpingjia() {
+				this.pingjia = true
+			},
+			hexiao(item) {
+				this.hexiaourl = this.orderdata.detail.write_off_code_url
+				this.show = true
+			},
+			topay() {
+				this.$u.post('/Order/payment', {
+					content: {
+						order_no: this.id,
+						type: 1
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						uni.requestPayment({
+							nonceStr: res.response.nonceStr,
+							package: res.response.package,
+							paySign: res.response.paySign,
+							signType: res.response.signType,
+							timeStamp: res.response.timeStamp,
+							success: (res) => {
+								this.$u.toast("支付成功")
+								setTimeout(() => {
+									this.getdata()
+								}, 800)
+							},
+							fail: (err) => {
+								this.$u.toast("支付失败")
+							}
+						})
+					} else {
+						this.$u.toast(res.msg)
+					}
 				})
-			}
-			if (this.type == 2) {
-				uni.setNavigationBarTitle({
-					title: "跑腿服务订单"
+			},
+			shanchu() {
+				this.$u.post('/Order/delete', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					}
 				})
-			}
-			if (this.type == 3) {
-				uni.setNavigationBarTitle({
-					title: "商品订单"
+			},
+			quxiao() {
+				this.$u.post('/Order/cancel', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					this.$u.toast(res.msg)
+					if (res.code == 0) {
+						setTimeout(() => {
+							this.getdata()
+						}, 800)
+					}
 				})
-			}
-		},
-		methods: {
+			},
+			getdata() {
+				this.$u.post('/Order/get', {
+					content: {
+						order_no: this.id
+					}
+				}).then(res => {
+					this.type = res.response.source_type
+					this.orderdata = res.response
+					if (this.type == 0) {
+						uni.setNavigationBarTitle({
+							title: "维修服务订单"
+						})
+					}
+					if (this.type == 1) {
+						uni.setNavigationBarTitle({
+							title: "代驾服务订单"
+						})
+					}
+					if (this.type == 2) {
+						uni.setNavigationBarTitle({
+							title: "跑腿服务订单"
+						})
+					}
+					if (this.type == 3) {
+						uni.setNavigationBarTitle({
+							title: "商品订单"
+						})
+					}
+				})
+			},
 			tojindu() {
 				uni.navigateTo({
-					url: "./jindu"
+					url: "./jindu?id=" + this.id
 				})
 			},
 		}
@@ -340,7 +581,7 @@
 					.goods-img {
 						width: 150rpx;
 						height: 150rpx;
-						border-radius: 10rpx;
+						border-radius: 100rpx;
 						margin-right: 20rpx;
 					}
 
@@ -603,7 +844,8 @@
 				image {
 					width: 150rpx;
 					height: 150rpx;
-					margin-right: 10rpx;
+					margin-right: 10rpx;
+					border-radius: 100rpx;
 				}
 
 				.user-right {
@@ -621,6 +863,10 @@
 			left: 0;
 			width: 750rpx;
 			padding: 20rpx 24rpx 30rpx 24rpx;
+
+			.text2 {
+				margin-right: 20rpx;
+			}
 		}
 
 		.order-down {

Diff do ficheiro suprimidas por serem muito extensas
+ 1406 - 688
pages/order/order.vue


+ 330 - 84
pages/shop/goods-info.vue

@@ -1,15 +1,15 @@
 <template>
-	<view class="goods-info">
+	<view class="goods-info" v-if="goodsinfo.id">
 		<u-navbar :background="{background:`rgba(42, 164, 127,${opacity})`}" :borderBottom="false" :immersive="true"
 			:is-back="false">
 			<view solt="left" class="navbar-body u-flex u-col-center">
 				<view class="item" style="background-color: rgba(0,0,0,0.16);" @tap="toback">
 					<u-icon name="arrow-left" size="36" color="#fff"></u-icon>
 				</view>
-				<view class="item" @tap="tosearch">
+				<!-- <view class="item" @tap="tosearch">
 					<image src="../../static/images/info1-1.png" mode=""></image>
-				</view>
-				<button class="item">
+				</view> -->
+				<button class="item" open-type="share">
 					<image src="../../static/images/info1-2.png" mode=""></image>
 				</button>
 			</view>
@@ -18,40 +18,96 @@
 			</view>
 		</u-navbar>
 		<view class="swiper">
-			<u-swiper :list="list" height="750" indicator-pos="bottomRight"></u-swiper>
+			<u-swiper name="src" :list="list" height="750" indicator-pos="bottomRight"></u-swiper>
 		</view>
 		<view class="goods-name">
-			这里是商品标题(这里是商品标题)
+			{{goodsinfo.title}}
 		</view>
 		<view class="jieshao">
-			这里商品介绍
+			{{goodsinfo.desc}}
 		</view>
 		<view class="price u-flex u-col-center">
-			<text>¥10.00</text>
-			<text>门市价 </text>
+			<text>¥{{goodsinfo.show_sale_price}}</text>
+			<text>门市价¥{{goodsinfo.show_original_price}}</text>
 		</view>
 		<view class="count u-flex u-col-center">
-			<text>销量 0</text>
-			<text>库存 9999</text>
+			<text>销量 {{goodsinfo.show_sales_number}}</text>
+			<text>库存 {{goodsinfo.show_stock_number}}</text>
 		</view>
 		<view class="content-text">
-
+			<view class="content-top">
+				<view class="top-row">
+					<text>已选:{{skuitem.title}}/数量:{{count}}</text>
+					<u-icon name="arrow-right"></u-icon>
+				</view>
+				<view class="top-row">
+					<text>规则:{{goodsinfo.rule_desc}}</text>
+				</view>
+				<view class="top-row">
+					<text>商家名称:{{goodsinfo.business.title}}</text>
+				</view>
+				<view class="shop-tips">
+					适用店铺
+				</view>
+				<view class="shop-item" v-for="(item,index) in goodsinfo.business.shop" :key="index">
+					<view class="shop-name">
+						{{item.title}}
+					</view>
+					<view class="shop-address u-flex u-col-center" @tap="openmap(item)">
+						<text>{{item.address}}</text>
+						<image src="../../static/images/order1-1.png" mode=""></image>
+					</view>
+				</view>
+			</view>
+			<rich-text :nodes="content"></rich-text>
+			<!-- <u-parse :html="content"></u-parse> -->
 		</view>
 		<view style="height: 130rpx;"></view>
 		<view class="down-tabs u-flex u-col-center u-row-between">
-			<view class="icon-item u-flex-col u-col-center" @tap="tohome">
-				<image src="../../static/images/info1-3.png" mode=""></image>
-				<text>主页</text>
-			</view>
-			<view style="height: 72rpx;width: 2rpx;background-color: #EEEEEE;"></view>
-			<button class="icon-item u-flex-col u-col-center">
-				<image src="../../static/images/info1-4.png" mode=""></image>
-				<text>客服</text>
-			</button>
-			<view class="tobuy" @tap="topay">
-				立即购买
+			<view class="icon-item u-flex-col u-col-center" @tap="tohome">
+				<image src="../../static/images/info1-3.png" mode=""></image>
+				<text>主页</text>
+			</view>
+			<view style="height: 72rpx;width: 2rpx;background-color: #EEEEEE;"></view>
+			<button class="icon-item u-flex-col u-col-center" open-type="contact">
+				<image src="../../static/images/info1-4.png" mode=""></image>
+				<text>客服</text>
+			</button>
+			<view class="tobuy" @tap="topay">
+				立即购买
 			</view>
 		</view>
+		<u-popup mode="bottom" v-model="show">
+			<view class="change-sku">
+				<view class="sku-top u-flex u-col-center">
+					<image src="../../static/images/shop-order.png" mode=""></image>
+					<view class="top-right">
+						<view class="sku-name">
+							{{skuitem.desc}}
+						</view>
+						<view class="sku-price u-flex u-col-center">
+							<text>¥{{skuitem.sale_price}}</text>
+							<text>门市价¥{{skuitem.original_price}}</text>
+							<text>销量{{skuitem.virtual_sales_number}}</text>
+						</view>
+					</view>
+				</view>
+				<view class="sku-box u-flex u-col-center">
+					<text :class="skuindex == index ? 'text' : ''" v-for="(item,index) in goodsinfo.specifications"
+						:key="index" @tap='changesku(index)'>{{item.title}}</text>
+				</view>
+				<view class="buy-count u-flex u-col-center">
+					<text class="text1">购买数量</text>
+					<text class="text2">库存 {{skuitem.stock_number}} 限购数量 {{goodsinfo.buy_limit_number}}</text>
+					<u-icon name="minus-circle-fill" color="#F7CB16" size="42" @click="jian"></u-icon>
+					<text class="text3">{{count}}</text>
+					<u-icon name="plus-circle-fill" color="#F7CB16" size="42" @click="add"></u-icon>
+				</view>
+				<view class="xiadan" @tap="tobuy">
+					确认下单
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -60,23 +116,18 @@
 		data() {
 			return {
 				opacity: 0,
-				list: [{
-						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
-						title: '昨夜星辰昨夜风,画楼西畔桂堂东'
-					},
-					{
-						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
-						title: '身无彩凤双飞翼,心有灵犀一点通'
-					},
-					{
-						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
-						title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
-					}
-				],
+				list: [],
+				goodsinfo: {},
+				content: '',
+				show: false,
+				count: 1,
+				skuitem: {},
+				skuindex: 0
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			this.id = option.id
+			this.getdata()
 		},
 		onPageScroll(e) {
 			var a = e.scrollTop / 200
@@ -85,17 +136,77 @@
 			} else {
 				this.opacity = a
 			}
+		},
+		onShareAppMessage(){
+			
 		},
-		methods: {
-			topay(){
-				uni.navigateTo({
-					url:"./xiadan"
-				})
+		methods: {
+			add() {
+				this.count = this.count + 1
+			},
+			jian() {
+				if (this.count == 1) {
+
+				} else {
+					this.count = this.count - 1
+				}
+			},
+			changesku(index) {
+				this.skuindex = index
+				this.skuitem = this.goodsinfo.specifications[this.skuindex]
+			},
+			openmap(item) {
+				uni.openLocation({
+					latitude: Number(item.lat),
+					longitude: Number(item.lng),
+					address: item.address,
+					name: item.title
+				})
+			},
+			getdata() {
+				this.$u.post('/Business/getBusinessProductById', {
+					content: {
+						id: this.id
+					}
+				}).then(res => {
+					this.list = res.response.details_gather
+					this.goodsinfo = res.response
+					this.skuitem = this.goodsinfo.specifications[0]
+					const regex = new RegExp('<img', 'gi')
+					const regex1 = new RegExp('<table', 'gi')
+					const regex2 = new RegExp(`width="750"`, 'gi')
+					this.content = this.goodsinfo.details_desc.replace(regex,
+						`<img style="max-width: 100% !important; height: auto"`)
+					this.content = this.content.replace(regex1, `<table style="max-width:100% !important"`)
+					this.content = this.content.replace(regex2, ``)
+				})
 			},
-			tohome(){
-				uni.switchTab({
-					url:"../index/index"
-				})
+			tobuy(){
+				this.show = false
+				var obj = this.skuitem
+				obj.count = this.count
+				obj.goodsname = this.goodsinfo.title
+				obj.goodsdesc = this.goodsinfo.desc
+				obj.buy_limit_number = this.goodsinfo.buy_limit_number
+				if(uni.getStorageSync("token")){
+					uni.navigateTo({
+						url: "./xiadan?obj=" + encodeURIComponent(JSON.stringify(obj))
+					})
+				}else{
+					uni.navigateTo({
+						url:"../mine/login-code"
+					})
+				}
+				
+			},
+			topay() {
+				this.show = true
+				
+			},
+			tohome() {
+				uni.switchTab({
+					url: "../index/home"
+				})
 			},
 			toback() {
 				uni.navigateBack()
@@ -111,54 +222,187 @@
 
 <style lang="scss">
 	.goods-info {
+		.change-sku {
+			.xiadan {
+				width: 710rpx;
+				margin: 30rpx auto;
+				height: 80rpx;
+				text-align: center;
+				line-height: 80rpx;
+				background-color: #F7CB16;
+				border-radius: 10rpx;
+			}
+
+			.buy-count {
+				margin-bottom: 20rpx;
+				padding: 0 20rpx;
+
+				.text3 {
+					margin: 0 10rpx;
+				}
+
+				.text1 {
+					margin-right: 10rpx;
+				}
+
+				.text2 {
+					flex: 1;
+					color: rgba(0, 0, 0, 0.6);
+					font-size: 28rpx;
+				}
+			}
+
+			.sku-box {
+				padding: 0 20rpx;
+				margin-bottom: 20rpx;
+
+				text {
+					margin-right: 10rpx;
+					padding: 6rpx 20rpx;
+					border-radius: 10rpx;
+					border: 1rpx solid #09AA8C;
+					color: #09AA8C;
+					font-size: 26rpx;
+				}
+
+				.text {
+					color: #fff;
+					background-color: #09AA8C;
+				}
+			}
+
+			.sku-top {
+				padding: 20rpx;
+
+				.top-right {
+					flex: 1;
+
+					.sku-price {
+						text:first-child {
+							color: red;
+							font-size: 32rpx;
+						}
+
+						text:nth-child(2) {
+							font-size: 24rpx;
+							margin: 0 10rpx;
+							text-decoration: line-through;
+							color: rgba(0, 0, 0, 0.4);
+						}
+
+						text:last-child {}
+					}
+
+					.sku-name {
+						margin-bottom: 10rpx;
+					}
+				}
+
+				image {
+					margin-right: 20rpx;
+					width: 130rpx;
+					height: 130rpx;
+					border-radius: 100rpx;
+				}
+			}
+		}
+
 		.down-tabs {
+
 			position: fixed;
 			bottom: 0;
 			left: 0;
 			width: 750rpx;
 			height: 126rpx;
-			background-color: #09AA8C;
-			.tobuy{
-				width: 433rpx;
-				border-radius: 10rpx;
-				text-align: center;
-				line-height: 79rpx;
-				font-size: 42rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				background-color: #FDCE1C;
-				height: 79rpx;
-				margin: 0 54rpx;
-			}
-			.icon-item{
-				padding: 0 22rpx;
-				background-color: rgba(0,0,0,0);
-				border: none;
-				image{
-					width: 55rpx;
-					height: 55rpx;
-					margin-bottom:10rpx;
-				}
-				text{
-					font-size: 22rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #EEEEEE;
-					line-height: 1;
-				}
-			}
-			.icon-item:after{
-				border: none;
+			background-color: #09AA8C;
+
+			.tobuy {
+				width: 433rpx;
+				border-radius: 10rpx;
+				text-align: center;
+				line-height: 79rpx;
+				font-size: 42rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				background-color: #FDCE1C;
+				height: 79rpx;
+				margin: 0 54rpx;
+			}
+
+			.icon-item {
+				padding: 0 22rpx;
+				background-color: rgba(0, 0, 0, 0);
+				border: none;
+
+				image {
+					width: 55rpx;
+					height: 55rpx;
+					margin-bottom: 10rpx;
+				}
+
+				text {
+					font-size: 22rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #EEEEEE;
+					line-height: 1;
+				}
+			}
+
+			.icon-item:after {
+				border: none;
 			}
 		}
 
 		.content-text {
 			margin: 20rpx auto;
 			width: 709rpx;
-			height: 584rpx;
+			// height: 584rpx;
 			background-color: #fff;
 			border-radius: 20rpx;
-			padding: 24rpx;
+			padding: 0 24rpx 24rpx 24rpx;
+
+			.content-top {
+				margin-bottom: 20rpx;
+
+				.shop-item {
+					background-color: rgba(0, 0, 0, 0.1);
+					padding: 0 15rpx;
+					font-size: 26rpx;
+					margin-bottom: 15rpx;
+
+					.shop-name {
+						padding: 15rpx 0;
+						border-bottom: 1rpx solid #D9CA15;
+						margin-bottom: 15rpx;
+					}
+
+					.shop-address {
+						padding-bottom: 15rpx;
+
+						text {}
+
+						image {
+							width: 40rpx;
+							height: 40rpx;
+						}
+					}
+				}
+
+				.shop-tips {
+					font-size: 26rpx;
+					padding: 15rpx 0;
+				}
+
+				.top-row {
+					padding: 15rpx 0;
+					border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					font-size: 26rpx;
+				}
+			}
 		}
 
 		.count {
@@ -208,7 +452,8 @@
 
 		.nav-bar-title {
 			text-align: center;
-			margin-left: 34rpx;
+			flex: 1;
+			// margin-left: 34rpx;
 		}
 
 		.navbar-body {
@@ -222,8 +467,9 @@
 				display: flex;
 				align-items: center;
 				justify-content: center;
-				padding: 0;
-				background-color: rgba(0,0,0,0);
+				padding: 0;
+				background-color: rgba(0, 0, 0, 0);
+
 				image {
 					width: 65rpx;
 					height: 65rpx;

+ 30 - 12
pages/shop/myshop.vue

@@ -3,26 +3,26 @@
 		<u-navbar :background="{background:'#2AA47F'}" title="我的店铺" :borderBottom="false"
 			title-color="#fff" back-icon-color="#fff">
 			<view class="left-box u-flex u-col-center" slot="left">
-				<view style="width: 47rpx;height: 43rpx;position: relative;margin-right: 25rpx;">
+				<!-- <view style="width: 47rpx;height: 43rpx;position: relative;margin-right: 25rpx;" @click="toxiaoxi">
 					<image src="../../static/images/index1-2.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
-					<text style="position: absolute;top: -20rpx;right: -10rpx;font-size: 22rpx;width: 30rpx;height: 30rpx;text-align: center;line-height: 30rpx;border-radius: 100rpx;color: #fff;background-color: red;">99</text>
-				</view>
+					<text style="position: absolute;top: -20rpx;right: -10rpx;font-size: 22rpx;width: 30rpx;height: 30rpx;text-align: center;line-height: 30rpx;border-radius: 100rpx;color: #fff;background-color: red;">{{count > 99 ? '99+' : count}}</text>
+				</view> -->
 				<image src="../../static/images/index1-3.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
 			</view>
 		</u-navbar>
-		<view class="shop-item">
+		<view class="shop-item" v-for="(item,index) in userdata.business_admin" :key="index">
 			<view class="top u-flex u-col-top u-row-between">
-				<text>西湖总店[总店]</text>
-				<text>正常</text>
+				<text>{{item.title}}</text>
+				<text>{{item.status == 0 ? '关闭' : '正常'}}</text>
 			</view>
 			<view class="jianjie">
-				商家店铺简介商家店铺简介
+				{{item.location_address}} {{item.address}}
 			</view>
 			<view class="name">
-				商家用户名1
+				{{item.business_title}}
 			</view>
 			<view class="u-flex u-col-center u-row-right">
-				<x-button :width="221" :height="76" color="#000" fontSize="25rpx" borderRadius="20rpx" @click="toorder">查看订单</x-button>
+				<x-button :width="221" :height="76" color="#000" fontSize="25rpx" borderRadius="20rpx" @click="toorder(item)">查看订单</x-button>
 			</view>
 		</view>
 	</view>
@@ -32,16 +32,34 @@
 	export default {
 		data(){
 			return{
-				
+				count:0,
+				userdata:{}
 			}
 		},
 		onLoad() {
 			
 		},
+		onShow() {
+			if (uni.getStorageSync("token")) {
+				this.getuser()
+			} else {
+				this.userdata = {}
+			}
+		},
 		methods:{
-			toorder(){
+			getuser() {
+				this.$u.post('/User/getDetail').then(res => {
+					if (res.code == 0) {
+						this.userdata = res.response
+					} else {
+						this.$u.toast(res.msg)
+						this.userdata = {}
+					}
+				})
+			},
+			toorder(item){
 				uni.navigateTo({
-					url:"./shop-order"
+					url:"./shop-order?id=" + item.id
 				})
 			}
 		}

+ 218 - 92
pages/shop/search.vue

@@ -1,94 +1,101 @@
 <template>
 	<view class="search">
-		<view class="header u-flex u-col-center u-row-between">
-			<view class="left u-flex u-col-center">
-				<image src="../../static/images/search1-2.png" mode=""></image>
-				<input type="text" placeholder="请输入搜索关键词" />
-			</view>
-			<view class="right">
-				搜索
-			</view>
-		</view>
-		<view class="lishi-box" v-if="0">
-			<view class="top u-flex u-col-center u-row-between">
-				<text>搜索历史记录</text>
-				<image src="../../static/images/search1-1.png" mode=""></image>
-			</view>
-			<view class="down u-flex u-col-center u-flex-wrap">
-				<text v-for="(item,index) in 3" :key="index">手机</text>
+		<view style="position: sticky;top: 0;left: 0;z-index: 99;background-color: #E3F7F0;padding-bottom: 20rpx;">
+			<view class="header u-flex u-col-center u-row-between">
+				<view class="left u-flex u-col-center">
+					<image src="../../static/images/search1-2.png" mode=""></image>
+					<input type="text" placeholder="请输入搜索关键词" v-model="keyword" />
+				</view>
+				<view class="right" @tap="tosearch">
+					搜索
+				</view>
 			</view>
-		</view>
-		<view class="goods-box" v-else>
-			<view class="shaixuan-box u-flex u-col-center u-row-between">
-				<view class="itme">
-					<view class="u-flex u-col-center u-row-center" @tap="show1 = true">
-						<text>综合</text>
-						<view class="image">
-							<image src="../../static/images/search1-3.png" mode=""></image>
+			<view class="goods-box" v-if="goodslist.length > 0 || showgoods">
+				<view class="shaixuan-box u-flex u-col-center u-row-between">
+					<view class="itme">
+						<view class="u-flex u-col-center u-row-center" @tap="show1 = true">
+							<text>{{paixu}}</text>
+							<view class="image">
+								<image src="../../static/images/search1-3.png" mode=""></image>
+							</view>
 						</view>
-					</view>
-					<view class="xiala-box" @tap="show1 = false" v-if="show1">
-						<view class="xiala-body u-flex-col u-col-center" @tap.stop>
-							<view class="jiantou"></view>
-							<view class="body u-flex-col u-col-center">
-								<text>综合</text>
-								<text>距离</text>
-								<text>售价</text>
-								<text>销量</text>
+						<view class="xiala-box" v-if="show1">
+							<view class="xiala-body u-flex-col u-col-center" @tap.stop>
+								<view class="jiantou"></view>
+								<view class="body u-flex-col u-col-center">
+									<text @tap="changepaixu('complex','综合')">综合</text>
+									<text @tap="changepaixu('distance','距离')">距离</text>
+									<text @tap="changepaixu('sale_price','售价')">售价</text>
+									<text @tap="changepaixu('show_sales_number','销量')">销量</text>
+								</view>
 							</view>
 						</view>
 					</view>
-				</view>
-				<view class="itme u-flex u-col-center u-row-center">
-					<text>排序</text>
-					<view class="image">
-						<image style="left: -234rpx;" src="../../static/images/search1-3.png" mode=""></image>
-					</view>
-				</view>
-				<view class="itme">
-					<view class="u-flex u-col-center u-row-center" @tap="show2 = true">
-						<text>筛选</text>
+					<view class="itme u-flex u-col-center u-row-center" @tap="changesort()">
+						<text>排序</text>
 						<view class="image">
-							<image style="right: 0;" src="../../static/images/search1-3.png" mode=""></image>
+							<image style="left: -234rpx;" src="../../static/images/search1-3.png" mode=""></image>
 						</view>
 					</view>
-					<view class="shaixuan" @tap="show2 = false" v-if="show2">
-						<view class="shaixuan-body u-flex-col u-col-bottom" @tap.stop>
-							<view class="jiantou"></view>
-							<view class="body u-flex-col">
-								<view class="shaixuan-title">
-									配送方式
-								</view>
-								<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
-									<text v-for="(item,index) in 3" :key="index">自取</text>
-								</view>
-								<view class="shaixuan-title">
-									配送方式
-								</view>
-								<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
-									<text v-for="(item,index) in 3" :key="index">自取</text>
-								</view>
-								<view class="shaixuan-over" @tap="show2 = false">
-									确定
+					<view class="itme">
+						<view class="u-flex u-col-center u-row-center" @tap="show2 = true">
+							<text>筛选</text>
+							<view class="image">
+								<image style="right: 0;" src="../../static/images/search1-3.png" mode=""></image>
+							</view>
+						</view>
+						<view class="shaixuan" @tap="show2 = false" v-if="show2">
+							<view class="shaixuan-body u-flex-col u-col-bottom" @tap.stop>
+								<view class="jiantou"></view>
+								<view class="body u-flex-col">
+									<view class="shaixuan-title">
+										配送方式
+									</view>
+									<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
+										<text :class="peisong.includes(1) ? 'text' : ''" @click="changepeisong(1)">到家</text>
+										<text :class="peisong.includes(2) ? 'text' : ''" @click="changepeisong(2)">到店</text>
+										<text :class="peisong.includes(3) ? 'text' : ''" @click="changepeisong(3)">送货上门</text>
+									</view>
+									<view class="shaixuan-title">
+										商品分类
+									</view>
+									<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
+										<text :class="fenleiid == -1 ? 'text' : ''" :key="index" @click="changetext(-1)">全部</text>
+										<text v-for="(item,index) in fenleilist" :class="fenleiid == index ? 'text' : ''" :key="index" @click="changetext(index)">{{item.title}}</text>
+									</view>
+									<view class="shaixuan-over" @tap="tosearch">
+										确定
+									</view>
 								</view>
 							</view>
 						</view>
 					</view>
 				</view>
 			</view>
-			<view class="goods-item" v-for="(item,index) in 2" :key="index" @tap="toinfo">
-				<image src="" mode=""></image>
+			<view class="lishi-box" v-else>
+				<view class="top u-flex u-col-center u-row-between">
+					<text>搜索历史记录</text>
+					<image src="../../static/images/search1-1.png" mode=""></image>
+				</view>
+				<view class="down u-flex u-col-center u-flex-wrap">
+					<text v-for="(item,index) in lishilist" :key="index" @tap="searchkey(item)">{{item}}</text>
+				</view>
+			</view>
+		</view>
+		<view class="goods-box">
+			<view class="goods-item" v-for="(item,index) in goodslist" :key="index" @tap="toinfo(item)">
+				<image :src="item.master_image" mode=""></image>
 				<view class="goods-body">
 					<view class="name">
-						这里是商品标题(这里 是商品标题)
+						{{item.title}}
 					</view>
 					<view class="content">
-						这里商品介绍
+						{{item.desc}}
 					</view>
 					<view class="goods-down u-flex u-col-center">
-						<text>¥10.00</text>
-						<text>门市价¥99.00</text>
-						<text>销量:0</text>
+						<text>¥{{item.show_sale_price}}</text>
+						<text>门市价¥{{item.show_original_price}}</text>
+						<text>销量:{{item.show_sales_number}}</text>
 					</view>
 				</view>
 			</view>
@@ -100,18 +107,135 @@
 	export default {
 		data() {
 			return {
-				show1: false,
-				show2: false
+				show1: false,//显示排序
+				show2: false,//显示筛选
+				goodslist: [],//商品列表
+				lishilist: [],//历史搜索记录
+				fenleilist: [],//筛选分类列表
+				keyword: '',//关键词
+				page: 1,//页数
+				count: 0,//商品总数量
+				fenleiid:-1,//商品分类的下标,-1全部
+				peisong:[1,2,3],//配送方式
+				showgoods:false,//默认显示历史搜索,第一次搜索之后变为true,不再显示历史记录
+				paixu:'综合',//排序的文字,距离:distance 销量:show_sales_number 售价:sale_price 综合:complex
+				paixuid:'complex',//排序的数据
+				sort:'desc',//大到小:desc 小到大:asc 
+				latitude:'',
+				longitude:''
 			}
 		},
 		onLoad() {
-
+			this.gettype()
+			if(uni.getStorageSync("lishi")){
+				this.lishilist = uni.getStorageSync("lishi")
+			}
+		},
+		onReachBottom() {
+			if(this.goodslist.length != this.count){
+				this.page++
+				this.getgoods()
+			}
 		},
-		methods: {
-			toinfo(){
-				uni.navigateTo({
-					url:"./goods-info"
-				})
+		methods: {
+			searchkey(key){
+				this.keyword = key
+				this.tosearch()
+			},
+			changesort(){
+				this.sort = this.sort == 'desc' ? 'asc' : 'desc'
+				this.tosearch()
+			},
+			changepaixu(id,name){
+				if(id == 'distance'){
+					uni.getLocation({
+						type:'gcj02',
+						success: (address) => {
+							this.latitude = address.latitude
+							this.longitude = address.longitude
+							this.paixuid = id
+							this.paixu = name
+							this.show1 = false
+							this.tosearch()
+						},
+						fail: () => {
+							uni.showModal({
+								content:"距离筛选需要获取您的位置",
+								success: (res) => {
+									if(res.confirm){
+										uni.openSetting()
+									}
+								}
+							})
+						}
+					})
+				}else{
+					this.paixuid = id
+					this.paixu = name
+					this.show1 = false
+					this.tosearch()
+				}
+				
+			},
+			changepeisong(num){
+				var index = this.peisong.indexOf(num)
+				if(index > -1){
+					this.peisong.splice(index,1)
+				}else{
+					this.peisong.push(num)
+				}
+			},
+			changetext(index){
+				this.fenleiid = index
+			},
+			gettype() {
+				this.$u.post('/Business/allClassify').then(res => {
+					this.fenleilist = []
+					var arr = res.response.data[0].child || []
+					arr.forEach(val => {
+						val.check = false
+						this.fenleilist.push(val)
+					})
+				})
+			},
+			tosearch() {
+				this.showgoods = true
+				this.show2 = false
+				this.page = 1
+				if(this.keyword){
+					if(this.lishilist.indexOf(this.keyword) == -1){
+						this.lishilist.push(this.keyword)
+						uni.setStorageSync("lishi",this.lishilist)
+					}
+				}
+				this.getgoods()
+			},
+			getgoods() {
+				this.$u.post('/Business/businessProductList', {
+					content: {
+						classify_id: this.fenleiid == -1 ? '' : this.fenleilist[this.fenleiid].id,
+						keyword: this.keyword,
+						lat: this.latitude,
+						limit: 10,
+						list_type: 'page',
+						lng: this.longitude,
+						page: this.page,
+						pickup_method: this.peisong.join(","),
+						sort: this.paixuid + "," + this.sort,
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if (this.page == 1) {
+						this.goodslist = res.response.data
+					} else {
+						this.goodslist = this.goodslist.concat(res.response.data)
+					}
+				})
+			},
+			toinfo(item) {
+				uni.navigateTo({
+					url: "./goods-info?id=" + item.id
+				})
 			}
 		}
 	}
@@ -140,22 +264,24 @@
 
 					.goods-down {
 						text:first-child {
-							font-size:42rpx;
+							font-size: 42rpx;
 							font-family: SourceHanSansCN;
 							font-weight: 400;
 							color: #E8380D;
-						}
-						text:nth-child(2){
-							font-size: 19rpx;
-							font-family: SourceHanSansCN;
-							font-weight: 400;
-							color: #FFFFFF;
-							margin: 0 35rpx 0 31rpx;
-						}
-						text:last-child{
-							font-size: 22rpx;
-							font-family: SourceHanSansCN;
-							font-weight: 400;
+						}
+
+						text:nth-child(2) {
+							font-size: 19rpx;
+							font-family: SourceHanSansCN;
+							font-weight: 400;
+							color: #000;
+							margin: 0 35rpx 0 31rpx;
+						}
+
+						text:last-child {
+							font-size: 22rpx;
+							font-family: SourceHanSansCN;
+							font-weight: 400;
 						}
 					}
 
@@ -163,7 +289,7 @@
 						font-size: 22rpx;
 						font-family: SimHei;
 						font-weight: 400;
-						color: #FFFFFF;
+						color: #000;
 					}
 
 					.name {
@@ -211,7 +337,7 @@
 
 							.body {
 								background-color: #fff;
-								width: 470rpx;
+								width: 500rpx;
 								// height: 389rpx;
 								box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(170, 170, 170, 0.75);
 								border-radius: 10rpx;

+ 331 - 189
pages/shop/shop-order.vue

@@ -1,17 +1,16 @@
 <template>
-	<view class="shop-order">
-		<u-navbar :background="{background:'#2AA47F'}" title="店铺订单" :borderBottom="false"
-			title-color="#fff" back-icon-color="#fff">
-			<view class="left-box u-flex u-col-center" slot="left">
-				<image src="../../static/images/index1-3.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
-			</view>
+	<view class="shop-order">
+		<u-navbar :background="{background:'#2AA47F'}" title="店铺订单" :borderBottom="false" title-color="#fff" back-icon-color="#fff">
+			<view class="left-box u-flex u-col-center" slot="left">
+				<image src="../../static/images/index1-3.png" style="width: 44rpx;height: 44rpx;" mode=""></image>
+			</view>
 		</u-navbar>
 		<view class="header u-flex u-col-center u-row-between">
 			<view class="left u-flex u-col-center">
 				<image src="../../static/images/search1-2.png" mode=""></image>
-				<input type="text" placeholder="请输入搜索关键词" />
+				<input type="text" placeholder="请输入搜索关键词" v-model="keyword"/>
 			</view>
-			<view class="right">
+			<view class="right" @click="tosearch">
 				搜索
 			</view>
 		</view>
@@ -19,7 +18,7 @@
 			<view class="shaixuan-box u-flex u-col-center u-row-between">
 				<view class="itme">
 					<view class="u-flex u-col-center u-row-center" @tap="show1 = true">
-						<text>综合</text>
+						<text>{{shaixuanleft == 'payment_time' ? '下单时间' : '完成时间'}}</text>
 						<view class="image">
 							<image src="../../static/images/search1-3.png" mode=""></image>
 						</view>
@@ -28,15 +27,13 @@
 						<view class="xiala-body u-flex-col u-col-center" @tap.stop>
 							<view class="jiantou"></view>
 							<view class="body u-flex-col u-col-center">
-								<text>综合</text>
-								<text>距离</text>
-								<text>售价</text>
-								<text>销量</text>
+								<text @click="changeleft('payment_time')">下单时间</text>
+								<text @click="changeleft('complete_time')">完成时间</text>
 							</view>
 						</view>
 					</view>
 				</view>
-				<view class="itme u-flex u-col-center u-row-center">
+				<view class="itme u-flex u-col-center u-row-center" @click="changecenter"> 
 					<text>排序</text>
 					<view class="image">
 						<image style="left: -234rpx;" src="../../static/images/search1-3.png" mode=""></image>
@@ -54,18 +51,32 @@
 							<view class="jiantou"></view>
 							<view class="body u-flex-col">
 								<view class="shaixuan-title">
-									配送方式
+									订单付款时间
 								</view>
 								<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
-									<text v-for="(item,index) in 3" :key="index">自取</text>
+									<text class="text2" @click="opentime(1)">{{starttime1 || '起始日期'}}</text>
+									<text style="margin: 0 10rpx;">~</text>
+									<text class="text2" @click="opentime(2)">{{endtime1 || '结束日期'}}</text>
+								</view>
+								<view class="shaixuan-title">
+									订单完成时间
+								</view>
+								<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
+									<text class="text2" @click="opentime(3)">{{starttime2 || '起始日期'}}</text>
+									<text style="margin: 0 10rpx;">~</text>
+									<text class="text2" @click="opentime(4)">{{endtime2 || '结束日期'}}</text>
 								</view>
 								<view class="shaixuan-title">
-									配送方式
+									订单状态
 								</view>
 								<view class="shaixuan-text u-flex u-col-center u-flex-wrap">
-									<text v-for="(item,index) in 3" :key="index">自取</text>
+									<text :class="order_status == '' ? 'text text1' : 'text'" @click="order_status = ''">全部</text>
+									<text :class="order_status == '0' ? 'text text1' : 'text'" @click="order_status = '0'">未发货</text>
+									<text :class="order_status == '1' ? 'text text1' : 'text'" @click="order_status = '1'">已发货/待核销</text>
+									<text :class="order_status == '3' ? 'text text1' : 'text'" @click="order_status = '3'">待评论/已核销</text>
+									<text :class="order_status == '4' ? 'text text1' : 'text'" @click="order_status = '4'">已完成</text>
 								</view>
-								<view class="shaixuan-over" @tap="show2 = false">
+								<view class="shaixuan-over" @tap="tosearch()">
 									确定
 								</view>
 							</view>
@@ -73,71 +84,81 @@
 					</view>
 				</view>
 			</view>
-			<view class="goods-item" v-for="(item,index) in 2" :key="index" @tap="toinfo">
-				<view class="header-box u-flex u-col-center u-row-between">
-					<text>sc123123123123123</text>
-					<text>待用户评价</text>
-				</view>
-				<view class="order-goods">
-					<view class="order-goods-box u-flex u-col-center">
-						<image src="../../static/images/648.png" class="goods-img" mode=""></image>
-						<view class="goods-right">
-							<view class="goods-name">
-								这是名字这是名字这是名字
-							</view>
-							<view class="goods-jieshao">
-								这是名字这是名字这是名字
-							</view>
-							<view class="goods-price">
-								<text>¥50.0</text>
-								<text>门市价:¥100</text>
-							</view>
-						</view>
-					</view>
-					<view class="taocan-box">
-						套餐1:鸡翅+鸡翅
+			<view class="goods-item" v-for="(item,index) in list" :key="index" @tap="toinfo(item)">
+				<view class="header-box u-flex u-col-center u-row-between">
+					<text>{{item.order_no}}</text>
+					<view v-if="item.order_status == 0">
+						<text class="text2" v-if="item.is_payment == 0">待支付</text>
+						<text class="text2" v-if="item.is_payment == 1">待接单</text>
 					</view>
-				</view>
-				<view class="taocan-count u-flex u-col-center">
-					<text>套餐1</text>
-					<text>x1</text>
-					<text>¥50</text>
-				</view>
-				<view class="price-box u-flex u-col-center u-row-right">
-					<text>商品原价:¥100</text>
-					<text>优惠:¥100</text>
-					<text>配送费:¥100</text>
-				</view>
+					<text class="text2" v-if="item.order_status == 1">已接单</text>
+					<text class="text2" v-if="item.order_status == 2">进行中</text>
+					<text class="text2" v-if="item.order_status == 3">待用户评价</text>
+					<text class="text2" v-if="item.order_status == 4">已完成</text>
+					<text class="text2" v-if="item.order_status == -1">已取消</text>
+					<text class="text2" v-if="item.order_status == -2">已过期</text>
+				</view>
+				<view class="order-goods">
+					<view class="order-goods-box u-flex u-col-center">
+						<image src="../../static/images/shop-order.png" class="goods-img" mode=""></image>
+						<view class="goods-right">
+							<view class="goods-name">
+								{{item.detail.business_product_redundancy.title}}
+							</view>
+							<view class="goods-jieshao">
+								{{item.detail.business_product_redundancy.desc}}
+							</view>
+							<view class="goods-price">
+								<text>¥{{item.detail.business_product_specifications_redundancy.sale_price}}</text>
+								<text>门市价:¥{{item.detail.business_product_specifications_redundancy.original_price}}</text>
+							</view>
+						</view>
+					</view>
+					<view class="taocan-box">
+						{{item.detail.business_product_specifications_redundancy.title}}:{{item.detail.business_product_specifications_redundancy.desc}}
+					</view>
+				</view>
+				<view class="taocan-count u-flex u-col-center">
+					<text>{{item.detail.business_product_specifications_redundancy.title}}</text>
+					<text>x{{item.detail.number}}</text>
+					<text>¥{{item.detail.payment_price}}</text>
+				</view>
+				<view class="price-box u-flex u-col-center u-row-right">
+					<text>商品原价:¥{{item.detail.original_sale_price}}</text>
+					<text>优惠:¥{{item.detail.discount_amount}}</text>
+					<text>配送费:¥{{item.detail.express_delivery_price}}</text>
+				</view>
 				<view class="shuoming-title">
-					快递费用说明:123
+					快递费用说明:{{item.detail.express_delivery_price_text}}
 				</view>
 				<view class="shuoming-title">
-					优惠金额说明:23
+					优惠金额说明:{{item.detail.discount_amount_text}}
 				</view>
 				<view class="peisong-type">
-					配送方式:到家
+					配送方式:{{item.detail.pickup_method == 1 ? '到家' : item.detail.pickup_method == 2 ? '到店' : '送货上门'}}
 				</view>
 				<view class="pay-xuzhi">
-					购买须知:购买该商品需要在2020-02-02前使用
-				</view>
-				<view class="pay-title u-flex u-col-center">
-					<u-icon name="bag-fill" color="#429EFE" size="40"></u-icon>
-					<text class="text">购买商品</text>
-				</view>
-				<view class="order-text">
-					下单时间:2022-02-02 11:11:11
-				</view>
-				<view class="order-text">
-					付款时间:2022-02-02 11:11:11
+					{{item.detail.business_product_redundancy.purchase_note}}
+				</view>
+				<view class="pay-title u-flex u-col-center">
+					<!-- <u-icon name="bag-fill" color="#429EFE" size="40"></u-icon> -->
+					<text class="text">购买商品</text>
+				</view>
+				<view class="order-text" v-if="item.detail.create_time" style="font-size: 24rpx;">
+					下单时间:{{item.detail.create_time}}
 				</view>
-				<view class="order-text">
-					核销时间:2022-02-02 11:11:11
+				<view class="order-text" v-if="item.detail.payment_time" style="font-size: 24rpx;">
+					付款时间:{{item.detail.payment_time}}
 				</view>
-				<view class="u-flex u-row-right">
-					<x-button :width="205" :height="71" borderRadius="20rpx" fontSize="25rpx" color="#000">服务进度</x-button>
+				<view class="order-text" v-if="item.detail.write_off_time" style="font-size: 24rpx;">
+					核销时间:{{item.detail.write_off_time}}
+				</view>
+				<view class="u-flex u-row-right" @click.stop>
+					<x-button :width="205" :height="71" borderRadius="20rpx" fontSize="25rpx" color="#000" @click="tojinbi(item)">服务进度</x-button>
 				</view>
 			</view>
-		</view>
+		</view>
+		<u-calendar v-model="showtime" mode="date" @clicktime="changetime"  @change="cleartime" active-bg-color="#2AA47F" btn-type="default"></u-calendar>
 	</view>
 </template>
 
@@ -146,31 +167,123 @@
 		data() {
 			return {
 				show1: false,
-				show2: false
+				show2: false,
+				id: '',
+				page: 1,
+				list: [],
+				count: 0,
+				keyword:'',
+				shaixuanleft:'payment_time',
+				shaixuancenter:'desc',
+				starttime1:'',
+				endtime1:'',
+				starttime2:'',
+				endtime2:'',
+				order_status:'',
+				timetype:1,
+				showtime:false
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			this.id = option.id
+		},
+		onShow() {
+			this.getlist()
+		},
+		onReachBottom() {
+			if (this.count != this.list.length) {
+				this.page++
+				this.getlist()
+			}
 		},
-		methods: {
-			toinfo(){
+		methods: {
+			tojinbi(item){
 				uni.navigateTo({
-					url:"./shop-orderinfo"
+					url:"../order/jindu?type=2&id=" + item.order_no
 				})
+			},
+			cleartime(){
+				if(this.timetype == 1){
+					this.starttime1 = ''
+				}else if(this.timetype == 2){
+					this.endtime1 = ''
+				}else if(this.timetype == 3){
+					this.starttime2 = ''
+				}else if(this.timetype == 4){
+					this.endtime2 = ''
+				}
+			},
+			changetime(e){
+				this.showtime = false
+				if(this.timetype == 1){
+					this.starttime1 = e
+				}else if(this.timetype == 2){
+					this.endtime1 = e
+				}else if(this.timetype == 3){
+					this.starttime2 = e
+				}else if(this.timetype == 4){
+					this.endtime2 = e
+				}
+			},
+			opentime(type){
+				this.timetype = type
+				this.showtime = true
+			},
+			changecenter(){
+				this.shaixuancenter = this.shaixuancenter == 'desc' ? 'asc' : 'desc'
+				this.tosearch()
+			},
+			changeleft(str){
+				this.shaixuanleft = str
+				this.tosearch()
+			},
+			tosearch(){
+				this.show1 = false
+				this.show2 = false
+				this.page = 1
+				this.getlist()
+			},
+			getlist() {
+				this.$u.post('/BusinessAdmin/orderList', {
+					content: {
+						business_id: this.id,
+						complete_time:this.starttime2 + "," + this.endtime2,
+						keyword:this.keyword,
+						limit: 10,
+						list_type: 'page',
+						order_status:this.order_status,
+						page: this.page,
+						payment_time:this.starttime1 + "," + this.endtime1,
+						sort:this.shaixuanleft + "," + this.shaixuancenter
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if(this.page == 1){
+						this.list = res.response.data
+					}else{
+						this.list = this.list.concat(res.response.data)
+					}
+				})
+			},
+			toinfo(item) {
+				uni.navigateTo({
+					url: "./shop-orderinfo?id=" + item.order_no
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	.shop-order {
-		.left-box {
-			padding: 0 25rpx;
-		
-			image {
-				margin-right: 25rpx;
-			}
+	.shop-order {
+		.left-box {
+			padding: 0 25rpx;
+
+			image {
+				margin-right: 25rpx;
+			}
 		}
+
 		.goods-box {
 			.goods-item {
 				width: 705rpx;
@@ -179,103 +292,124 @@
 				padding: 20rpx;
 				background-color: #fff;
 				border-radius: 10rpx;
-				position: relative;
-				.order-text{
-					font-size: 24rpx;
-					color: #A5A2A5;
-				}
-				.pay-title{
-					.text{
-						color: #2EBD9B;
-						font-size: 34rpx;
-					}
-				}
-				.pay-xuzhi{
-					padding: 10rpx 0 10rpx 0;
-					color: rgba(0,0,0,0.4);
-					border-bottom: 1rpx solid rgba(0,0,0,0.3);
-					margin-bottom: 20rpx;
-				}
-				.peisong-type{
-					color: rgba(0,0,0,0.5);
-					text-align: right;
-					font-size: 26rpx;
-					margin-top: 6rpx;
-				}
-				.shuoming-title{
-					text-align: right;
-					font-size: 22rpx;
-					color: rgba(0,0,0,0.3);
-					margin-top: 6rpx;
-				}
-				.price-box{
-					font-size: 26rpx;
-					color: rgba(0,0,0,0.5);
-					text{
-						margin-right: 6rpx;
-					}
-					text:first-child{
-						text-decoration: line-through;
-					}
-				}
-				.taocan-count{
-					margin-bottom: 4rpx;
-					padding: 20rpx 10rpx 4rpx 10rpx;
-					text:first-child{
-						font-size: 33rpx;
-					}
-					text:nth-child(2){
-						flex: 1;
-						margin: 0 10rpx;
-						font-size: 24rpx;
-						text-align: right;
-					}
-					text:last-child{
-						color: #F4A865;
-					}
-				}
-				.order-goods{
-					border-top: 1rpx solid #C0C0C0;
-					border-bottom: 1rpx solid #C0C0C0;
-					padding: 20rpx;
-					.taocan-box{
-						padding-top: 10rpx;
-						// border-bottom: 1rpx solid #C0C0C0;
-					}
-					
-					.order-goods-box{
-						.goods-img{
-							width: 155rpx;
-							height: 155rpx;
-							border-radius: 10rpx;
-							margin-right: 20rpx;
-						}
-						.goods-right{
-							flex: 1;
-							.goods-name{
-								font-size: 30rpx;
-								margin-bottom: 10rpx;
-							}
-							.goods-jieshao{
-								color: rgba(0,0,0,0.4);
-								margin-bottom: 10rpx;
-								font-size: 28rpx;
-							}
-							.goods-price{
-								color: rgba(0,0,0,0.3);
-								font-size: 22rpx;
-								text:last-child{
-									text-decoration: line-through;
-								}
-							}
-						}
-					}
-				}
-				.header-box{
-					margin-bottom: 20rpx;
-					text:last-child{
-						color: #CF8851;
-					}
+				position: relative;
+
+				.order-text {
+					font-size: 24rpx;
+					color: #A5A2A5;
+				}
+
+				.pay-title {
+					.text {
+						color: #2EBD9B;
+						font-size: 34rpx;
+					}
+				}
+
+				.pay-xuzhi {
+					padding: 10rpx 0 10rpx 0;
+					color: rgba(0, 0, 0, 0.4);
+					border-bottom: 1rpx solid rgba(0, 0, 0, 0.3);
+					margin-bottom: 20rpx;
+				}
+
+				.peisong-type {
+					color: rgba(0, 0, 0, 0.5);
+					text-align: right;
+					font-size: 26rpx;
+					margin-top: 6rpx;
+				}
+
+				.shuoming-title {
+					text-align: right;
+					font-size: 22rpx;
+					color: rgba(0, 0, 0, 0.3);
+					margin-top: 6rpx;
+				}
+
+				.price-box {
+					font-size: 26rpx;
+					color: rgba(0, 0, 0, 0.5);
+
+					text {
+						margin-right: 6rpx;
+					}
+
+					text:first-child {
+						text-decoration: line-through;
+					}
+				}
+
+				.taocan-count {
+					margin-bottom: 4rpx;
+					padding: 20rpx 10rpx 4rpx 10rpx;
+
+					text:first-child {
+						font-size: 33rpx;
+					}
+
+					text:nth-child(2) {
+						flex: 1;
+						margin: 0 10rpx;
+						font-size: 24rpx;
+						text-align: right;
+					}
+
+					text:last-child {
+						color: #F4A865;
+					}
+				}
+
+				.order-goods {
+					border-top: 1rpx solid #C0C0C0;
+					border-bottom: 1rpx solid #C0C0C0;
+					padding: 20rpx;
+
+					.taocan-box {
+						padding-top: 10rpx;
+						// border-bottom: 1rpx solid #C0C0C0;
+					}
+
+					.order-goods-box {
+						.goods-img {
+							width: 155rpx;
+							height: 155rpx;
+							border-radius: 10rpx;
+							margin-right: 20rpx;
+						}
+
+						.goods-right {
+							flex: 1;
+
+							.goods-name {
+								font-size: 30rpx;
+								margin-bottom: 10rpx;
+							}
+
+							.goods-jieshao {
+								color: rgba(0, 0, 0, 0.4);
+								margin-bottom: 10rpx;
+								font-size: 28rpx;
+							}
+
+							.goods-price {
+								color: rgba(0, 0, 0, 0.3);
+								font-size: 22rpx;
+
+								text:last-child {
+									text-decoration: line-through;
+								}
+							}
+						}
+					}
+				}
+
+				.header-box {
+					margin-bottom: 20rpx;
+
+					text:last-child {
+						color: #CF8851;
+					}
 				}
 			}
 
@@ -295,7 +429,7 @@
 
 						.shaixuan-body {
 							position: fixed;
-							top: 160rpx;
+							top: 290rpx;
 							right: 22rpx;
 
 							.jiantou {
@@ -310,7 +444,7 @@
 
 							.body {
 								background-color: #fff;
-								width: 470rpx;
+								width: 500rpx;
 								// height: 389rpx;
 								box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(170, 170, 170, 0.75);
 								border-radius: 10rpx;
@@ -322,8 +456,16 @@
 									font-size: 24rpx;
 								}
 
-								.shaixuan-text {
-									text {
+								.shaixuan-text {
+									.text2{
+										font-size: 26rpx;
+										width: 150rpx;
+										border-radius: 100rpx;
+										line-height:50rpx;
+										background-color: rgba(0,0,0,0.1);
+										text-align: center;
+									}
+									.text {
 										padding: 10rpx 20rpx;
 										border-radius: 10rpx;
 										color: #27AA76;
@@ -334,7 +476,7 @@
 										border: 2rpx solid #27AA76;
 									}
 
-									.text {
+									.text1 {
 										color: #fff;
 										background-color: #27AA76;
 									}
@@ -365,7 +507,7 @@
 
 						.xiala-body {
 							position: fixed;
-							top: 160rpx;
+							top: 290rpx;
 							left: 22rpx;
 
 							.jiantou {
@@ -380,7 +522,7 @@
 							.body {
 								background-color: #fff;
 								width: 235rpx;
-								height: 338rpx;
+								// height: 338rpx;
 								box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(170, 170, 170, 0.75);
 								border-radius: 10rpx;
 

+ 318 - 196
pages/shop/shop-orderinfo.vue

@@ -1,197 +1,319 @@
-<template>
-	<view class="shop-orderinfo">
-		<view class="header-box u-flex u-col-center u-row-between">
-			<text>sc213123123123</text>
-			<text>待用户评价</text>
-		</view>
-		<view class="address-box">
-			<view class="title">
-				收货地址
-			</view>
-			<view class="address-user">
-				啦啦啦 18888888888
-			</view>
-			<view class="address-text">
-				阿斯利康将阿奎罗加大科技大奖看见阿斯科利金德拉克
-			</view>
-		</view>
-		<view class="order-goods">
-			<view class="order-goods-box u-flex u-col-center">
-				<image src="../../static/images/648.png" class="goods-img" mode=""></image>
-				<view class="goods-right">
-					<view class="goods-name">
-						这是名字这是名字这是名字
-					</view>
-					<view class="goods-jieshao">
-						这是名字这是名字这是名字
-					</view>
-					<view class="goods-price">
-						<text>¥50.0</text>
-						<text>门市价:¥100</text>
-					</view>
-				</view>
-			</view>
-			<view class="taocan-box">
-				套餐1:鸡翅+鸡翅
-			</view>
-		</view>
-		<view class="taocan-count u-flex u-col-center">
-			<text>套餐1</text>
-			<text>x1</text>
-			<text>¥50</text>
-		</view>
-		<view class="price-box u-flex u-col-center u-row-right">
-			<text>商品原价:¥100</text>
-			<text>优惠:¥100</text>
-			<text>配送费:¥100</text>
-		</view>
-		<view class="shuoming-title">
-			快递费用说明:123
-		</view>
-		<view class="shuoming-title">
-			优惠金额说明:23
-		</view>
-		<view class="peisong-type">
-			配送方式:到家
-		</view>
-		<view class="pay-xuzhi">
-			购买须知:购买该商品需要在2020-02-02前使用
-		</view>
-		<view class="isfapiao">
-			是否需要发票:否
-		</view>
-		<view class="u-flex u-col-center u-row-right">
-			<x-button :width="205" :height="71" color="#000" fontSize="25rpx" borderRadius="20rpx">服务进度</x-button>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data(){
-			return{
-				
-			}
-		},
-		onLoad() {
-			
-		},
-		methods:{
-			
-		}
-	}
-</script>
-
-<style lang="scss">
-	.shop-orderinfo{
-		min-height: 100vh;
-		padding: 1rpx 30rpx;
-		background-color: #fff;
-		.isfapiao{
-			padding: 10rpx 0 10rpx 0;
-			color: rgba(0,0,0,0.4);
-		}
-		.pay-xuzhi{
-			padding: 10rpx 0 10rpx 0;
-			color: rgba(0,0,0,0.4);
-			border-bottom: rgba(0,0,0,0.1) 1rpx solid;
-			margin-bottom: 20rpx;
-		}
-		.peisong-type{
-			color: rgba(0,0,0,0.5);
-			text-align: right;
-			font-size: 26rpx;
-			margin-top: 6rpx;
-		}
-		.shuoming-title{
-			text-align: right;
-			font-size: 22rpx;
-			color: rgba(0,0,0,0.3);
-			margin-top: 6rpx;
-		}
-		.price-box{
-			font-size: 26rpx;
-			color: rgba(0,0,0,0.5);
-			text{
-				margin-right: 6rpx;
-			}
-			text:first-child{
-				text-decoration: line-through;
-			}
-		}
-		.taocan-count{
-			margin-bottom: 4rpx;
-			padding: 20rpx 10rpx 4rpx 10rpx;
-			text:first-child{
-				font-size: 33rpx;
-			}
-			text:nth-child(2){
-				flex: 1;
-				margin: 0 10rpx;
-				font-size: 24rpx;
-				text-align: right;
-			}
-			text:last-child{
-				color: #F4A865;
-			}
-		}
-		.order-goods{
-			padding: 20rpx;
-			border-bottom: rgba(0,0,0,0.1) 1rpx solid;
-			.taocan-box{
-				padding-top: 10rpx;
-				// border-bottom: 1rpx solid #C0C0C0;
-			}
-			
-			.order-goods-box{
-				.goods-img{
-					width: 155rpx;
-					height: 155rpx;
-					border-radius: 10rpx;
-					margin-right: 20rpx;
-				}
-				.goods-right{
-					flex: 1;
-					.goods-name{
-						font-size: 30rpx;
-						margin-bottom: 10rpx;
-					}
-					.goods-jieshao{
-						color: rgba(0,0,0,0.4);
-						margin-bottom: 10rpx;
-						font-size: 28rpx;
-					}
-					.goods-price{
-						color: rgba(0,0,0,0.3);
-						font-size: 22rpx;
-						text:last-child{
-							text-decoration: line-through;
-						}
-					}
-				}
-			}
-		}
-		.address-box{
-			padding: 30rpx 0;
-			border-bottom: rgba(0,0,0,0.1) 1rpx solid;
-			.address-text{
-				color: #8C8C8C;
-			}
-			.address-user{
-				color: #797979;
-				font-size: 32rpx;
-				margin: 10rpx 0;
-			}
-			.title{
-				color: #D47D3B;
-			}
-		}
-		.header-box{
-			padding: 20rpx 0;
-			border-bottom: rgba(0,0,0,0.1) 1rpx solid;
-			text:last-child{
-				color: #D47D3B;
-			}
-		}
-	}
+<template>
+	<view class="shop-orderinfo" v-if="orderdata.order_no">
+		<view class="header-box u-flex u-col-center u-row-between">
+			<text>{{orderdata.order_no}}</text>
+			<view v-if="orderdata.order_status == 0">
+				<text class="text2" v-if="orderdata.is_payment == 0">待支付</text>
+				<text class="text2" v-if="orderdata.is_payment == 1">待接单</text>
+			</view>
+			<text class="text2" v-if="orderdata.order_status == 1">已接单</text>
+			<text class="text2" v-if="orderdata.order_status == 2">进行中</text>
+			<text class="text2" v-if="orderdata.order_status == 3">待用户评价</text>
+			<text class="text2" v-if="orderdata.order_status == 4">已完成</text>
+			<text class="text2" v-if="orderdata.order_status == -1">已取消</text>
+			<text class="text2" v-if="orderdata.order_status == -2">已过期</text>
+		</view>
+		<view class="address-box">
+			<view class="title">
+				收货地址
+			</view>
+			<view class="address-user">
+				{{orderdata.detail.name}} {{orderdata.detail.phone}}
+			</view>
+			<view class="address-text">
+				{{orderdata.detail.province}}{{orderdata.detail.city}}{{orderdata.detail.area}}{{orderdata.detail.location_address}}{{orderdata.detail.address}}
+			</view>
+		</view>
+		<view class="order-goods">
+			<view class="order-goods-box u-flex u-col-center">
+				<image src="../../static/images/shop-order.png" class="goods-img" mode=""></image>
+				<view class="goods-right">
+					<view class="goods-name">
+						{{orderdata.detail.business_product_redundancy.title}}
+					</view>
+					<view class="goods-jieshao">
+						{{orderdata.detail.business_product_redundancy.desc}}
+					</view>
+					<view class="goods-price">
+						<text>¥{{orderdata.detail.business_product_specifications_redundancy.sale_price}}</text>
+						<text>门市价:¥{{orderdata.detail.business_product_specifications_redundancy.original_price}}</text>
+					</view>
+				</view>
+			</view>
+			<view class="taocan-box">
+				{{orderdata.detail.business_product_specifications_redundancy.title}}:{{orderdata.detail.business_product_specifications_redundancy.desc}}
+			</view>
+		</view>
+		<view class="taocan-count u-flex u-col-center">
+			<text>{{orderdata.detail.business_product_specifications_redundancy.title}}</text>
+			<text>x{{orderdata.detail.number}}</text>
+			<text>¥{{orderdata.detail.payment_price}}</text>
+		</view>
+		<view class="price-box u-flex u-col-center u-row-right">
+			<text>商品原价:¥{{orderdata.detail.original_sale_price}}</text>
+			<text>优惠:¥{{orderdata.detail.discount_amount}}</text>
+			<text>配送费:¥{{orderdata.detail.express_delivery_price}}</text>
+		</view>
+		<view class="shuoming-title">
+			快递费用说明:{{orderdata.detail.express_delivery_price_text}}
+		</view>
+		<view class="shuoming-title">
+			优惠金额说明:{{orderdata.detail.discount_amount_text}}
+		</view>
+		<view class="peisong-type">
+			配送方式:{{orderdata.detail.pickup_method == 1 ? '到家' : orderdata.detail.pickup_method == 2 ? '到店' : '送货上门'}}
+		</view>
+		<view class="pay-xuzhi">
+			购买须知:{{orderdata.detail.business_product_redundancy.purchase_note}}
+		</view>
+		<view class="isfapiao u-flex-col">
+			<text>是否需要发票:{{orderdata.is_invoice == 1 ? '是' : '否'}}</text>
+			<text v-if="orderdata.is_invoice == 1">发票抬头:{{orderdata.invoice_title}}</text>
+		</view>
+		<view class="order-down u-flex-col">
+			<text>购买商品</text>
+			<text v-if="orderdata.detail.create_time">下单时间:{{orderdata.detail.create_time}}</text>
+			<text v-if="orderdata.detail.payment_time">付款时间:{{orderdata.detail.payment_time}}</text>
+			<text v-if="orderdata.detail.write_off_time">核销时间:{{orderdata.detail.write_off_time}}</text>
+		</view>
+		<view class="u-flex u-col-center u-row-right">
+			<x-button :width="205" :height="71" color="#000" fontSize="25rpx" borderRadius="20rpx" @click="show = true" v-if="orderdata.order_status < 2">核销订单</x-button>
+			<x-button :width="205" :height="71" style="margin-left: 20rpx;" color="#000" fontSize="25rpx" borderRadius="20rpx" @click="tojindu">服务进度</x-button>
+		</view>
+		<u-modal v-model="show" title="选择核销店铺" :show-cancel-button="true" @confirm="hexiao" confirm-text="确认核销" confirm-color="#2AA47F">
+			<view class="slot-content" style="padding: 30rpx 0;">
+				<u-radio-group v-model="value" active-color="#2AA47F">
+					<view class="u-flex-col" style="padding: 0 50rpx;">
+						<u-radio v-for="(item, index) in list" :key="index" :name="item.id">
+							{{item.title}}
+						</u-radio>
+					</view>
+				</u-radio-group>
+			</view>
+		</u-modal>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id: '',
+				url: '',
+				orderdata: {},
+				show: false,
+				list:[],
+				value:''
+			}
+		},
+		onLoad(option) {
+			this.id = option.id
+			this.url = option.url
+			this.getdata()
+		},
+		methods: {
+			hexiao() {
+				this.$u.post('/BusinessAdmin/writeOff', {
+					content: {
+						business_shop_id: this.value,
+						write_off_code: this.url,
+					}
+				}).then(res => {
+					if (res.code == 0) {
+						this.$u.toast("核销成功")
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 800)
+					} else {
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			tojindu() {
+				uni.navigateTo({
+					url: "../order/jindu?type=2&id=" + this.id
+				})
+			},
+			getdata() {
+				if (this.id) {
+					this.$u.post('/BusinessAdmin/getOrder', {
+						content: {
+							order_no: this.id
+						}
+					}).then(res => {
+						this.orderdata = res.response
+						this.list = res.response.business_admin
+						if(this.list.length > 0){
+							this.value = this.list[0].id
+						}
+					})
+				} else {
+					this.$u.post('/BusinessAdmin/getOrderByWriteOffCode', {
+						content: {
+							write_off_code: this.url
+						}
+					}).then(res => {
+						if (res.code == 0) {
+							this.orderdata = res.response
+							this.list = res.response.business_admin
+							if(this.list.length > 0){
+								this.value = this.list[0].id
+							}
+						} else {
+							this.$u.toast(res.msg)
+						}
+						// this.orderdata = res.response
+					})
+				}
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.shop-orderinfo {
+		min-height: 100vh;
+		padding: 1rpx 30rpx 30rpx 30rpx;
+		background-color: #fff;
+
+		.order-down {
+			padding: 20rpx 0;
+			color: #829191;
+
+			text:first-child {
+				color: #00A47A;
+			}
+		}
+
+		.isfapiao {
+			padding: 10rpx 0 10rpx 0;
+			color: rgba(0, 0, 0, 0.4);
+		}
+
+		.pay-xuzhi {
+			padding: 10rpx 0 10rpx 0;
+			color: rgba(0, 0, 0, 0.4);
+			border-bottom: rgba(0, 0, 0, 0.1) 1rpx solid;
+			margin-bottom: 20rpx;
+		}
+
+		.peisong-type {
+			color: rgba(0, 0, 0, 0.5);
+			text-align: right;
+			font-size: 26rpx;
+			margin-top: 6rpx;
+		}
+
+		.shuoming-title {
+			text-align: right;
+			font-size: 22rpx;
+			color: rgba(0, 0, 0, 0.3);
+			margin-top: 6rpx;
+		}
+
+		.price-box {
+			font-size: 26rpx;
+			color: rgba(0, 0, 0, 0.5);
+
+			text {
+				margin-right: 6rpx;
+			}
+
+			text:first-child {
+				text-decoration: line-through;
+			}
+		}
+
+		.taocan-count {
+			margin-bottom: 4rpx;
+			padding: 20rpx 10rpx 4rpx 10rpx;
+
+			text:first-child {
+				font-size: 33rpx;
+			}
+
+			text:nth-child(2) {
+				flex: 1;
+				margin: 0 10rpx;
+				font-size: 24rpx;
+				text-align: right;
+			}
+
+			text:last-child {
+				color: #F4A865;
+			}
+		}
+
+		.order-goods {
+			padding: 20rpx;
+			border-bottom: rgba(0, 0, 0, 0.1) 1rpx solid;
+
+			.taocan-box {
+				padding-top: 10rpx;
+				// border-bottom: 1rpx solid #C0C0C0;
+			}
+
+			.order-goods-box {
+				.goods-img {
+					width: 155rpx;
+					height: 155rpx;
+					border-radius: 10rpx;
+					margin-right: 20rpx;
+				}
+
+				.goods-right {
+					flex: 1;
+
+					.goods-name {
+						font-size: 30rpx;
+						margin-bottom: 10rpx;
+					}
+
+					.goods-jieshao {
+						color: rgba(0, 0, 0, 0.4);
+						margin-bottom: 10rpx;
+						font-size: 28rpx;
+					}
+
+					.goods-price {
+						color: rgba(0, 0, 0, 0.3);
+						font-size: 22rpx;
+
+						text:last-child {
+							text-decoration: line-through;
+						}
+					}
+				}
+			}
+		}
+
+		.address-box {
+			padding: 30rpx 0;
+			border-bottom: rgba(0, 0, 0, 0.1) 1rpx solid;
+
+			.address-text {
+				color: #8C8C8C;
+			}
+
+			.address-user {
+				color: #797979;
+				font-size: 32rpx;
+				margin: 10rpx 0;
+			}
+
+			.title {
+				color: #00A47A;
+			}
+		}
+
+		.header-box {
+			padding: 20rpx 0;
+			border-bottom: rgba(0, 0, 0, 0.1) 1rpx solid;
+
+			text:last-child {
+				color: #D47D3B;
+			}
+		}
+	}
 </style>

+ 246 - 77
pages/shop/shop.vue

@@ -1,31 +1,52 @@
 <template>
-	<view class="shop">
-		<x-navbar :active="2">
-			<view class="nav-center u-flex u-col-center u-row-between" @tap="toseatch">
-				<u-icon name="search" color="rgba(0,0,0,0.8)"></u-icon>
-				<text class="text">搜索</text>
-			</view>
+	<view class="shop">
+		<x-navbar ref="nav" :active="2">
+			<view class="nav-center u-flex u-col-center u-row-between" @tap="toseatch">
+				<u-icon name="search" color="rgba(0,0,0,0.8)"></u-icon>
+				<text class="text">搜索</text>
+			</view>
 		</x-navbar>
-		<view class="title">
-			今日新上
-		</view>
-		<scroll-view scroll-x="true" class="scroll-box">
-			<view class="goods-item" v-for="(item,index) in 4" :key='index'>
-				<image src="" mode=""></image>
-				<view class="name">
-					这里是商品标题(这里是商品标题)
-				</view>
-				<view class="price">
-					¥10.00
-				</view>
+		<view style="background-color: #fff;">
+			<view class="title">
+				今日新上
 			</view>
-		</scroll-view>
-		<image src="" class="img-box" mode=""></image>
+			<scroll-view scroll-x="true" class="scroll-box">
+				<view class="goods-item" :style="{background:index % 2 == 0 ? '#FAE5DF' : '#E3F7F0'}"
+					v-for="(item,index) in newgoods" :key='index' @tap="toinfo(item.business_product)">
+					<image :src="item.advertise_image" mode=""></image>
+					<view class="name">
+						{{item.advertise_title}}
+					</view>
+					<view class="price">
+						¥10.00
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+
+		<image @click="openad" v-if="oneimage.advertise_image" :src="oneimage.advertise_image" class="img-box" mode="">
+		</image>
 		<view class="tabs-box">
 			<u-tabs :list="list" :is-scroll="false" active-color="#2AA47F" :isScroll="true" :current="current"
-				@change="change"></u-tabs>
+				@change="change" name="title"></u-tabs>
+		</view>
+		<view class="goods-item1" v-for="(item,index) in goodslist" :key="index" @tap="toinfo(item)">
+			<image :src="item.master_image" mode=""></image>
+			<view class="goods-body">
+				<view class="name">
+					{{item.title}}
+				</view>
+				<view class="content">
+					{{item.desc}}
+				</view>
+				<view class="goods-down u-flex u-col-center">
+					<text>¥{{item.show_sale_price}}</text>
+					<text>门市价¥{{item.show_original_price}}</text>
+					<text>销量:{{item.show_sales_number}}</text>
+				</view>
+			</view>
 		</view>
-		<view class="goods-list u-flex u-col-center u-row-between u-flex-wrap">
+		<!-- <view class="goods-list u-flex u-col-center u-row-between u-flex-wrap">
 			<view class="item" v-for="(item,index) in 4" :key="index" @tap="toinfo">
 				<image src="" mode=""></image>
 				<view class="name">
@@ -42,7 +63,7 @@
 					<text>加入购物车</text>
 				</view>
 			</view>
-		</view>
+		</view> -->
 	</view>
 </template>
 
@@ -50,46 +71,187 @@
 	export default {
 		data() {
 			return {
-				list: [{
-					name: '今日爆款'
-				}, {
-					name: '无需预约'
-				}, {
-					name: '离我最近'
-				}, {
-					name: '最多分享'
-				}, {
-					name: '即将下架'
-				}],
-				current: 0
+				list: [],
+				current: 0,
+				oneimage: {},
+				newgoods: [],
+				page:1,
+				count:0,
+				goodslist:[]
 			}
 		},
 		onLoad() {
-
+			this.getoneimage()
+			this.getnewgoods()
+			this.getgoodstype()
+		},
+		onReachBottom() {
+			if(this.count != this.goodslist.length){
+				this.page++
+				this.getgoods()
+			}
+		},
+		onShow() {
+			if (uni.getStorageSync("token")) {
+				this.$u.post('/UserMessage/getMessageReadFalseCount').then(res => {
+					if (res.code == 0) {
+						this.$refs.nav.count = res.response.count
+					}
+				})
+				this.getorder()
+			}else{
+				this.$refs.nav.count = 0
+				uni.removeTabBarBadge({
+					index:1,
+				})
+			}
 		},
 		methods: {
-			toinfo(){
-				uni.navigateTo({
-					url:"./goods-info",
-					fail(err) {
-						console.log(err);
-					}
+			getorder(){
+				this.$u.post('/Order/getOrderStatusCount').then(res => {
+					var num = 0
+					num = num + res.response.facilitator.pending_count
+					num = num + res.response.facilitator.received_count
+					num = num + res.response.user.comments_count
+					num = num + res.response.user.pending_count
+					num = num + res.response.user.received_count
+					uni.setTabBarBadge({
+						text:num.toFixed(0).toString(),
+						index:1,
+					})
 				})
 			},
+			getgoods() {
+				this.$u.post('/Business/advertiseList', {
+					content: {
+						id: this.list[this.current].id,
+						limit: 10,
+						list_type: 'page',
+						page: this.page
+					}
+				}).then(res => {
+					this.count = res.response.count
+					if(this.page == 1){
+						this.goodslist = res.response.data
+					}else{
+						this.goodslist = this.goodslist.concat(res.response.data)
+					}
+				})
+			},
+			getgoodstype() {
+				this.$u.post('/Business/getAdvertiseMenu').then(res => {
+					this.list = res.response.data
+					this.getgoods()
+				})
+			},
+			getnewgoods() {
+				this.$u.post('/Advertise/getFind', {
+					content: {
+						business: 3,
+						device_type: 0,
+						type: 7
+					}
+				}).then(res => {
+					this.newgoods = res.response.advertise
+				})
+			},
+			openad() {
+				this.$openad(this.oneimage)
+			},
+			getoneimage() {
+				this.$u.post('/Advertise/getFind', {
+					content: {
+						type: 4,
+						device_type: 0,
+						business: 3
+					}
+				}).then(res => {
+					this.oneimage = res.response.advertise[0] || {}
+				})
+			},
+			toinfo(item) {
+				uni.navigateTo({
+					url: "./goods-info?id=" + item.id,
+					fail(err) {
+						console.log(err);
+					}
+				})
+			},
 			change(index) {
-				this.current = index;
-			},
-			toseatch(){
-				uni.navigateTo({
-					url:"./search"
-				})
+				this.current = index;
+				this.page = 1
+				this.getgoods()
+			},
+			toseatch() {
+				uni.navigateTo({
+					url: "./search"
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	.shop {
+	.shop {
+		.goods-item1 {
+			width: 705rpx;
+			height: 705rpx;
+			margin: 20rpx auto;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 10rpx;
+			position: relative;
+		
+			.goods-body {
+				position: absolute;
+				left: 0;
+				bottom: 0;
+				width: 705rpx;
+				height: 170rpx;
+				background-color: rgba(256, 256, 256, 0.6);
+				padding: 20rpx 40rpx 40rpx 40rpx;
+		
+				.goods-down {
+					text:first-child {
+						font-size:42rpx;
+						font-family: SourceHanSansCN;
+						font-weight: 400;
+						color: #E8380D;
+					}
+					text:nth-child(2){
+						font-size: 19rpx;
+						font-family: SourceHanSansCN;
+						font-weight: 400;
+						color: #000;
+						margin: 0 35rpx 0 31rpx;
+					}
+					text:last-child{
+						font-size: 22rpx;
+						font-family: SourceHanSansCN;
+						font-weight: 400;
+					}
+				}
+		
+				.content {
+					font-size: 22rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #000;
+				}
+		
+				.name {
+					font-size: 28rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
+			}
+		
+			image {
+				width: 665rpx;
+				height: 665rpx;
+				background-color: #27AA76;
+			}
+		}
 		.goods-list {
 			padding: 0 20rpx;
 
@@ -107,24 +269,28 @@
 
 					background-color: #2AA47F;
 				}
-				.price{
-					padding: 0 16rpx;
-					text:first-child{
-						font-size: 39rpx;
-						font-family: SourceHanSansCN;
-						font-weight: 400;
-						color: #E8380D;
-					}
-					text:last-child{
-						width: 157rpx;
-						height: 42rpx;
-						line-height: 42rpx;
-						border-radius: 100rpx;
-						text-align: center;
-						background-color: #F4CC14;
-						font-size: 24rpx;
-					}
+
+				.price {
+					padding: 0 16rpx;
+
+					text:first-child {
+						font-size: 39rpx;
+						font-family: SourceHanSansCN;
+						font-weight: 400;
+						color: #E8380D;
+					}
+
+					text:last-child {
+						width: 157rpx;
+						height: 42rpx;
+						line-height: 42rpx;
+						border-radius: 100rpx;
+						text-align: center;
+						background-color: #F4CC14;
+						font-size: 24rpx;
+					}
 				}
+
 				.name {
 					padding: 0 16rpx 10rpx 16rpx;
 					font-size: 30rpx;
@@ -135,22 +301,25 @@
 					-webkit-line-clamp: 2;
 					overflow: hidden;
 				}
-				.tips{
-					font-size: 21rpx;
-					font-family: SourceHanSansCN;
-					font-weight: 400;
-					color: #A0A0A0;
-					padding: 0 16rpx;
+
+				.tips {
+					font-size: 21rpx;
+					font-family: SourceHanSansCN;
+					font-weight: 400;
+					color: #A0A0A0;
+					padding: 0 16rpx;
 				}
+
 				.label {
 					padding: 0 16rpx;
 					margin-bottom: 10rpx;
+
 					text {
 						margin-right: 10rpx;
 						padding: 4rpx 10rpx;
 						border-radius: 100rpx;
-						background-color: #E1E1E1;
-						color: #929292;
+						background-color: #E1E1E1;
+						color: #929292;
 						font-size: 24rpx;
 					}
 				}
@@ -170,7 +339,7 @@
 
 		.scroll-box {
 			white-space: nowrap;
-			margin-bottom: 20rpx;
+			padding-bottom: 20rpx;
 
 			.goods-item {
 				display: inline-block;
@@ -178,7 +347,6 @@
 				height: 472rpx;
 				border-radius: 10rpx;
 				margin-left: 28rpx;
-				background-color: #FAE5DF;
 				overflow: hidden;
 
 				image {
@@ -197,6 +365,7 @@
 					font-size: 27rpx;
 					font-family: SimHei;
 					font-weight: 400;
+					height: 70rpx;
 				}
 
 				.price {
@@ -224,7 +393,7 @@
 			flex: 1;
 			background-color: #fff;
 			height: 51rpx;
-			border-radius: 6rpx;
+			border-radius: 6rpx;
 			overflow: hidden;
 			margin-right: 25rpx;
 

+ 350 - 158
pages/shop/xiadan.vue

@@ -2,63 +2,84 @@
 	<view class="xiadan">
 		<view class="goods-box">
 			<view class="goods u-flex u-col-center">
-				<image src="" mode=""></image>
+				<image src="../../static/images/shop-order.png" mode=""></image>
 				<view class="right u-flex-col">
-					<text class="name">名字名字</text>
-					<text class="tips">简介简介</text>
+					<text class="name">{{skuitem.goodsname}}</text>
+					<text class="tips">{{skuitem.goodsdesc}}</text>
 					<view class="price">
-						<text>¥50</text>
-						<text>门市价¥100</text>
+						<text>¥{{skuitem.sale_price}}</text>
+						<text>门市价¥{{skuitem.original_price}}</text>
 					</view>
 				</view>
 			</view>
-			<view class="count-box u-flex u-col-center u-row-between">
-				<text class="text">购买数量 库存99 限购数量99</text>
-				<u-number-box v-model="value"></u-number-box>
+			<view class="count-box u-flex u-col-center u-row-between">
+				<text class="text">购买数量 库存{{skuitem.stock_number}} 限购数量{{skuitem.buy_limit_number}}</text>
+				<u-icon name="minus-circle-fill" color="#F7CB16" size="42" @click="jian"></u-icon>
+				<text class="text3">{{skuitem.count}}</text>
+				<u-icon name="plus-circle-fill" color="#F7CB16" size="42" @click="add"></u-icon>
+			</view>
+			<view class="taocan u-flex u-row-between u-col-top">
+				<text class="left">{{skuitem.title}}</text>
+				<view class="right u-flex-col u-col-bottom">
+					<view class="price1">¥{{yuohui.payment_price || ''}}</view>
+					<view class="price2">
+						<text>商品原价:¥{{yuohui.original_sale_price || ''}}</text>
+						<text>优惠:¥{{yuohui.discount_amount || ''}}</text>
+					</view>
+					<view class="shuoming">优惠金额说明:{{yuohui.discount_amount_text || ''}}</view>
+				</view>
+			</view>
+			<view class="taocan u-flex u-row-between u-col-top">
+				<text class="left">{{skuitem.title}}:{{skuitem.desc}}</text>
+			</view>
+			<view class="taocan">
+				<u-radio-group v-model="value" active-color="#08AA8C">
+					<u-radio :name="0">不需要发票</u-radio>
+					<u-radio :name="1">索取发票</u-radio>
+				</u-radio-group>
+				<view class="input u-flex u-col-center" v-if="value == 1">
+					<text style="margin-right: 20rpx;">发票抬头:</text>
+					<input type="text" placeholder="填写发票抬头" v-model="fapiao"/>
+				</view>
 			</view>
-			<view class="taocan u-flex u-row-between u-col-top">
-				<text class="left">套餐1</text>
-				<view class="right u-flex-col u-col-bottom">
-					<view class="price1">¥50</view>
-					<view class="price2">
-						<text>商品原价:¥100</text>
-						<text>优惠:¥50</text>
+			<picker mode="selector" :range="peisong" @change="changepeisong">
+				<view class="peisong-box u-flex u-col-center u-row-between">
+					<text class="text">配送方式</text>
+					<view class="right u-flex u-col-center">
+						<text class="text1">{{peisongtext}}</text>
+						<u-icon name="arrow-right" color="#08AA8C"></u-icon>
 					</view>
-					<view class="shuoming">优惠金额说明:这里是优惠说明</view>
-				</view>
-			</view>
-			<view class="peisong-box u-flex u-col-center u-row-between">
-				<text class="text">配送方式</text>
-				<view class="right u-flex u-col-center">
-					<text class="text1">到家 </text>
-					<u-icon name="arrow-right" color="#08AA8C"></u-icon>
 				</view>
+			</picker>
+			
+		</view>
+		<view class="address-box">
+			<view class="qiehuan" @tap="changeaddress">
+				切换地址
 			</view>
-		</view>
-		<view class="address-box">
-			<view class="qiehuan">
-				切换地址
-			</view>
-			<view class="address">
-				<view class="name">
-					姓名  1591663977
-				</view>
-				<view class="address-text">
-					字体样式  #707070
-				</view>
-			</view>
-			<view class="price1 u-flex u-col-center u-row-right">
-				<text class="text1">¥50</text>
-				<view class="text2">
-					<x-button :width='205' :height="71" color="#000" fontSize="25rpx">确认下单</x-button>
-				</view>
-			</view>
-			<view class="xieyi-box u-flex u-col-center u-row-right">
-				<u-checkbox v-model="checked" active-color="#08AA8C">请阅读并同意</u-checkbox>
-				<view class="text u-flex u-col-center" style="color: #08AA8C;">
-					《平台用户服务协议》
-				</view>
+			<view class="address" v-if="address.id">
+				<view class="name">
+					{{address.name}} {{address.phone}}
+				</view>
+				<view class="address-text">
+					{{address.address}}{{address.location_address}}
+				</view>
 			</view>
+			<view style="text-align: center;margin-bottom: 20rpx;" v-else>
+				暂无收货地址
+			</view>
+			<view class="price1 u-flex u-col-center u-row-right">
+				<text class="text1">¥{{yuohui.payment_price || ''}}</text>
+				<view class="text2">
+					<x-button :width='205' :height="71" color="#000" fontSize="25rpx" @click="xiadan(0)">确认下单</x-button>
+				</view>
+			</view>
+			<view class="xieyi-box u-flex u-col-center u-row-right">
+				<u-checkbox v-model="checked" active-color="#08AA8C">请阅读并同意</u-checkbox>
+				<view class="text u-flex u-col-center" style="color: #08AA8C;" @tap="toxieyi">
+					《平台用户服务协议》
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -67,134 +88,305 @@
 	export default {
 		data() {
 			return {
-				value: '',
-				checked:false
+				value: 0,
+				checked: false,
+				skuitem: {},
+				peisong:['到家','到店','送货上门'],
+				peisongtext:'到家',
+				peisongid:1,
+				address:{},
+				fapiao:'',
+				yuohui:{},
+				order_id:''
 			}
 		},
-		onLoad() {
-
+		onLoad(option) {
+			this.skuitem = JSON.parse(decodeURIComponent(option.obj))
+			this.xiadan(1)
+			console.log(this.skuitem);
+		},
+		onShow() {
+			this.getaddress()
 		},
-		methods: {
+		methods: {
+			xiadan(type){
+				if(type == 0){
+					if(!this.checked){
+						this.$u.toast('请勾选协议')
+						return
+					}
+					if(!this.address.id){
+						this.$u.toast("请添加地址")
+						return
+					}
+					if(this.value == 1){
+						if(!this.fapiao){
+							this.$u.toast('请填写发票抬头')
+							return
+						}
+					}
+				}
+				this.$u.post('/OrderBusinessProduct/add',{
+					content:{
+						business_product_id:this.skuitem.business_product_id,
+						business_product_specifications_id:this.skuitem.id,
+						invoice_title:this.fapiao,
+						is_check:type,
+						is_invoice:this.value,
+						number:this.skuitem.count,
+						pickup_method:this.peisongid,
+						user_address_id:this.address.id,
+					}
+				}).then(res => {
+					if(res.code == 0){
+						if(type == 1){
+							this.yuohui = res.response
+						}else{
+							this.order_id = res.response.order_no
+							this.wxpay()
+						}
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			wxpay(){
+				this.$u.post('/Order/payment',{
+					content:{
+						order_no:this.order_id,
+						type:1
+					}
+				}).then(res => {
+					if(res.code == 0){
+						uni.requestPayment({
+							nonceStr:res.response.nonceStr,
+							package:res.response.package,
+							paySign:res.response.paySign,
+							signType:res.response.signType,
+							timeStamp:res.response.timeStamp,
+							success: (res) => {
+								this.$u.toast("支付成功")
+								setTimeout(() => {
+									uni.navigateTo({
+										url:"../order/order-info?id=" + this.order_id
+									})
+								},800)
+								console.log(res);
+							},
+							fail:(err) => {
+								this.$u.toast("支付失败")
+								setTimeout(() => {
+									uni.navigateTo({
+										url:"../order/order-info?id=" + this.order_id
+									})
+								},800)
+								console.log(err);
+							}
+						})
+					}else{
+						this.$u.toast(res.msg)
+					}
+				})
+			},
+			changeaddress(){
+				uni.navigateTo({
+					url:"../mine/address-list?type=1",
+					events:{
+						changeadd:(res) => {
+							this.address = res
+						}
+					}
+				})
+			},
+			toxieyi(){
+				uni.navigateTo({
+					url:"../mine/all-tips?type=11"
+				})
+			},
+			getaddress(){
+				this.$u.post('/UserAddress/list',{
+					content:{
+						erow:1,
+						list_type:'limit',
+						srow:0
+					}
+				}).then(res => {
+					if(res.response.data.length > 0){
+						if(!this.address.id){
+							this.address = res.response.data[0]
+						}
+					}else{
+						this.address = {}
+					}
+				})
+			},
+			changepeisong(e){
+				this.peisongtext = this.peisong[e.detail.value]
+				this.peisongid = e.detail.value == 0 ? 1 : e.detail.value == 1 ? 2 : 3
+			},
+			add() {
+				this.skuitem.count = this.skuitem.count + 1
+				this.xiadan(1)
+			},
+			jian() {
+				if (this.skuitem.count == 1) {
 
+				} else {
+					this.skuitem.count = this.skuitem.count - 1
+					this.xiadan(1)
+				}
+			}
 		}
 	}
 </script>
 
 <style lang="scss">
-	.xiadan {
-		.address-box{
-			width: 706rpx;
-			// height: 1105rpx;
-			margin: 20rpx auto;
-			background-color: #fff;
-			border-radius: 20rpx;
-			padding: 0 20rpx 30rpx 20rpx;
-			.xieyi-box{
-				margin-top: 20rpx;
-				.text{
-					line-height: 1.8;
-				}
-			}
-			.price1{
-				.text1{
-					font-size: 31rpx;
-					font-family: SourceHanSansCN;
-					font-weight: 400;
-					color: #E8380D;
-					margin-right: 43rpx;
-				}
-				.text2 {
-					width: 205rpx;
-					height: 71rpx;
-					
-				}
-				
-				
-			}
-			.address{
-				.name{
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #707070;
-					margin-bottom: 20rpx;
-				}
-				.address-text{
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-					color: #707070;
-					margin-bottom: 80rpx;
-				}
-			}
-			.qiehuan{
-				text-align: right;
-				font-size: 31rpx;
-				font-family: SimHei;
-				font-weight: 400;
-				color: #08AA8C;
-				padding: 20rpx 0;
-			}
+	.xiadan {
+		.address-box {
+			width: 706rpx;
+			// height: 1105rpx;
+			margin: 20rpx auto;
+			background-color: #fff;
+			border-radius: 20rpx;
+			padding: 0 20rpx 30rpx 20rpx;
+
+			.xieyi-box {
+				margin-top: 20rpx;
+
+				.text {
+					line-height: 1.8;
+				}
+			}
+
+			.price1 {
+				.text1 {
+					font-size: 31rpx;
+					font-family: SourceHanSansCN;
+					font-weight: 400;
+					color: #E8380D;
+					margin-right: 43rpx;
+				}
+
+				.text2 {
+					width: 205rpx;
+					height: 71rpx;
+
+				}
+
+
+			}
+
+			.address {
+				.name {
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #707070;
+					margin-bottom: 20rpx;
+				}
+
+				.address-text {
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+					color: #707070;
+					margin-bottom: 80rpx;
+				}
+			}
+
+			.qiehuan {
+				text-align: right;
+				font-size: 31rpx;
+				font-family: SimHei;
+				font-weight: 400;
+				color: #08AA8C;
+				padding: 20rpx 0;
+			}
 		}
+
 		.goods-box {
 			width: 706rpx;
 			// height: 1105rpx;
 			margin: 20rpx auto;
 			background-color: #fff;
 			border-radius: 20rpx;
-			padding: 0 20rpx 30rpx 20rpx;
-			.peisong-box{
-				margin-top: 20rpx;
-				.right{
-					.text1{
-						font-size: 31rpx;
-						font-family: SimHei;
-						font-weight: 400;
-						color: #08AA8C;
-					}
-				}
-				.text{
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-				}
-			}
-			.taocan{
-				padding: 20rpx 0;
-				.right{
-					.shuoming{
-						font-size: 24rpx;
-						color: rgba(0,0,0,0.3);
-					}
-					.price2{
-						font-size:26rpx;
-						color: rgba(0,0,0,0.5);
-						text:first-child{
-							text-decoration: line-through;
-							margin-right: 4rpx;
-						}
-					}
-					.price1{
-						font-size: 31rpx;
-						font-family: SourceHanSansCN;
-						font-weight: 400;
-						color: #E8380D;
+			padding: 0 20rpx 30rpx 20rpx;
+
+			.peisong-box {
+				margin-top: 20rpx;
+
+				.right {
+					.text1 {
+						font-size: 31rpx;
+						font-family: SimHei;
+						font-weight: 400;
+						color: #08AA8C;
+					}
+				}
+
+				.text {
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
+			}
+
+			.taocan {
+				padding: 20rpx 0;
+				border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
+				.input{
+					input{
+						flex: 1;
+						border-bottom: 2rpx solid #2AA47F;
+						padding: 0 20rpx;
 					}
-				}
-				.left{
-					font-size: 31rpx;
-					font-family: SimHei;
-					font-weight: 400;
-				}
+				}
+				.right {
+					.shuoming {
+						font-size: 24rpx;
+						color: rgba(0, 0, 0, 0.3);
+					}
+
+					.price2 {
+						font-size: 26rpx;
+						color: rgba(0, 0, 0, 0.5);
+
+						text:first-child {
+							text-decoration: line-through;
+							margin-right: 4rpx;
+						}
+					}
+
+					.price1 {
+						font-size: 31rpx;
+						font-family: SourceHanSansCN;
+						font-weight: 400;
+						color: #E8380D;
+					}
+				}
+
+				.left {
+					font-size: 31rpx;
+					font-family: SimHei;
+					font-weight: 400;
+				}
 			}
-			.count-box{
-				padding-bottom: 20rpx;
-				border-bottom: 1rpx solid rgba(0,0,0,0.1);
-				.text{
-					font-size: 28rpx;
-					color: rgba(0,0,0,0.5);
-				}
+
+			.count-box {
+				padding-bottom: 20rpx;
+				border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
+
+				.text {
+					font-size: 28rpx;
+					color: rgba(0, 0, 0, 0.5);
+					flex: 1;
+				}
+
+				.text3 {
+					margin: 0 10rpx;
+				}
 			}
+
 			.goods {
 				padding: 27rpx 0;
 
@@ -227,8 +419,8 @@
 				image {
 					width: 151rpx;
 					height: 151rpx;
-					border-radius: 20rpx;
-					border: 1rpx solid #999;
+					border-radius: 100rpx;
+					// border: 1rpx solid #999;
 					margin-right: 20rpx;
 				}
 			}

BIN
static/.DS_Store


BIN
static/images/guanggao.jpeg


BIN
static/images/mine1-1.png


BIN
static/images/order1-1.png


BIN
static/images/shop-order.png


BIN
static/images/shop1.png


BIN
static/images/userBG.png


BIN
static/images/wxpic.png


BIN
static/images/wxpic.webp


BIN
static/logo.png


+ 18 - 0
uni_modules/Sansnn-uQRCode/changelog.md

@@ -0,0 +1,18 @@
+## 3.0.1(2022-01-05)
+3.0.1 gcanvas引用目录调整。
+## 3.0.0(2022-01-04)
+3.0.0 uQRCode 3.0 全新版本来袭。
+## 2.0.4(2021-11-19)
+2.0.4 新增绘制模式;新增绘制延时、canvas导入文件延时属性。
+## 2.0.3(2021-10-18)
+2.0.3 修复在部分安卓设备生成异常;移除延迟绘制;新增批量生成示例。
+## 2.0.23(2021-08-09)
+ 
+## 2.0.22(2021-08-09)
+ 
+## 2.0.21(2021-07-28)
+ 
+## 2.0.2(2021-07-28)
+2.0.2 新增延迟绘制。
+## 2.0.1(2021-07-26)
+2.0.1 调整为uni_modules目录规范。

+ 1323 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/common/uqrcode.js

@@ -0,0 +1,1323 @@
+//---------------------------------------------------------------------
+// github https://github.com/Sansnn/uQRCode
+// version 3.0.0
+//---------------------------------------------------------------------
+
+"use strict";
+
+let uQRCode = (() => {
+  return {}
+})();
+
+(function() {
+  //---------------------------------------------------------------------
+  // QRCode for JavaScript
+  //
+  // Copyright (c) 2009 Kazuhiko Arase
+  //
+  // URL: http://www.d-project.com/
+  //
+  // Licensed under the MIT license:
+  //   http://www.opensource.org/licenses/mit-license.php
+  //
+  // The word "QR Code" is registered trademark of 
+  // DENSO WAVE INCORPORATED
+  //   http://www.denso-wave.com/qrcode/faqpatent-e.html
+  //
+  //---------------------------------------------------------------------
+
+  //---------------------------------------------------------------------
+  // QR8bitByte
+  //---------------------------------------------------------------------
+
+  function QR8bitByte(data) {
+    this.mode = QRMode.MODE_8BIT_BYTE;
+    this.data = data;
+  }
+
+  QR8bitByte.prototype = {
+
+    getLength: function(buffer) {
+      return this.data.length;
+    },
+
+    write: function(buffer) {
+      for (var i = 0; i < this.data.length; i++) {
+        // not JIS ...
+        buffer.put(this.data.charCodeAt(i), 8);
+      }
+    }
+  };
+
+  //---------------------------------------------------------------------
+  // QRCode
+  //---------------------------------------------------------------------
+
+  function QRCode(typeNumber, errorCorrectLevel) {
+    this.typeNumber = typeNumber;
+    this.errorCorrectLevel = errorCorrectLevel;
+    this.modules = null;
+    this.moduleCount = 0;
+    this.dataCache = null;
+    this.dataList = new Array();
+  }
+
+  QRCode.prototype = {
+
+    addData: function(data) {
+      var newData = new QR8bitByte(data);
+      this.dataList.push(newData);
+      this.dataCache = null;
+    },
+
+    isDark: function(row, col) {
+      if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
+        throw new Error(row + "," + col);
+      }
+      return this.modules[row][col];
+    },
+
+    getModuleCount: function() {
+      return this.moduleCount;
+    },
+
+    make: function() {
+      // Calculate automatically typeNumber if provided is < 1
+      if (this.typeNumber < 1) {
+        var typeNumber = 1;
+        for (typeNumber = 1; typeNumber < 40; typeNumber++) {
+          var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
+
+          var buffer = new QRBitBuffer();
+          var totalDataCount = 0;
+          for (var i = 0; i < rsBlocks.length; i++) {
+            totalDataCount += rsBlocks[i].dataCount;
+          }
+
+          for (var i = 0; i < this.dataList.length; i++) {
+            var data = this.dataList[i];
+            buffer.put(data.mode, 4);
+            buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
+            data.write(buffer);
+          }
+          if (buffer.getLengthInBits() <= totalDataCount * 8)
+            break;
+        }
+        this.typeNumber = typeNumber;
+      }
+      this.makeImpl(false, this.getBestMaskPattern());
+    },
+
+    makeImpl: function(test, maskPattern) {
+
+      this.moduleCount = this.typeNumber * 4 + 17;
+      this.modules = new Array(this.moduleCount);
+
+      for (var row = 0; row < this.moduleCount; row++) {
+
+        this.modules[row] = new Array(this.moduleCount);
+
+        for (var col = 0; col < this.moduleCount; col++) {
+          this.modules[row][col] = null; //(col + row) % 3;
+        }
+      }
+
+      this.setupPositionProbePattern(0, 0);
+      this.setupPositionProbePattern(this.moduleCount - 7, 0);
+      this.setupPositionProbePattern(0, this.moduleCount - 7);
+      this.setupPositionAdjustPattern();
+      this.setupTimingPattern();
+      this.setupTypeInfo(test, maskPattern);
+
+      if (this.typeNumber >= 7) {
+        this.setupTypeNumber(test);
+      }
+
+      if (this.dataCache == null) {
+        this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
+      }
+
+      this.mapData(this.dataCache, maskPattern);
+    },
+
+    setupPositionProbePattern: function(row, col) {
+
+      for (var r = -1; r <= 7; r++) {
+
+        if (row + r <= -1 || this.moduleCount <= row + r) continue;
+
+        for (var c = -1; c <= 7; c++) {
+
+          if (col + c <= -1 || this.moduleCount <= col + c) continue;
+
+          if ((0 <= r && r <= 6 && (c == 0 || c == 6)) ||
+            (0 <= c && c <= 6 && (r == 0 || r == 6)) ||
+            (2 <= r && r <= 4 && 2 <= c && c <= 4)) {
+            this.modules[row + r][col + c] = true;
+          } else {
+            this.modules[row + r][col + c] = false;
+          }
+        }
+      }
+    },
+
+    getBestMaskPattern: function() {
+
+      var minLostPoint = 0;
+      var pattern = 0;
+
+      for (var i = 0; i < 8; i++) {
+
+        this.makeImpl(true, i);
+
+        var lostPoint = QRUtil.getLostPoint(this);
+
+        if (i == 0 || minLostPoint > lostPoint) {
+          minLostPoint = lostPoint;
+          pattern = i;
+        }
+      }
+
+      return pattern;
+    },
+
+    createMovieClip: function(target_mc, instance_name, depth) {
+
+      var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
+      var cs = 1;
+
+      this.make();
+
+      for (var row = 0; row < this.modules.length; row++) {
+
+        var y = row * cs;
+
+        for (var col = 0; col < this.modules[row].length; col++) {
+
+          var x = col * cs;
+          var dark = this.modules[row][col];
+
+          if (dark) {
+            qr_mc.beginFill(0, 100);
+            qr_mc.moveTo(x, y);
+            qr_mc.lineTo(x + cs, y);
+            qr_mc.lineTo(x + cs, y + cs);
+            qr_mc.lineTo(x, y + cs);
+            qr_mc.endFill();
+          }
+        }
+      }
+
+      return qr_mc;
+    },
+
+    setupTimingPattern: function() {
+
+      for (var r = 8; r < this.moduleCount - 8; r++) {
+        if (this.modules[r][6] != null) {
+          continue;
+        }
+        this.modules[r][6] = (r % 2 == 0);
+      }
+
+      for (var c = 8; c < this.moduleCount - 8; c++) {
+        if (this.modules[6][c] != null) {
+          continue;
+        }
+        this.modules[6][c] = (c % 2 == 0);
+      }
+    },
+
+    setupPositionAdjustPattern: function() {
+
+      var pos = QRUtil.getPatternPosition(this.typeNumber);
+
+      for (var i = 0; i < pos.length; i++) {
+
+        for (var j = 0; j < pos.length; j++) {
+
+          var row = pos[i];
+          var col = pos[j];
+
+          if (this.modules[row][col] != null) {
+            continue;
+          }
+
+          for (var r = -2; r <= 2; r++) {
+
+            for (var c = -2; c <= 2; c++) {
+
+              if (r == -2 || r == 2 || c == -2 || c == 2 ||
+                (r == 0 && c == 0)) {
+                this.modules[row + r][col + c] = true;
+              } else {
+                this.modules[row + r][col + c] = false;
+              }
+            }
+          }
+        }
+      }
+    },
+
+    setupTypeNumber: function(test) {
+
+      var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
+
+      for (var i = 0; i < 18; i++) {
+        var mod = (!test && ((bits >> i) & 1) == 1);
+        this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
+      }
+
+      for (var i = 0; i < 18; i++) {
+        var mod = (!test && ((bits >> i) & 1) == 1);
+        this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
+      }
+    },
+
+    setupTypeInfo: function(test, maskPattern) {
+
+      var data = (this.errorCorrectLevel << 3) | maskPattern;
+      var bits = QRUtil.getBCHTypeInfo(data);
+
+      // vertical		
+      for (var i = 0; i < 15; i++) {
+
+        var mod = (!test && ((bits >> i) & 1) == 1);
+
+        if (i < 6) {
+          this.modules[i][8] = mod;
+        } else if (i < 8) {
+          this.modules[i + 1][8] = mod;
+        } else {
+          this.modules[this.moduleCount - 15 + i][8] = mod;
+        }
+      }
+
+      // horizontal
+      for (var i = 0; i < 15; i++) {
+
+        var mod = (!test && ((bits >> i) & 1) == 1);
+
+        if (i < 8) {
+          this.modules[8][this.moduleCount - i - 1] = mod;
+        } else if (i < 9) {
+          this.modules[8][15 - i - 1 + 1] = mod;
+        } else {
+          this.modules[8][15 - i - 1] = mod;
+        }
+      }
+
+      // fixed module
+      this.modules[this.moduleCount - 8][8] = (!test);
+
+    },
+
+    mapData: function(data, maskPattern) {
+
+      var inc = -1;
+      var row = this.moduleCount - 1;
+      var bitIndex = 7;
+      var byteIndex = 0;
+
+      for (var col = this.moduleCount - 1; col > 0; col -= 2) {
+
+        if (col == 6) col--;
+
+        while (true) {
+
+          for (var c = 0; c < 2; c++) {
+
+            if (this.modules[row][col - c] == null) {
+
+              var dark = false;
+
+              if (byteIndex < data.length) {
+                dark = (((data[byteIndex] >>> bitIndex) & 1) == 1);
+              }
+
+              var mask = QRUtil.getMask(maskPattern, row, col - c);
+
+              if (mask) {
+                dark = !dark;
+              }
+
+              this.modules[row][col - c] = dark;
+              bitIndex--;
+
+              if (bitIndex == -1) {
+                byteIndex++;
+                bitIndex = 7;
+              }
+            }
+          }
+
+          row += inc;
+
+          if (row < 0 || this.moduleCount <= row) {
+            row -= inc;
+            inc = -inc;
+            break;
+          }
+        }
+      }
+
+    }
+
+  };
+
+  QRCode.PAD0 = 0xEC;
+  QRCode.PAD1 = 0x11;
+
+  QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
+
+    var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
+
+    var buffer = new QRBitBuffer();
+
+    for (var i = 0; i < dataList.length; i++) {
+      var data = dataList[i];
+      buffer.put(data.mode, 4);
+      buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
+      data.write(buffer);
+    }
+
+    // calc num max data.
+    var totalDataCount = 0;
+    for (var i = 0; i < rsBlocks.length; i++) {
+      totalDataCount += rsBlocks[i].dataCount;
+    }
+
+    if (buffer.getLengthInBits() > totalDataCount * 8) {
+      throw new Error("code length overflow. (" +
+        buffer.getLengthInBits() +
+        ">" +
+        totalDataCount * 8 +
+        ")");
+    }
+
+    // end code
+    if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
+      buffer.put(0, 4);
+    }
+
+    // padding
+    while (buffer.getLengthInBits() % 8 != 0) {
+      buffer.putBit(false);
+    }
+
+    // padding
+    while (true) {
+
+      if (buffer.getLengthInBits() >= totalDataCount * 8) {
+        break;
+      }
+      buffer.put(QRCode.PAD0, 8);
+
+      if (buffer.getLengthInBits() >= totalDataCount * 8) {
+        break;
+      }
+      buffer.put(QRCode.PAD1, 8);
+    }
+
+    return QRCode.createBytes(buffer, rsBlocks);
+  }
+
+  QRCode.createBytes = function(buffer, rsBlocks) {
+
+    var offset = 0;
+
+    var maxDcCount = 0;
+    var maxEcCount = 0;
+
+    var dcdata = new Array(rsBlocks.length);
+    var ecdata = new Array(rsBlocks.length);
+
+    for (var r = 0; r < rsBlocks.length; r++) {
+
+      var dcCount = rsBlocks[r].dataCount;
+      var ecCount = rsBlocks[r].totalCount - dcCount;
+
+      maxDcCount = Math.max(maxDcCount, dcCount);
+      maxEcCount = Math.max(maxEcCount, ecCount);
+
+      dcdata[r] = new Array(dcCount);
+
+      for (var i = 0; i < dcdata[r].length; i++) {
+        dcdata[r][i] = 0xff & buffer.buffer[i + offset];
+      }
+      offset += dcCount;
+
+      var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
+      var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
+
+      var modPoly = rawPoly.mod(rsPoly);
+      ecdata[r] = new Array(rsPoly.getLength() - 1);
+      for (var i = 0; i < ecdata[r].length; i++) {
+        var modIndex = i + modPoly.getLength() - ecdata[r].length;
+        ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0;
+      }
+
+    }
+
+    var totalCodeCount = 0;
+    for (var i = 0; i < rsBlocks.length; i++) {
+      totalCodeCount += rsBlocks[i].totalCount;
+    }
+
+    var data = new Array(totalCodeCount);
+    var index = 0;
+
+    for (var i = 0; i < maxDcCount; i++) {
+      for (var r = 0; r < rsBlocks.length; r++) {
+        if (i < dcdata[r].length) {
+          data[index++] = dcdata[r][i];
+        }
+      }
+    }
+
+    for (var i = 0; i < maxEcCount; i++) {
+      for (var r = 0; r < rsBlocks.length; r++) {
+        if (i < ecdata[r].length) {
+          data[index++] = ecdata[r][i];
+        }
+      }
+    }
+
+    return data;
+
+  }
+
+  //---------------------------------------------------------------------
+  // QRMode
+  //---------------------------------------------------------------------
+
+  var QRMode = {
+    MODE_NUMBER: 1 << 0,
+    MODE_ALPHA_NUM: 1 << 1,
+    MODE_8BIT_BYTE: 1 << 2,
+    MODE_KANJI: 1 << 3
+  };
+
+  //---------------------------------------------------------------------
+  // QRErrorCorrectLevel
+  //---------------------------------------------------------------------
+
+  var QRErrorCorrectLevel = {
+    L: 1,
+    M: 0,
+    Q: 3,
+    H: 2
+  };
+
+  //---------------------------------------------------------------------
+  // QRMaskPattern
+  //---------------------------------------------------------------------
+
+  var QRMaskPattern = {
+    PATTERN000: 0,
+    PATTERN001: 1,
+    PATTERN010: 2,
+    PATTERN011: 3,
+    PATTERN100: 4,
+    PATTERN101: 5,
+    PATTERN110: 6,
+    PATTERN111: 7
+  };
+
+  //---------------------------------------------------------------------
+  // QRUtil
+  //---------------------------------------------------------------------
+
+  var QRUtil = {
+
+    PATTERN_POSITION_TABLE: [
+      [],
+      [6, 18],
+      [6, 22],
+      [6, 26],
+      [6, 30],
+      [6, 34],
+      [6, 22, 38],
+      [6, 24, 42],
+      [6, 26, 46],
+      [6, 28, 50],
+      [6, 30, 54],
+      [6, 32, 58],
+      [6, 34, 62],
+      [6, 26, 46, 66],
+      [6, 26, 48, 70],
+      [6, 26, 50, 74],
+      [6, 30, 54, 78],
+      [6, 30, 56, 82],
+      [6, 30, 58, 86],
+      [6, 34, 62, 90],
+      [6, 28, 50, 72, 94],
+      [6, 26, 50, 74, 98],
+      [6, 30, 54, 78, 102],
+      [6, 28, 54, 80, 106],
+      [6, 32, 58, 84, 110],
+      [6, 30, 58, 86, 114],
+      [6, 34, 62, 90, 118],
+      [6, 26, 50, 74, 98, 122],
+      [6, 30, 54, 78, 102, 126],
+      [6, 26, 52, 78, 104, 130],
+      [6, 30, 56, 82, 108, 134],
+      [6, 34, 60, 86, 112, 138],
+      [6, 30, 58, 86, 114, 142],
+      [6, 34, 62, 90, 118, 146],
+      [6, 30, 54, 78, 102, 126, 150],
+      [6, 24, 50, 76, 102, 128, 154],
+      [6, 28, 54, 80, 106, 132, 158],
+      [6, 32, 58, 84, 110, 136, 162],
+      [6, 26, 54, 82, 110, 138, 166],
+      [6, 30, 58, 86, 114, 142, 170]
+    ],
+
+    G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
+    G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
+    G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
+
+    getBCHTypeInfo: function(data) {
+      var d = data << 10;
+      while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
+        d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15)));
+      }
+      return ((data << 10) | d) ^ QRUtil.G15_MASK;
+    },
+
+    getBCHTypeNumber: function(data) {
+      var d = data << 12;
+      while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
+        d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18)));
+      }
+      return (data << 12) | d;
+    },
+
+    getBCHDigit: function(data) {
+
+      var digit = 0;
+
+      while (data != 0) {
+        digit++;
+        data >>>= 1;
+      }
+
+      return digit;
+    },
+
+    getPatternPosition: function(typeNumber) {
+      return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
+    },
+
+    getMask: function(maskPattern, i, j) {
+
+      switch (maskPattern) {
+
+        case QRMaskPattern.PATTERN000:
+          return (i + j) % 2 == 0;
+        case QRMaskPattern.PATTERN001:
+          return i % 2 == 0;
+        case QRMaskPattern.PATTERN010:
+          return j % 3 == 0;
+        case QRMaskPattern.PATTERN011:
+          return (i + j) % 3 == 0;
+        case QRMaskPattern.PATTERN100:
+          return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
+        case QRMaskPattern.PATTERN101:
+          return (i * j) % 2 + (i * j) % 3 == 0;
+        case QRMaskPattern.PATTERN110:
+          return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
+        case QRMaskPattern.PATTERN111:
+          return ((i * j) % 3 + (i + j) % 2) % 2 == 0;
+
+        default:
+          throw new Error("bad maskPattern:" + maskPattern);
+      }
+    },
+
+    getErrorCorrectPolynomial: function(errorCorrectLength) {
+
+      var a = new QRPolynomial([1], 0);
+
+      for (var i = 0; i < errorCorrectLength; i++) {
+        a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
+      }
+
+      return a;
+    },
+
+    getLengthInBits: function(mode, type) {
+
+      if (1 <= type && type < 10) {
+
+        // 1 - 9
+
+        switch (mode) {
+          case QRMode.MODE_NUMBER:
+            return 10;
+          case QRMode.MODE_ALPHA_NUM:
+            return 9;
+          case QRMode.MODE_8BIT_BYTE:
+            return 8;
+          case QRMode.MODE_KANJI:
+            return 8;
+          default:
+            throw new Error("mode:" + mode);
+        }
+
+      } else if (type < 27) {
+
+        // 10 - 26
+
+        switch (mode) {
+          case QRMode.MODE_NUMBER:
+            return 12;
+          case QRMode.MODE_ALPHA_NUM:
+            return 11;
+          case QRMode.MODE_8BIT_BYTE:
+            return 16;
+          case QRMode.MODE_KANJI:
+            return 10;
+          default:
+            throw new Error("mode:" + mode);
+        }
+
+      } else if (type < 41) {
+
+        // 27 - 40
+
+        switch (mode) {
+          case QRMode.MODE_NUMBER:
+            return 14;
+          case QRMode.MODE_ALPHA_NUM:
+            return 13;
+          case QRMode.MODE_8BIT_BYTE:
+            return 16;
+          case QRMode.MODE_KANJI:
+            return 12;
+          default:
+            throw new Error("mode:" + mode);
+        }
+
+      } else {
+        throw new Error("type:" + type);
+      }
+    },
+
+    getLostPoint: function(qrCode) {
+
+      var moduleCount = qrCode.getModuleCount();
+
+      var lostPoint = 0;
+
+      // LEVEL1
+
+      for (var row = 0; row < moduleCount; row++) {
+
+        for (var col = 0; col < moduleCount; col++) {
+
+          var sameCount = 0;
+          var dark = qrCode.isDark(row, col);
+
+          for (var r = -1; r <= 1; r++) {
+
+            if (row + r < 0 || moduleCount <= row + r) {
+              continue;
+            }
+
+            for (var c = -1; c <= 1; c++) {
+
+              if (col + c < 0 || moduleCount <= col + c) {
+                continue;
+              }
+
+              if (r == 0 && c == 0) {
+                continue;
+              }
+
+              if (dark == qrCode.isDark(row + r, col + c)) {
+                sameCount++;
+              }
+            }
+          }
+
+          if (sameCount > 5) {
+            lostPoint += (3 + sameCount - 5);
+          }
+        }
+      }
+
+      // LEVEL2
+
+      for (var row = 0; row < moduleCount - 1; row++) {
+        for (var col = 0; col < moduleCount - 1; col++) {
+          var count = 0;
+          if (qrCode.isDark(row, col)) count++;
+          if (qrCode.isDark(row + 1, col)) count++;
+          if (qrCode.isDark(row, col + 1)) count++;
+          if (qrCode.isDark(row + 1, col + 1)) count++;
+          if (count == 0 || count == 4) {
+            lostPoint += 3;
+          }
+        }
+      }
+
+      // LEVEL3
+
+      for (var row = 0; row < moduleCount; row++) {
+        for (var col = 0; col < moduleCount - 6; col++) {
+          if (qrCode.isDark(row, col) &&
+            !qrCode.isDark(row, col + 1) &&
+            qrCode.isDark(row, col + 2) &&
+            qrCode.isDark(row, col + 3) &&
+            qrCode.isDark(row, col + 4) &&
+            !qrCode.isDark(row, col + 5) &&
+            qrCode.isDark(row, col + 6)) {
+            lostPoint += 40;
+          }
+        }
+      }
+
+      for (var col = 0; col < moduleCount; col++) {
+        for (var row = 0; row < moduleCount - 6; row++) {
+          if (qrCode.isDark(row, col) &&
+            !qrCode.isDark(row + 1, col) &&
+            qrCode.isDark(row + 2, col) &&
+            qrCode.isDark(row + 3, col) &&
+            qrCode.isDark(row + 4, col) &&
+            !qrCode.isDark(row + 5, col) &&
+            qrCode.isDark(row + 6, col)) {
+            lostPoint += 40;
+          }
+        }
+      }
+
+      // LEVEL4
+
+      var darkCount = 0;
+
+      for (var col = 0; col < moduleCount; col++) {
+        for (var row = 0; row < moduleCount; row++) {
+          if (qrCode.isDark(row, col)) {
+            darkCount++;
+          }
+        }
+      }
+
+      var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
+      lostPoint += ratio * 10;
+
+      return lostPoint;
+    }
+
+  };
+
+
+  //---------------------------------------------------------------------
+  // QRMath
+  //---------------------------------------------------------------------
+
+  var QRMath = {
+
+    glog: function(n) {
+
+      if (n < 1) {
+        throw new Error("glog(" + n + ")");
+      }
+
+      return QRMath.LOG_TABLE[n];
+    },
+
+    gexp: function(n) {
+
+      while (n < 0) {
+        n += 255;
+      }
+
+      while (n >= 256) {
+        n -= 255;
+      }
+
+      return QRMath.EXP_TABLE[n];
+    },
+
+    EXP_TABLE: new Array(256),
+
+    LOG_TABLE: new Array(256)
+
+  };
+
+  for (var i = 0; i < 8; i++) {
+    QRMath.EXP_TABLE[i] = 1 << i;
+  }
+  for (var i = 8; i < 256; i++) {
+    QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^
+      QRMath.EXP_TABLE[i - 5] ^
+      QRMath.EXP_TABLE[i - 6] ^
+      QRMath.EXP_TABLE[i - 8];
+  }
+  for (var i = 0; i < 255; i++) {
+    QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
+  }
+
+  //---------------------------------------------------------------------
+  // QRPolynomial
+  //---------------------------------------------------------------------
+
+  function QRPolynomial(num, shift) {
+
+    if (num.length == undefined) {
+      throw new Error(num.length + "/" + shift);
+    }
+
+    var offset = 0;
+
+    while (offset < num.length && num[offset] == 0) {
+      offset++;
+    }
+
+    this.num = new Array(num.length - offset + shift);
+    for (var i = 0; i < num.length - offset; i++) {
+      this.num[i] = num[i + offset];
+    }
+  }
+
+  QRPolynomial.prototype = {
+
+    get: function(index) {
+      return this.num[index];
+    },
+
+    getLength: function() {
+      return this.num.length;
+    },
+
+    multiply: function(e) {
+
+      var num = new Array(this.getLength() + e.getLength() - 1);
+
+      for (var i = 0; i < this.getLength(); i++) {
+        for (var j = 0; j < e.getLength(); j++) {
+          num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
+        }
+      }
+
+      return new QRPolynomial(num, 0);
+    },
+
+    mod: function(e) {
+
+      if (this.getLength() - e.getLength() < 0) {
+        return this;
+      }
+
+      var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));
+
+      var num = new Array(this.getLength());
+
+      for (var i = 0; i < this.getLength(); i++) {
+        num[i] = this.get(i);
+      }
+
+      for (var i = 0; i < e.getLength(); i++) {
+        num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
+      }
+
+      // recursive call
+      return new QRPolynomial(num, 0).mod(e);
+    }
+  };
+
+  //---------------------------------------------------------------------
+  // QRRSBlock
+  //---------------------------------------------------------------------
+
+  function QRRSBlock(totalCount, dataCount) {
+    this.totalCount = totalCount;
+    this.dataCount = dataCount;
+  }
+
+  QRRSBlock.RS_BLOCK_TABLE = [
+
+    // L
+    // M
+    // Q
+    // H
+
+    // 1
+    [1, 26, 19],
+    [1, 26, 16],
+    [1, 26, 13],
+    [1, 26, 9],
+
+    // 2
+    [1, 44, 34],
+    [1, 44, 28],
+    [1, 44, 22],
+    [1, 44, 16],
+
+    // 3
+    [1, 70, 55],
+    [1, 70, 44],
+    [2, 35, 17],
+    [2, 35, 13],
+
+    // 4		
+    [1, 100, 80],
+    [2, 50, 32],
+    [2, 50, 24],
+    [4, 25, 9],
+
+    // 5
+    [1, 134, 108],
+    [2, 67, 43],
+    [2, 33, 15, 2, 34, 16],
+    [2, 33, 11, 2, 34, 12],
+
+    // 6
+    [2, 86, 68],
+    [4, 43, 27],
+    [4, 43, 19],
+    [4, 43, 15],
+
+    // 7		
+    [2, 98, 78],
+    [4, 49, 31],
+    [2, 32, 14, 4, 33, 15],
+    [4, 39, 13, 1, 40, 14],
+
+    // 8
+    [2, 121, 97],
+    [2, 60, 38, 2, 61, 39],
+    [4, 40, 18, 2, 41, 19],
+    [4, 40, 14, 2, 41, 15],
+
+    // 9
+    [2, 146, 116],
+    [3, 58, 36, 2, 59, 37],
+    [4, 36, 16, 4, 37, 17],
+    [4, 36, 12, 4, 37, 13],
+
+    // 10		
+    [2, 86, 68, 2, 87, 69],
+    [4, 69, 43, 1, 70, 44],
+    [6, 43, 19, 2, 44, 20],
+    [6, 43, 15, 2, 44, 16],
+
+    // 11
+    [4, 101, 81],
+    [1, 80, 50, 4, 81, 51],
+    [4, 50, 22, 4, 51, 23],
+    [3, 36, 12, 8, 37, 13],
+
+    // 12
+    [2, 116, 92, 2, 117, 93],
+    [6, 58, 36, 2, 59, 37],
+    [4, 46, 20, 6, 47, 21],
+    [7, 42, 14, 4, 43, 15],
+
+    // 13
+    [4, 133, 107],
+    [8, 59, 37, 1, 60, 38],
+    [8, 44, 20, 4, 45, 21],
+    [12, 33, 11, 4, 34, 12],
+
+    // 14
+    [3, 145, 115, 1, 146, 116],
+    [4, 64, 40, 5, 65, 41],
+    [11, 36, 16, 5, 37, 17],
+    [11, 36, 12, 5, 37, 13],
+
+    // 15
+    [5, 109, 87, 1, 110, 88],
+    [5, 65, 41, 5, 66, 42],
+    [5, 54, 24, 7, 55, 25],
+    [11, 36, 12],
+
+    // 16
+    [5, 122, 98, 1, 123, 99],
+    [7, 73, 45, 3, 74, 46],
+    [15, 43, 19, 2, 44, 20],
+    [3, 45, 15, 13, 46, 16],
+
+    // 17
+    [1, 135, 107, 5, 136, 108],
+    [10, 74, 46, 1, 75, 47],
+    [1, 50, 22, 15, 51, 23],
+    [2, 42, 14, 17, 43, 15],
+
+    // 18
+    [5, 150, 120, 1, 151, 121],
+    [9, 69, 43, 4, 70, 44],
+    [17, 50, 22, 1, 51, 23],
+    [2, 42, 14, 19, 43, 15],
+
+    // 19
+    [3, 141, 113, 4, 142, 114],
+    [3, 70, 44, 11, 71, 45],
+    [17, 47, 21, 4, 48, 22],
+    [9, 39, 13, 16, 40, 14],
+
+    // 20
+    [3, 135, 107, 5, 136, 108],
+    [3, 67, 41, 13, 68, 42],
+    [15, 54, 24, 5, 55, 25],
+    [15, 43, 15, 10, 44, 16],
+
+    // 21
+    [4, 144, 116, 4, 145, 117],
+    [17, 68, 42],
+    [17, 50, 22, 6, 51, 23],
+    [19, 46, 16, 6, 47, 17],
+
+    // 22
+    [2, 139, 111, 7, 140, 112],
+    [17, 74, 46],
+    [7, 54, 24, 16, 55, 25],
+    [34, 37, 13],
+
+    // 23
+    [4, 151, 121, 5, 152, 122],
+    [4, 75, 47, 14, 76, 48],
+    [11, 54, 24, 14, 55, 25],
+    [16, 45, 15, 14, 46, 16],
+
+    // 24
+    [6, 147, 117, 4, 148, 118],
+    [6, 73, 45, 14, 74, 46],
+    [11, 54, 24, 16, 55, 25],
+    [30, 46, 16, 2, 47, 17],
+
+    // 25
+    [8, 132, 106, 4, 133, 107],
+    [8, 75, 47, 13, 76, 48],
+    [7, 54, 24, 22, 55, 25],
+    [22, 45, 15, 13, 46, 16],
+
+    // 26
+    [10, 142, 114, 2, 143, 115],
+    [19, 74, 46, 4, 75, 47],
+    [28, 50, 22, 6, 51, 23],
+    [33, 46, 16, 4, 47, 17],
+
+    // 27
+    [8, 152, 122, 4, 153, 123],
+    [22, 73, 45, 3, 74, 46],
+    [8, 53, 23, 26, 54, 24],
+    [12, 45, 15, 28, 46, 16],
+
+    // 28
+    [3, 147, 117, 10, 148, 118],
+    [3, 73, 45, 23, 74, 46],
+    [4, 54, 24, 31, 55, 25],
+    [11, 45, 15, 31, 46, 16],
+
+    // 29
+    [7, 146, 116, 7, 147, 117],
+    [21, 73, 45, 7, 74, 46],
+    [1, 53, 23, 37, 54, 24],
+    [19, 45, 15, 26, 46, 16],
+
+    // 30
+    [5, 145, 115, 10, 146, 116],
+    [19, 75, 47, 10, 76, 48],
+    [15, 54, 24, 25, 55, 25],
+    [23, 45, 15, 25, 46, 16],
+
+    // 31
+    [13, 145, 115, 3, 146, 116],
+    [2, 74, 46, 29, 75, 47],
+    [42, 54, 24, 1, 55, 25],
+    [23, 45, 15, 28, 46, 16],
+
+    // 32
+    [17, 145, 115],
+    [10, 74, 46, 23, 75, 47],
+    [10, 54, 24, 35, 55, 25],
+    [19, 45, 15, 35, 46, 16],
+
+    // 33
+    [17, 145, 115, 1, 146, 116],
+    [14, 74, 46, 21, 75, 47],
+    [29, 54, 24, 19, 55, 25],
+    [11, 45, 15, 46, 46, 16],
+
+    // 34
+    [13, 145, 115, 6, 146, 116],
+    [14, 74, 46, 23, 75, 47],
+    [44, 54, 24, 7, 55, 25],
+    [59, 46, 16, 1, 47, 17],
+
+    // 35
+    [12, 151, 121, 7, 152, 122],
+    [12, 75, 47, 26, 76, 48],
+    [39, 54, 24, 14, 55, 25],
+    [22, 45, 15, 41, 46, 16],
+
+    // 36
+    [6, 151, 121, 14, 152, 122],
+    [6, 75, 47, 34, 76, 48],
+    [46, 54, 24, 10, 55, 25],
+    [2, 45, 15, 64, 46, 16],
+
+    // 37
+    [17, 152, 122, 4, 153, 123],
+    [29, 74, 46, 14, 75, 47],
+    [49, 54, 24, 10, 55, 25],
+    [24, 45, 15, 46, 46, 16],
+
+    // 38
+    [4, 152, 122, 18, 153, 123],
+    [13, 74, 46, 32, 75, 47],
+    [48, 54, 24, 14, 55, 25],
+    [42, 45, 15, 32, 46, 16],
+
+    // 39
+    [20, 147, 117, 4, 148, 118],
+    [40, 75, 47, 7, 76, 48],
+    [43, 54, 24, 22, 55, 25],
+    [10, 45, 15, 67, 46, 16],
+
+    // 40
+    [19, 148, 118, 6, 149, 119],
+    [18, 75, 47, 31, 76, 48],
+    [34, 54, 24, 34, 55, 25],
+    [20, 45, 15, 61, 46, 16]
+  ];
+
+  QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {
+
+    var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
+
+    if (rsBlock == undefined) {
+      throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" +
+        errorCorrectLevel);
+    }
+
+    var length = rsBlock.length / 3;
+
+    var list = new Array();
+
+    for (var i = 0; i < length; i++) {
+
+      var count = rsBlock[i * 3 + 0];
+      var totalCount = rsBlock[i * 3 + 1];
+      var dataCount = rsBlock[i * 3 + 2];
+
+      for (var j = 0; j < count; j++) {
+        list.push(new QRRSBlock(totalCount, dataCount));
+      }
+    }
+
+    return list;
+  }
+
+  QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {
+
+    switch (errorCorrectLevel) {
+      case QRErrorCorrectLevel.L:
+        return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
+      case QRErrorCorrectLevel.M:
+        return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
+      case QRErrorCorrectLevel.Q:
+        return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
+      case QRErrorCorrectLevel.H:
+        return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
+      default:
+        return undefined;
+    }
+  }
+
+  //---------------------------------------------------------------------
+  // QRBitBuffer
+  //---------------------------------------------------------------------
+
+  function QRBitBuffer() {
+    this.buffer = new Array();
+    this.length = 0;
+  }
+
+  QRBitBuffer.prototype = {
+
+    get: function(index) {
+      var bufIndex = Math.floor(index / 8);
+      return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1;
+    },
+
+    put: function(num, length) {
+      for (var i = 0; i < length; i++) {
+        this.putBit(((num >>> (length - i - 1)) & 1) == 1);
+      }
+    },
+
+    getLengthInBits: function() {
+      return this.length;
+    },
+
+    putBit: function(bit) {
+
+      var bufIndex = Math.floor(this.length / 8);
+      if (this.buffer.length <= bufIndex) {
+        this.buffer.push(0);
+      }
+
+      if (bit) {
+        this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
+      }
+
+      this.length++;
+    }
+  };
+
+  //---------------------------------------------------------------------
+  // Support Chinese
+  //---------------------------------------------------------------------
+  function utf16To8(text) {
+    var result = '';
+    var c;
+    for (var i = 0; i < text.length; i++) {
+      c = text.charCodeAt(i);
+      if (c >= 0x0001 && c <= 0x007F) {
+        result += text.charAt(i);
+      } else if (c > 0x07FF) {
+        result += String.fromCharCode(0xE0 | c >> 12 & 0x0F);
+        result += String.fromCharCode(0x80 | c >> 6 & 0x3F);
+        result += String.fromCharCode(0x80 | c >> 0 & 0x3F);
+      } else {
+        result += String.fromCharCode(0xC0 | c >> 6 & 0x1F);
+        result += String.fromCharCode(0x80 | c >> 0 & 0x3F);
+      }
+    }
+    return result;
+  }
+
+  uQRCode = {
+    errorCorrectLevel: QRErrorCorrectLevel,
+
+    defaults: {
+      size: 354,
+      margin: 0,
+      backgroundColor: '#FFFFFF',
+      foregroundColor: '#000000',
+      fileType: 'png', // 'jpg', 'png'
+      errorCorrectLevel: QRErrorCorrectLevel.H,
+      typeNumber: -1
+    },
+
+    getModules: function(options) {
+      // options = Object.assign(this.defaults, options); // 不能用Object.assign,它会导致uQRCode.defaults被污染
+      options = {
+        ...this.defaults,
+        ...options
+      };
+      var qrcode = new QRCode(options.typeNumber, options.errorCorrectLevel);
+      qrcode.addData(utf16To8(options.text));
+      qrcode.make();
+      return qrcode.modules;
+    }
+
+  }
+
+})();
+
+export default uQRCode;

+ 241 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/bridge/bridge-weex.js

@@ -0,0 +1,241 @@
+const isWeex = typeof WXEnvironment !== 'undefined';
+const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform);
+const isWeexAndroid = isWeex && !isWeexIOS;
+
+import GLmethod from '../context-webgl/GLmethod';
+
+const GCanvasModule =
+    (typeof weex !== 'undefined' && weex.requireModule) ? (weex.requireModule('gcanvas')) :
+        (typeof __weex_require__ !== 'undefined') ? (__weex_require__('@weex-module/gcanvas')) : {};
+
+let isDebugging = false;
+
+let isComboDisabled = false;
+
+const logCommand = (function () {
+    const methodQuery = [];
+    Object.keys(GLmethod).forEach(key => {
+        methodQuery[GLmethod[key]] = key;
+    })
+    const queryMethod = (id) => {
+        return methodQuery[parseInt(id)] || 'NotFoundMethod';
+    }
+    const logCommand = (id, cmds) => {
+        const mId = cmds.split(',')[0];
+        const mName = queryMethod(mId);
+        console.log(`=== callNative - componentId:${id}; method: ${mName}; cmds: ${cmds}`);
+    }
+    return logCommand;
+})();
+
+function joinArray(arr, sep) {
+    let res = '';
+    for (let i = 0; i < arr.length; i++) {
+        if (i !== 0) {
+            res += sep;
+        }
+        res += arr[i];
+    }
+    return res;
+}
+
+const commandsCache = {}
+
+const GBridge = {
+
+    callEnable: (ref, configArray) => {
+
+        commandsCache[ref] = [];
+
+        return GCanvasModule.enable({
+            componentId: ref,
+            config: configArray
+        });
+    },
+
+    callEnableDebug: () => {
+        isDebugging = true;
+    },
+
+    callEnableDisableCombo: () => {
+        isComboDisabled = true;
+    },
+
+    callSetContextType: function (componentId, context_type) {
+        GCanvasModule.setContextType(context_type, componentId);
+    },
+
+    callReset: function(id){
+        GCanvasModule.resetComponent && canvasModule.resetComponent(componentId);
+    },
+
+    render: isWeexIOS ? function (componentId) {
+        return GCanvasModule.extendCallNative({
+            contextId: componentId,
+            type: 0x60000001
+        });
+    } : function (componentId) {
+        return callGCanvasLinkNative(componentId, 0x60000001, 'render');
+    },
+
+    render2d: isWeexIOS ? function (componentId, commands, callback) {
+
+        if (isDebugging) {
+            console.log('>>> >>> render2d ===');
+            console.log('>>> commands: ' + commands);
+        }
+		
+        GCanvasModule.render([commands, callback?true:false], componentId, callback);
+
+    } : function (componentId, commands,callback) {
+
+        if (isDebugging) {
+            console.log('>>> >>> render2d ===');
+            console.log('>>> commands: ' + commands);
+        }
+
+        callGCanvasLinkNative(componentId, 0x20000001, commands);
+		if(callback){
+		callback();
+		}
+    },
+
+    callExtendCallNative: isWeexIOS ? function (componentId, cmdArgs) {
+
+        throw 'should not be here anymore ' + cmdArgs;
+
+    } : function (componentId, cmdArgs) {
+
+        throw 'should not be here anymore ' + cmdArgs;
+
+    },
+
+
+    flushNative: isWeexIOS ? function (componentId) {
+
+        const cmdArgs = joinArray(commandsCache[componentId], ';');
+        commandsCache[componentId] = [];
+
+        if (isDebugging) {
+            console.log('>>> >>> flush native ===');
+            console.log('>>> commands: ' + cmdArgs);
+        }
+
+        const result = GCanvasModule.extendCallNative({
+            "contextId": componentId,
+            "type": 0x60000000,
+            "args": cmdArgs
+        });
+
+        const res = result && result.result;
+
+        if (isDebugging) {
+            console.log('>>> result: ' + res);
+        }
+
+        return res;
+
+    } : function (componentId) {
+
+        const cmdArgs = joinArray(commandsCache[componentId], ';');
+        commandsCache[componentId] = [];
+
+        if (isDebugging) {
+            console.log('>>> >>> flush native ===');
+            console.log('>>> commands: ' + cmdArgs);
+        }
+
+        const result = callGCanvasLinkNative(componentId, 0x60000000, cmdArgs);
+
+        if (isDebugging) {
+            console.log('>>> result: ' + result);
+        }
+
+        return result;
+    },
+
+    callNative: function (componentId, cmdArgs, cache) {
+
+        if (isDebugging) {
+            logCommand(componentId, cmdArgs);
+        }
+
+        commandsCache[componentId].push(cmdArgs);
+
+        if (!cache || isComboDisabled) {
+            return GBridge.flushNative(componentId);
+        } else {
+            return undefined;
+        }
+    },
+
+    texImage2D(componentId, ...args) {
+        if (isWeexIOS) {
+            if (args.length === 6) {
+                const [target, level, internalformat, format, type, image] = args;
+                GBridge.callNative(
+                    componentId,
+                    GLmethod.texImage2D + ',' + 6 + ',' + target + ',' + level + ',' + internalformat + ',' + format + ',' + type + ',' + image.src
+                )
+            } else if (args.length === 9) {
+                const [target, level, internalformat, width, height, border, format, type, image] = args;
+                GBridge.callNative(
+                    componentId,
+                    GLmethod.texImage2D + ',' + 9 + ',' + target + ',' + level + ',' + internalformat + ',' + width + ',' + height + ',' + border + ',' +
+                    + format + ',' + type + ',' + (image ? image.src : 0)
+                )
+            }
+        } else if (isWeexAndroid) {
+            if (args.length === 6) {
+                const [target, level, internalformat, format, type, image] = args;
+                GCanvasModule.texImage2D(componentId, target, level, internalformat, format, type, image.src);
+            } else if (args.length === 9) {
+                const [target, level, internalformat, width, height, border, format, type, image] = args;
+                GCanvasModule.texImage2D(componentId, target, level, internalformat, width, height, border, format, type, (image ? image.src : 0));
+            }
+        }
+    },
+
+    texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image) {
+        if (isWeexIOS) {
+            if (arguments.length === 8) {
+                GBridge.callNative(
+                    componentId,
+                    GLmethod.texSubImage2D + ',' + 6 + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset, + ',' + format + ',' + type + ',' + image.src
+                )
+            }
+        } else if (isWeexAndroid) {
+            GCanvasModule.texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image.src);
+        }
+    },
+
+    bindImageTexture(componentId, src, imageId) {
+        GCanvasModule.bindImageTexture([src, imageId], componentId);
+    },
+
+    perloadImage([url, id], callback) {
+        GCanvasModule.preLoadImage([url, id], function (image) {
+            image.url = url;
+            image.id = id;
+            callback(image);
+        });
+    },
+	
+	measureText(text, fontStyle, componentId) {
+	    return GCanvasModule.measureText([text, fontStyle], componentId);
+	},
+	
+	getImageData (componentId, x, y, w, h, callback) {
+		GCanvasModule.getImageData([x, y,w,h],componentId,callback);
+	},
+	
+	putImageData (componentId, data, x, y, w, h, callback) {
+		GCanvasModule.putImageData([x, y,w,h,data],componentId,callback);
+	},
+	
+	toTempFilePath(componentId, x, y, width, height, destWidth, destHeight, fileType, quality, callback){ 
+		GCanvasModule.toTempFilePath([x, y, width,height, destWidth, destHeight, fileType, quality], componentId, callback);
+	}
+}
+
+export default GBridge;

+ 18 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/FillStyleLinearGradient.js

@@ -0,0 +1,18 @@
+class FillStyleLinearGradient {
+
+    constructor(x0, y0, x1, y1) {
+        this._start_pos = { _x: x0, _y: y0 };
+        this._end_pos = { _x: x1, _y: y1 };
+        this._stop_count = 0;
+        this._stops = [0, 0, 0, 0, 0];
+    }
+
+    addColorStop = function (pos, color) {
+        if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
+            this._stops[this._stop_count] = { _pos: pos, _color: color };
+            this._stop_count++;
+        }
+    }
+}
+
+export default FillStyleLinearGradient;

+ 8 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/FillStylePattern.js

@@ -0,0 +1,8 @@
+class FillStylePattern {
+    constructor(img, pattern) {
+        this._style = pattern;
+        this._img = img;
+    }
+}
+
+export default FillStylePattern;

+ 17 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/FillStyleRadialGradient.js

@@ -0,0 +1,17 @@
+class FillStyleRadialGradient {
+    constructor(x0, y0, r0, x1, y1, r1) {
+        this._start_pos = { _x: x0, _y: y0, _r: r0 };
+        this._end_pos = { _x: x1, _y: y1, _r: r1 };
+        this._stop_count = 0;
+        this._stops = [0, 0, 0, 0, 0];
+    }
+
+    addColorStop(pos, color) {
+        if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
+            this._stops[this._stop_count] = { _pos: pos, _color: color };
+            this._stop_count++;
+        }
+    }
+}
+
+export default FillStyleRadialGradient;

+ 666 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-2d/RenderingContext.js

@@ -0,0 +1,666 @@
+import FillStylePattern from './FillStylePattern';
+import FillStyleLinearGradient from './FillStyleLinearGradient';
+import FillStyleRadialGradient from './FillStyleRadialGradient';
+import GImage from '../env/image.js';
+import {
+	ArrayBufferToBase64,
+	Base64ToUint8ClampedArray
+} from '../env/tool.js';
+
+export default class CanvasRenderingContext2D {
+
+	_drawCommands = '';
+
+	_globalAlpha = 1.0;
+
+	_fillStyle = 'rgb(0,0,0)';
+	_strokeStyle = 'rgb(0,0,0)';
+
+	_lineWidth = 1;
+	_lineCap = 'butt';
+	_lineJoin = 'miter';
+
+	_miterLimit = 10;
+
+	_globalCompositeOperation = 'source-over';
+
+	_textAlign = 'start';
+	_textBaseline = 'alphabetic';
+
+	_font = '10px sans-serif';
+
+	_savedGlobalAlpha = [];
+
+	timer = null;
+	componentId = null;
+
+	_notCommitDrawImageCache = [];
+	_needRedrawImageCache = [];
+	_redrawCommands = '';
+	_autoSaveContext = true;
+	// _imageMap = new GHashMap();
+	// _textureMap = new GHashMap();
+
+	constructor() {
+		this.className = 'CanvasRenderingContext2D';
+		//this.save()
+	}
+
+	setFillStyle(value) {
+		this.fillStyle = value;
+	}
+
+	set fillStyle(value) {
+		this._fillStyle = value;
+
+		if (typeof(value) == 'string') {
+			this._drawCommands = this._drawCommands.concat("F" + value + ";");
+		} else if (value instanceof FillStylePattern) {
+			const image = value._img;
+			if (!image.complete) {
+				image.onload = () => {
+					var index = this._needRedrawImageCache.indexOf(image);
+					if (index > -1) {
+						this._needRedrawImageCache.splice(index, 1);
+						CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id);
+						this._redrawflush(true);
+					}
+				}
+				this._notCommitDrawImageCache.push(image);
+			} else {
+				CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id);
+			}
+
+			//CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id);
+			this._drawCommands = this._drawCommands.concat("G" + image._id + "," + value._style + ";");
+		} else if (value instanceof FillStyleLinearGradient) {
+			var command = "D" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," +
+				value._end_pos._x.toFixed(2) + "," + value._end_pos._y.toFixed(2) + "," +
+				value._stop_count;
+			for (var i = 0; i < value._stop_count; ++i) {
+				command += ("," + value._stops[i]._pos + "," + value._stops[i]._color);
+			}
+			this._drawCommands = this._drawCommands.concat(command + ";");
+		} else if (value instanceof FillStyleRadialGradient) {
+			var command = "H" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," + value._start_pos._r
+				.toFixed(2) + "," +
+				value._end_pos._x.toFixed(2) + "," + value._end_pos._y.toFixed(2) + "," + value._end_pos._r.toFixed(2) + "," +
+				value._stop_count;
+			for (var i = 0; i < value._stop_count; ++i) {
+				command += ("," + value._stops[i]._pos + "," + value._stops[i]._color);
+			}
+			this._drawCommands = this._drawCommands.concat(command + ";");
+		}
+	}
+
+	get fillStyle() {
+		return this._fillStyle;
+	}
+
+	get globalAlpha() {
+		return this._globalAlpha;
+	}
+
+	setGlobalAlpha(value) {
+		this.globalAlpha = value;
+	}
+
+	set globalAlpha(value) {
+		this._globalAlpha = value;
+		this._drawCommands = this._drawCommands.concat("a" + value.toFixed(2) + ";");
+	}
+
+
+	get strokeStyle() {
+		return this._strokeStyle;
+	}
+
+	setStrokeStyle(value) {
+		this.strokeStyle = value;
+	}
+
+	set strokeStyle(value) {
+
+		this._strokeStyle = value;
+
+		if (typeof(value) == 'string') {
+			this._drawCommands = this._drawCommands.concat("S" + value + ";");
+		} else if (value instanceof FillStylePattern) {
+			CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id);
+			this._drawCommands = this._drawCommands.concat("G" + image._id + "," + value._style + ";");
+		} else if (value instanceof FillStyleLinearGradient) {
+			var command = "D" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," +
+				value._end_pos._x.toFixed(2) + "," + value._end_pos._y.toFixed(2) + "," +
+				value._stop_count;
+
+			for (var i = 0; i < value._stop_count; ++i) {
+				command += ("," + value._stops[i]._pos + "," + value._stops[i]._color);
+			}
+			this._drawCommands = this._drawCommands.concat(command + ";");
+		} else if (value instanceof FillStyleRadialGradient) {
+			var command = "H" + value._start_pos._x.toFixed(2) + "," + value._start_pos._y.toFixed(2) + "," + value._start_pos._r
+				.toFixed(2) + "," +
+				value._end_pos._x.toFixed(2) + "," + value._end_pos._y + ",".toFixed(2) + value._end_pos._r.toFixed(2) + "," +
+				value._stop_count;
+
+			for (var i = 0; i < value._stop_count; ++i) {
+				command += ("," + value._stops[i]._pos + "," + value._stops[i]._color);
+			}
+			this._drawCommands = this._drawCommands.concat(command + ";");
+		}
+	}
+
+	get lineWidth() {
+		return this._lineWidth;
+	}
+
+	setLineWidth(value) {
+		this.lineWidth = value;
+	}
+
+	set lineWidth(value) {
+		this._lineWidth = value;
+		this._drawCommands = this._drawCommands.concat("W" + value + ";");
+	}
+
+	get lineCap() {
+		return this._lineCap;
+	}
+
+	setLineCap(value) {
+		this.lineCap = value;
+	}
+
+	set lineCap(value) {
+		this._lineCap = value;
+		this._drawCommands = this._drawCommands.concat("C" + value + ";");
+	}
+
+	get lineJoin() {
+		return this._lineJoin;
+	}
+
+	setLineJoin(value) {
+		this.lineJoin = value
+	}
+
+	set lineJoin(value) {
+		this._lineJoin = value;
+		this._drawCommands = this._drawCommands.concat("J" + value + ";");
+	}
+
+	get miterLimit() {
+		return this._miterLimit;
+	}
+
+	setMiterLimit(value) {
+		this.miterLimit = value
+	}
+
+	set miterLimit(value) {
+		this._miterLimit = value;
+		this._drawCommands = this._drawCommands.concat("M" + value + ";");
+	}
+
+	get globalCompositeOperation() {
+		return this._globalCompositeOperation;
+	}
+
+	set globalCompositeOperation(value) {
+
+		this._globalCompositeOperation = value;
+		let mode = 0;
+		switch (value) {
+			case "source-over":
+				mode = 0;
+				break;
+			case "source-atop":
+				mode = 5;
+				break;
+			case "source-in":
+				mode = 0;
+				break;
+			case "source-out":
+				mode = 2;
+				break;
+			case "destination-over":
+				mode = 4;
+				break;
+			case "destination-atop":
+				mode = 4;
+				break;
+			case "destination-in":
+				mode = 4;
+				break;
+			case "destination-out":
+				mode = 3;
+				break;
+			case "lighter":
+				mode = 1;
+				break;
+			case "copy":
+				mode = 2;
+				break;
+			case "xor":
+				mode = 6;
+				break;
+			default:
+				mode = 0;
+		}
+
+		this._drawCommands = this._drawCommands.concat("B" + mode + ";");
+	}
+
+	get textAlign() {
+		return this._textAlign;
+	}
+
+	setTextAlign(value) {
+		this.textAlign = value
+	}
+
+	set textAlign(value) {
+
+		this._textAlign = value;
+		let Align = 0;
+		switch (value) {
+			case "start":
+				Align = 0;
+				break;
+			case "end":
+				Align = 1;
+				break;
+			case "left":
+				Align = 2;
+				break;
+			case "center":
+				Align = 3;
+				break;
+			case "right":
+				Align = 4;
+				break;
+			default:
+				Align = 0;
+		}
+
+		this._drawCommands = this._drawCommands.concat("A" + Align + ";");
+	}
+
+	get textBaseline() {
+		return this._textBaseline;
+	}
+
+	setTextBaseline(value) {
+		this.textBaseline = value
+	}
+
+	set textBaseline(value) {
+		this._textBaseline = value;
+		let baseline = 0;
+		switch (value) {
+			case "alphabetic":
+				baseline = 0;
+				break;
+			case "middle":
+				baseline = 1;
+				break;
+			case "top":
+				baseline = 2;
+				break;
+			case "hanging":
+				baseline = 3;
+				break;
+			case "bottom":
+				baseline = 4;
+				break;
+			case "ideographic":
+				baseline = 5;
+				break;
+			default:
+				baseline = 0;
+				break;
+		}
+
+		this._drawCommands = this._drawCommands.concat("E" + baseline + ";");
+	}
+
+	get font() {
+		return this._font;
+	}
+
+	setFontSize(size) {
+		var str = this._font;
+		var strs = str.trim().split(/\s+/);
+		for (var i = 0; i < strs.length; i++) {
+			var values = ["normal", "italic", "oblique", "normal", "small-caps", "normal", "bold",
+				"bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900",
+				"normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed",
+				"semi-expanded", "expanded", "extra-expanded", "ultra-expanded"
+			];
+
+			if (-1 == values.indexOf(strs[i].trim())) {
+				if (typeof size === 'string') {
+					strs[i] = size;
+				} else if (typeof size === 'number') {
+					strs[i] = String(size) + 'px';
+				}
+				break;
+			}
+		}
+		this.font = strs.join(" ");
+	}
+
+	set font(value) {
+		this._font = value;
+		this._drawCommands = this._drawCommands.concat("j" + value + ";");
+	}
+
+	setTransform(a, b, c, d, tx, ty) {
+		this._drawCommands = this._drawCommands.concat("t" +
+			(a === 1 ? "1" : a.toFixed(2)) + "," +
+			(b === 0 ? "0" : b.toFixed(2)) + "," +
+			(c === 0 ? "0" : c.toFixed(2)) + "," +
+			(d === 1 ? "1" : d.toFixed(2)) + "," + tx.toFixed(2) + "," + ty.toFixed(2) + ";");
+	}
+
+	transform(a, b, c, d, tx, ty) {
+		this._drawCommands = this._drawCommands.concat("f" +
+			(a === 1 ? "1" : a.toFixed(2)) + "," +
+			(b === 0 ? "0" : b.toFixed(2)) + "," +
+			(c === 0 ? "0" : c.toFixed(2)) + "," +
+			(d === 1 ? "1" : d.toFixed(2)) + "," + tx + "," + ty + ";");
+	}
+
+	resetTransform() {
+		this._drawCommands = this._drawCommands.concat("m;");
+	}
+
+	scale(a, d) {
+		this._drawCommands = this._drawCommands.concat("k" + a.toFixed(2) + "," +
+			d.toFixed(2) + ";");
+	}
+
+	rotate(angle) {
+		this._drawCommands = this._drawCommands
+			.concat("r" + angle.toFixed(6) + ";");
+	}
+
+	translate(tx, ty) {
+		this._drawCommands = this._drawCommands.concat("l" + tx.toFixed(2) + "," + ty.toFixed(2) + ";");
+	}
+
+	save() {
+		this._savedGlobalAlpha.push(this._globalAlpha);
+		this._drawCommands = this._drawCommands.concat("v;");
+	}
+
+	restore() {
+		this._drawCommands = this._drawCommands.concat("e;");
+		this._globalAlpha = this._savedGlobalAlpha.pop();
+	}
+
+	createPattern(img, pattern) {
+		if (typeof img === 'string') {
+			var imgObj = new GImage();
+			imgObj.src = img;
+			img = imgObj;
+		}
+		return new FillStylePattern(img, pattern);
+	}
+
+	createLinearGradient(x0, y0, x1, y1) {
+		return new FillStyleLinearGradient(x0, y0, x1, y1);
+	}
+
+	createRadialGradient = function(x0, y0, r0, x1, y1, r1) {
+		return new FillStyleRadialGradient(x0, y0, r0, x1, y1, r1);
+	};
+
+	createCircularGradient = function(x0, y0, r0) {
+		return new FillStyleRadialGradient(x0, y0, 0, x0, y0, r0);
+	};
+
+	strokeRect(x, y, w, h) {
+		this._drawCommands = this._drawCommands.concat("s" + x + "," + y + "," + w + "," + h + ";");
+	}
+
+
+	clearRect(x, y, w, h) {
+		this._drawCommands = this._drawCommands.concat("c" + x + "," + y + "," + w +
+			"," + h + ";");
+	}
+
+	clip() {
+		this._drawCommands = this._drawCommands.concat("p;");
+	}
+
+	resetClip() {
+		this._drawCommands = this._drawCommands.concat("q;");
+	}
+
+	closePath() {
+		this._drawCommands = this._drawCommands.concat("o;");
+	}
+
+	moveTo(x, y) {
+		this._drawCommands = this._drawCommands.concat("g" + x.toFixed(2) + "," + y.toFixed(2) + ";");
+	}
+
+	lineTo(x, y) {
+		this._drawCommands = this._drawCommands.concat("i" + x.toFixed(2) + "," + y.toFixed(2) + ";");
+	}
+
+	quadraticCurveTo = function(cpx, cpy, x, y) {
+		this._drawCommands = this._drawCommands.concat("u" + cpx + "," + cpy + "," + x + "," + y + ";");
+	}
+
+	bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, ) {
+		this._drawCommands = this._drawCommands.concat(
+			"z" + cp1x.toFixed(2) + "," + cp1y.toFixed(2) + "," + cp2x.toFixed(2) + "," + cp2y.toFixed(2) + "," +
+			x.toFixed(2) + "," + y.toFixed(2) + ";");
+	}
+
+	arcTo(x1, y1, x2, y2, radius) {
+		this._drawCommands = this._drawCommands.concat("h" + x1 + "," + y1 + "," + x2 + "," + y2 + "," + radius + ";");
+	}
+
+	beginPath() {
+		this._drawCommands = this._drawCommands.concat("b;");
+	}
+
+
+	fillRect(x, y, w, h) {
+		this._drawCommands = this._drawCommands.concat("n" + x + "," + y + "," + w +
+			"," + h + ";");
+	}
+
+	rect(x, y, w, h) {
+		this._drawCommands = this._drawCommands.concat("w" + x + "," + y + "," + w + "," + h + ";");
+	}
+
+	fill() {
+		this._drawCommands = this._drawCommands.concat("L;");
+	}
+
+	stroke(path) {
+		this._drawCommands = this._drawCommands.concat("x;");
+	}
+
+	arc(x, y, radius, startAngle, endAngle, anticlockwise) {
+
+		let ianticlockwise = 0;
+		if (anticlockwise) {
+			ianticlockwise = 1;
+		}
+
+		this._drawCommands = this._drawCommands.concat(
+			"y" + x.toFixed(2) + "," + y.toFixed(2) + "," +
+			radius.toFixed(2) + "," + startAngle + "," + endAngle + "," + ianticlockwise +
+			";"
+		);
+	}
+
+	fillText(text, x, y) {
+		let tmptext = text.replace(/!/g, "!!");
+		tmptext = tmptext.replace(/,/g, "!,");
+		tmptext = tmptext.replace(/;/g, "!;");
+		this._drawCommands = this._drawCommands.concat("T" + tmptext + "," + x + "," + y + ",0.0;");
+	}
+
+	strokeText = function(text, x, y) {
+		let tmptext = text.replace(/!/g, "!!");
+		tmptext = tmptext.replace(/,/g, "!,");
+		tmptext = tmptext.replace(/;/g, "!;");
+		this._drawCommands = this._drawCommands.concat("U" + tmptext + "," + x + "," + y + ",0.0;");
+	}
+
+	measureText(text) {
+		return CanvasRenderingContext2D.GBridge.measureText(text, this.font, this.componentId);
+	}
+
+	isPointInPath = function(x, y) {
+		throw new Error('GCanvas not supported yet');
+	}
+
+	drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh) {
+		if (typeof image === 'string') {
+			var imgObj = new GImage();
+			imgObj.src = image;
+			image = imgObj;
+		}
+		if (image instanceof GImage) {
+			if (!image.complete) {
+				imgObj.onload = () => {
+					var index = this._needRedrawImageCache.indexOf(image);
+					if (index > -1) {
+						this._needRedrawImageCache.splice(index, 1);
+						CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id);
+						this._redrawflush(true);
+					}
+				}
+				this._notCommitDrawImageCache.push(image);
+			} else {
+				CanvasRenderingContext2D.GBridge.bindImageTexture(this.componentId, image.src, image._id);
+			}
+			var srcArgs = [image, sx, sy, sw, sh, dx, dy, dw, dh];
+			var args = [];
+			for (var arg in srcArgs) {
+				if (typeof(srcArgs[arg]) != 'undefined') {
+					args.push(srcArgs[arg]);
+				}
+			}
+			this.__drawImage.apply(this, args);
+			//this.__drawImage(image,sx, sy, sw, sh, dx, dy, dw, dh);
+		}
+	}
+
+	__drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh) {
+		const numArgs = arguments.length;
+
+		function drawImageCommands() {
+
+			if (numArgs === 3) {
+				const x = parseFloat(sx) || 0.0;
+				const y = parseFloat(sy) || 0.0;
+
+				return ("d" + image._id + ",0,0," +
+					image.width + "," + image.height + "," +
+					x + "," + y + "," + image.width + "," + image.height + ";");
+			} else if (numArgs === 5) {
+				const x = parseFloat(sx) || 0.0;
+				const y = parseFloat(sy) || 0.0;
+				const width = parseInt(sw) || image.width;
+				const height = parseInt(sh) || image.height;
+
+				return ("d" + image._id + ",0,0," +
+					image.width + "," + image.height + "," +
+					x + "," + y + "," + width + "," + height + ";");
+			} else if (numArgs === 9) {
+				sx = parseFloat(sx) || 0.0;
+				sy = parseFloat(sy) || 0.0;
+				sw = parseInt(sw) || image.width;
+				sh = parseInt(sh) || image.height;
+				dx = parseFloat(dx) || 0.0;
+				dy = parseFloat(dy) || 0.0;
+				dw = parseInt(dw) || image.width;
+				dh = parseInt(dh) || image.height;
+
+				return ("d" + image._id + "," +
+					sx + "," + sy + "," + sw + "," + sh + "," +
+					dx + "," + dy + "," + dw + "," + dh + ";");
+			}
+		}
+		this._drawCommands += drawImageCommands();
+	}
+
+	_flush(reserve, callback) {
+		const commands = this._drawCommands;
+		this._drawCommands = '';
+		CanvasRenderingContext2D.GBridge.render2d(this.componentId, commands, callback);
+		this._needRender = false;
+	}
+
+	_redrawflush(reserve, callback) {
+		const commands = this._redrawCommands;
+		CanvasRenderingContext2D.GBridge.render2d(this.componentId, commands, callback);
+		if (this._needRedrawImageCache.length == 0) {
+			this._redrawCommands = '';
+		}
+	}
+
+	draw(reserve, callback) {
+		if (!reserve) {
+			this._globalAlpha = this._savedGlobalAlpha.pop();
+			this._savedGlobalAlpha.push(this._globalAlpha);
+			this._redrawCommands = this._drawCommands;
+			this._needRedrawImageCache = this._notCommitDrawImageCache;
+			if (this._autoSaveContext) {
+				this._drawCommands = ("v;" + this._drawCommands);
+				this._autoSaveContext = false;
+			} else {
+				this._drawCommands = ("e;X;v;" + this._drawCommands);
+			}
+		} else {
+			this._needRedrawImageCache = this._needRedrawImageCache.concat(this._notCommitDrawImageCache);
+			this._redrawCommands += this._drawCommands;
+			if (this._autoSaveContext) {
+				this._drawCommands = ("v;" + this._drawCommands);
+				this._autoSaveContext = false;
+			}
+		}
+		this._notCommitDrawImageCache = [];
+		if (this._flush) {
+			this._flush(reserve, callback);
+		}
+	}
+
+	getImageData(x, y, w, h, callback) {
+		CanvasRenderingContext2D.GBridge.getImageData(this.componentId, x, y, w, h, function(res) {
+			res.data = Base64ToUint8ClampedArray(res.data);
+			if (typeof(callback) == 'function') {
+				callback(res);
+			}
+		});
+	}
+
+	putImageData(data, x, y, w, h, callback) {
+		if (data instanceof Uint8ClampedArray) {
+			data = ArrayBufferToBase64(data);
+			CanvasRenderingContext2D.GBridge.putImageData(this.componentId, data, x, y, w, h, function(res) {
+				if (typeof(callback) == 'function') {
+					callback(res);
+				}
+			});
+		}
+	}
+
+	toTempFilePath(x, y, width, height, destWidth, destHeight, fileType, quality, callback) {
+		CanvasRenderingContext2D.GBridge.toTempFilePath(this.componentId, x, y, width, height, destWidth, destHeight,
+			fileType, quality,
+			function(res) {
+				if (typeof(callback) == 'function') {
+					callback(res);
+				}
+			});
+	}
+}

+ 11 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/ActiveInfo.js

@@ -0,0 +1,11 @@
+export default class WebGLActiveInfo {
+    className = 'WebGLActiveInfo';
+
+    constructor({
+        type, name, size
+    }) {
+        this.type = type;
+        this.name = name;
+        this.size = size;
+    }
+}

+ 21 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Buffer.js

@@ -0,0 +1,21 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLBuffer';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLBuffer {
+    className = name;
+
+    constructor(id) {
+        this.id = id;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 21 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Framebuffer.js

@@ -0,0 +1,21 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLFrameBuffer';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLFramebuffer {
+    className = name;
+
+    constructor(id) {
+        this.id = id;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 298 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/GLenum.js

@@ -0,0 +1,298 @@
+export default {
+    "DEPTH_BUFFER_BIT": 256,
+    "STENCIL_BUFFER_BIT": 1024,
+    "COLOR_BUFFER_BIT": 16384,
+    "POINTS": 0,
+    "LINES": 1,
+    "LINE_LOOP": 2,
+    "LINE_STRIP": 3,
+    "TRIANGLES": 4,
+    "TRIANGLE_STRIP": 5,
+    "TRIANGLE_FAN": 6,
+    "ZERO": 0,
+    "ONE": 1,
+    "SRC_COLOR": 768,
+    "ONE_MINUS_SRC_COLOR": 769,
+    "SRC_ALPHA": 770,
+    "ONE_MINUS_SRC_ALPHA": 771,
+    "DST_ALPHA": 772,
+    "ONE_MINUS_DST_ALPHA": 773,
+    "DST_COLOR": 774,
+    "ONE_MINUS_DST_COLOR": 775,
+    "SRC_ALPHA_SATURATE": 776,
+    "FUNC_ADD": 32774,
+    "BLEND_EQUATION": 32777,
+    "BLEND_EQUATION_RGB": 32777,
+    "BLEND_EQUATION_ALPHA": 34877,
+    "FUNC_SUBTRACT": 32778,
+    "FUNC_REVERSE_SUBTRACT": 32779,
+    "BLEND_DST_RGB": 32968,
+    "BLEND_SRC_RGB": 32969,
+    "BLEND_DST_ALPHA": 32970,
+    "BLEND_SRC_ALPHA": 32971,
+    "CONSTANT_COLOR": 32769,
+    "ONE_MINUS_CONSTANT_COLOR": 32770,
+    "CONSTANT_ALPHA": 32771,
+    "ONE_MINUS_CONSTANT_ALPHA": 32772,
+    "BLEND_COLOR": 32773,
+    "ARRAY_BUFFER": 34962,
+    "ELEMENT_ARRAY_BUFFER": 34963,
+    "ARRAY_BUFFER_BINDING": 34964,
+    "ELEMENT_ARRAY_BUFFER_BINDING": 34965,
+    "STREAM_DRAW": 35040,
+    "STATIC_DRAW": 35044,
+    "DYNAMIC_DRAW": 35048,
+    "BUFFER_SIZE": 34660,
+    "BUFFER_USAGE": 34661,
+    "CURRENT_VERTEX_ATTRIB": 34342,
+    "FRONT": 1028,
+    "BACK": 1029,
+    "FRONT_AND_BACK": 1032,
+    "TEXTURE_2D": 3553,
+    "CULL_FACE": 2884,
+    "BLEND": 3042,
+    "DITHER": 3024,
+    "STENCIL_TEST": 2960,
+    "DEPTH_TEST": 2929,
+    "SCISSOR_TEST": 3089,
+    "POLYGON_OFFSET_FILL": 32823,
+    "SAMPLE_ALPHA_TO_COVERAGE": 32926,
+    "SAMPLE_COVERAGE": 32928,
+    "NO_ERROR": 0,
+    "INVALID_ENUM": 1280,
+    "INVALID_VALUE": 1281,
+    "INVALID_OPERATION": 1282,
+    "OUT_OF_MEMORY": 1285,
+    "CW": 2304,
+    "CCW": 2305,
+    "LINE_WIDTH": 2849,
+    "ALIASED_POINT_SIZE_RANGE": 33901,
+    "ALIASED_LINE_WIDTH_RANGE": 33902,
+    "CULL_FACE_MODE": 2885,
+    "FRONT_FACE": 2886,
+    "DEPTH_RANGE": 2928,
+    "DEPTH_WRITEMASK": 2930,
+    "DEPTH_CLEAR_VALUE": 2931,
+    "DEPTH_FUNC": 2932,
+    "STENCIL_CLEAR_VALUE": 2961,
+    "STENCIL_FUNC": 2962,
+    "STENCIL_FAIL": 2964,
+    "STENCIL_PASS_DEPTH_FAIL": 2965,
+    "STENCIL_PASS_DEPTH_PASS": 2966,
+    "STENCIL_REF": 2967,
+    "STENCIL_VALUE_MASK": 2963,
+    "STENCIL_WRITEMASK": 2968,
+    "STENCIL_BACK_FUNC": 34816,
+    "STENCIL_BACK_FAIL": 34817,
+    "STENCIL_BACK_PASS_DEPTH_FAIL": 34818,
+    "STENCIL_BACK_PASS_DEPTH_PASS": 34819,
+    "STENCIL_BACK_REF": 36003,
+    "STENCIL_BACK_VALUE_MASK": 36004,
+    "STENCIL_BACK_WRITEMASK": 36005,
+    "VIEWPORT": 2978,
+    "SCISSOR_BOX": 3088,
+    "COLOR_CLEAR_VALUE": 3106,
+    "COLOR_WRITEMASK": 3107,
+    "UNPACK_ALIGNMENT": 3317,
+    "PACK_ALIGNMENT": 3333,
+    "MAX_TEXTURE_SIZE": 3379,
+    "MAX_VIEWPORT_DIMS": 3386,
+    "SUBPIXEL_BITS": 3408,
+    "RED_BITS": 3410,
+    "GREEN_BITS": 3411,
+    "BLUE_BITS": 3412,
+    "ALPHA_BITS": 3413,
+    "DEPTH_BITS": 3414,
+    "STENCIL_BITS": 3415,
+    "POLYGON_OFFSET_UNITS": 10752,
+    "POLYGON_OFFSET_FACTOR": 32824,
+    "TEXTURE_BINDING_2D": 32873,
+    "SAMPLE_BUFFERS": 32936,
+    "SAMPLES": 32937,
+    "SAMPLE_COVERAGE_VALUE": 32938,
+    "SAMPLE_COVERAGE_INVERT": 32939,
+    "COMPRESSED_TEXTURE_FORMATS": 34467,
+    "DONT_CARE": 4352,
+    "FASTEST": 4353,
+    "NICEST": 4354,
+    "GENERATE_MIPMAP_HINT": 33170,
+    "BYTE": 5120,
+    "UNSIGNED_BYTE": 5121,
+    "SHORT": 5122,
+    "UNSIGNED_SHORT": 5123,
+    "INT": 5124,
+    "UNSIGNED_INT": 5125,
+    "FLOAT": 5126,
+    "DEPTH_COMPONENT": 6402,
+    "ALPHA": 6406,
+    "RGB": 6407,
+    "RGBA": 6408,
+    "LUMINANCE": 6409,
+    "LUMINANCE_ALPHA": 6410,
+    "UNSIGNED_SHORT_4_4_4_4": 32819,
+    "UNSIGNED_SHORT_5_5_5_1": 32820,
+    "UNSIGNED_SHORT_5_6_5": 33635,
+    "FRAGMENT_SHADER": 35632,
+    "VERTEX_SHADER": 35633,
+    "MAX_VERTEX_ATTRIBS": 34921,
+    "MAX_VERTEX_UNIFORM_VECTORS": 36347,
+    "MAX_VARYING_VECTORS": 36348,
+    "MAX_COMBINED_TEXTURE_IMAGE_UNITS": 35661,
+    "MAX_VERTEX_TEXTURE_IMAGE_UNITS": 35660,
+    "MAX_TEXTURE_IMAGE_UNITS": 34930,
+    "MAX_FRAGMENT_UNIFORM_VECTORS": 36349,
+    "SHADER_TYPE": 35663,
+    "DELETE_STATUS": 35712,
+    "LINK_STATUS": 35714,
+    "VALIDATE_STATUS": 35715,
+    "ATTACHED_SHADERS": 35717,
+    "ACTIVE_UNIFORMS": 35718,
+    "ACTIVE_ATTRIBUTES": 35721,
+    "SHADING_LANGUAGE_VERSION": 35724,
+    "CURRENT_PROGRAM": 35725,
+    "NEVER": 512,
+    "LESS": 513,
+    "EQUAL": 514,
+    "LEQUAL": 515,
+    "GREATER": 516,
+    "NOTEQUAL": 517,
+    "GEQUAL": 518,
+    "ALWAYS": 519,
+    "KEEP": 7680,
+    "REPLACE": 7681,
+    "INCR": 7682,
+    "DECR": 7683,
+    "INVERT": 5386,
+    "INCR_WRAP": 34055,
+    "DECR_WRAP": 34056,
+    "VENDOR": 7936,
+    "RENDERER": 7937,
+    "VERSION": 7938,
+    "NEAREST": 9728,
+    "LINEAR": 9729,
+    "NEAREST_MIPMAP_NEAREST": 9984,
+    "LINEAR_MIPMAP_NEAREST": 9985,
+    "NEAREST_MIPMAP_LINEAR": 9986,
+    "LINEAR_MIPMAP_LINEAR": 9987,
+    "TEXTURE_MAG_FILTER": 10240,
+    "TEXTURE_MIN_FILTER": 10241,
+    "TEXTURE_WRAP_S": 10242,
+    "TEXTURE_WRAP_T": 10243,
+    "TEXTURE": 5890,
+    "TEXTURE_CUBE_MAP": 34067,
+    "TEXTURE_BINDING_CUBE_MAP": 34068,
+    "TEXTURE_CUBE_MAP_POSITIVE_X": 34069,
+    "TEXTURE_CUBE_MAP_NEGATIVE_X": 34070,
+    "TEXTURE_CUBE_MAP_POSITIVE_Y": 34071,
+    "TEXTURE_CUBE_MAP_NEGATIVE_Y": 34072,
+    "TEXTURE_CUBE_MAP_POSITIVE_Z": 34073,
+    "TEXTURE_CUBE_MAP_NEGATIVE_Z": 34074,
+    "MAX_CUBE_MAP_TEXTURE_SIZE": 34076,
+    "TEXTURE0": 33984,
+    "TEXTURE1": 33985,
+    "TEXTURE2": 33986,
+    "TEXTURE3": 33987,
+    "TEXTURE4": 33988,
+    "TEXTURE5": 33989,
+    "TEXTURE6": 33990,
+    "TEXTURE7": 33991,
+    "TEXTURE8": 33992,
+    "TEXTURE9": 33993,
+    "TEXTURE10": 33994,
+    "TEXTURE11": 33995,
+    "TEXTURE12": 33996,
+    "TEXTURE13": 33997,
+    "TEXTURE14": 33998,
+    "TEXTURE15": 33999,
+    "TEXTURE16": 34000,
+    "TEXTURE17": 34001,
+    "TEXTURE18": 34002,
+    "TEXTURE19": 34003,
+    "TEXTURE20": 34004,
+    "TEXTURE21": 34005,
+    "TEXTURE22": 34006,
+    "TEXTURE23": 34007,
+    "TEXTURE24": 34008,
+    "TEXTURE25": 34009,
+    "TEXTURE26": 34010,
+    "TEXTURE27": 34011,
+    "TEXTURE28": 34012,
+    "TEXTURE29": 34013,
+    "TEXTURE30": 34014,
+    "TEXTURE31": 34015,
+    "ACTIVE_TEXTURE": 34016,
+    "REPEAT": 10497,
+    "CLAMP_TO_EDGE": 33071,
+    "MIRRORED_REPEAT": 33648,
+    "FLOAT_VEC2": 35664,
+    "FLOAT_VEC3": 35665,
+    "FLOAT_VEC4": 35666,
+    "INT_VEC2": 35667,
+    "INT_VEC3": 35668,
+    "INT_VEC4": 35669,
+    "BOOL": 35670,
+    "BOOL_VEC2": 35671,
+    "BOOL_VEC3": 35672,
+    "BOOL_VEC4": 35673,
+    "FLOAT_MAT2": 35674,
+    "FLOAT_MAT3": 35675,
+    "FLOAT_MAT4": 35676,
+    "SAMPLER_2D": 35678,
+    "SAMPLER_CUBE": 35680,
+    "VERTEX_ATTRIB_ARRAY_ENABLED": 34338,
+    "VERTEX_ATTRIB_ARRAY_SIZE": 34339,
+    "VERTEX_ATTRIB_ARRAY_STRIDE": 34340,
+    "VERTEX_ATTRIB_ARRAY_TYPE": 34341,
+    "VERTEX_ATTRIB_ARRAY_NORMALIZED": 34922,
+    "VERTEX_ATTRIB_ARRAY_POINTER": 34373,
+    "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING": 34975,
+    "IMPLEMENTATION_COLOR_READ_TYPE": 35738,
+    "IMPLEMENTATION_COLOR_READ_FORMAT": 35739,
+    "COMPILE_STATUS": 35713,
+    "LOW_FLOAT": 36336,
+    "MEDIUM_FLOAT": 36337,
+    "HIGH_FLOAT": 36338,
+    "LOW_INT": 36339,
+    "MEDIUM_INT": 36340,
+    "HIGH_INT": 36341,
+    "FRAMEBUFFER": 36160,
+    "RENDERBUFFER": 36161,
+    "RGBA4": 32854,
+    "RGB5_A1": 32855,
+    "RGB565": 36194,
+    "DEPTH_COMPONENT16": 33189,
+    "STENCIL_INDEX8": 36168,
+    "DEPTH_STENCIL": 34041,
+    "RENDERBUFFER_WIDTH": 36162,
+    "RENDERBUFFER_HEIGHT": 36163,
+    "RENDERBUFFER_INTERNAL_FORMAT": 36164,
+    "RENDERBUFFER_RED_SIZE": 36176,
+    "RENDERBUFFER_GREEN_SIZE": 36177,
+    "RENDERBUFFER_BLUE_SIZE": 36178,
+    "RENDERBUFFER_ALPHA_SIZE": 36179,
+    "RENDERBUFFER_DEPTH_SIZE": 36180,
+    "RENDERBUFFER_STENCIL_SIZE": 36181,
+    "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE": 36048,
+    "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME": 36049,
+    "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL": 36050,
+    "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE": 36051,
+    "COLOR_ATTACHMENT0": 36064,
+    "DEPTH_ATTACHMENT": 36096,
+    "STENCIL_ATTACHMENT": 36128,
+    "DEPTH_STENCIL_ATTACHMENT": 33306,
+    "NONE": 0,
+    "FRAMEBUFFER_COMPLETE": 36053,
+    "FRAMEBUFFER_INCOMPLETE_ATTACHMENT": 36054,
+    "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT": 36055,
+    "FRAMEBUFFER_INCOMPLETE_DIMENSIONS": 36057,
+    "FRAMEBUFFER_UNSUPPORTED": 36061,
+    "FRAMEBUFFER_BINDING": 36006,
+    "RENDERBUFFER_BINDING": 36007,
+    "MAX_RENDERBUFFER_SIZE": 34024,
+    "INVALID_FRAMEBUFFER_OPERATION": 1286,
+    "UNPACK_FLIP_Y_WEBGL": 37440,
+    "UNPACK_PREMULTIPLY_ALPHA_WEBGL": 37441,
+    "CONTEXT_LOST_WEBGL": 37442,
+    "UNPACK_COLORSPACE_CONVERSION_WEBGL": 37443,
+    "BROWSER_DEFAULT_WEBGL": 37444
+};

+ 142 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/GLmethod.js

@@ -0,0 +1,142 @@
+let i = 1;
+
+const GLmethod = {};
+
+GLmethod.activeTexture = i++;         //1
+GLmethod.attachShader = i++;
+GLmethod.bindAttribLocation = i++;
+GLmethod.bindBuffer = i++;
+GLmethod.bindFramebuffer = i++;
+GLmethod.bindRenderbuffer = i++;
+GLmethod.bindTexture = i++;
+GLmethod.blendColor = i++;
+GLmethod.blendEquation = i++;
+GLmethod.blendEquationSeparate = i++; //10
+GLmethod.blendFunc = i++;
+GLmethod.blendFuncSeparate = i++;
+GLmethod.bufferData = i++;
+GLmethod.bufferSubData = i++;
+GLmethod.checkFramebufferStatus = i++;
+GLmethod.clear = i++;
+GLmethod.clearColor = i++;
+GLmethod.clearDepth = i++;
+GLmethod.clearStencil = i++;
+GLmethod.colorMask = i++;              //20
+GLmethod.compileShader = i++;
+GLmethod.compressedTexImage2D = i++;
+GLmethod.compressedTexSubImage2D = i++;
+GLmethod.copyTexImage2D = i++;
+GLmethod.copyTexSubImage2D = i++;
+GLmethod.createBuffer = i++;
+GLmethod.createFramebuffer = i++;
+GLmethod.createProgram = i++;
+GLmethod.createRenderbuffer = i++;
+GLmethod.createShader = i++;           //30
+GLmethod.createTexture = i++;
+GLmethod.cullFace = i++;
+GLmethod.deleteBuffer = i++;
+GLmethod.deleteFramebuffer = i++;
+GLmethod.deleteProgram = i++;
+GLmethod.deleteRenderbuffer = i++;
+GLmethod.deleteShader = i++;
+GLmethod.deleteTexture = i++;
+GLmethod.depthFunc = i++;
+GLmethod.depthMask = i++;              //40
+GLmethod.depthRange = i++;
+GLmethod.detachShader = i++;
+GLmethod.disable = i++;
+GLmethod.disableVertexAttribArray = i++;
+GLmethod.drawArrays = i++;
+GLmethod.drawArraysInstancedANGLE = i++;
+GLmethod.drawElements = i++;
+GLmethod.drawElementsInstancedANGLE = i++;
+GLmethod.enable = i++;
+GLmethod.enableVertexAttribArray = i++;    //50
+GLmethod.flush = i++;
+GLmethod.framebufferRenderbuffer = i++;
+GLmethod.framebufferTexture2D = i++;
+GLmethod.frontFace = i++;
+GLmethod.generateMipmap = i++;
+GLmethod.getActiveAttrib = i++;
+GLmethod.getActiveUniform = i++;
+GLmethod.getAttachedShaders = i++;
+GLmethod.getAttribLocation = i++;
+GLmethod.getBufferParameter = i++;         //60
+GLmethod.getContextAttributes = i++;
+GLmethod.getError = i++;
+GLmethod.getExtension = i++;
+GLmethod.getFramebufferAttachmentParameter = i++;
+GLmethod.getParameter = i++;
+GLmethod.getProgramInfoLog = i++;
+GLmethod.getProgramParameter = i++;
+GLmethod.getRenderbufferParameter = i++;
+GLmethod.getShaderInfoLog = i++;
+GLmethod.getShaderParameter = i++;         //70
+GLmethod.getShaderPrecisionFormat = i++;
+GLmethod.getShaderSource = i++;
+GLmethod.getSupportedExtensions = i++;
+GLmethod.getTexParameter = i++;
+GLmethod.getUniform = i++;
+GLmethod.getUniformLocation = i++;
+GLmethod.getVertexAttrib = i++;
+GLmethod.getVertexAttribOffset = i++;
+GLmethod.isBuffer = i++;
+GLmethod.isContextLost = i++;              //80
+GLmethod.isEnabled = i++;
+GLmethod.isFramebuffer = i++;
+GLmethod.isProgram = i++;
+GLmethod.isRenderbuffer = i++;
+GLmethod.isShader = i++;
+GLmethod.isTexture = i++;
+GLmethod.lineWidth = i++;
+GLmethod.linkProgram = i++;
+GLmethod.pixelStorei = i++;
+GLmethod.polygonOffset = i++;              //90
+GLmethod.readPixels = i++;
+GLmethod.renderbufferStorage = i++;
+GLmethod.sampleCoverage = i++;
+GLmethod.scissor = i++;
+GLmethod.shaderSource = i++;
+GLmethod.stencilFunc = i++;
+GLmethod.stencilFuncSeparate = i++;
+GLmethod.stencilMask = i++;
+GLmethod.stencilMaskSeparate = i++;
+GLmethod.stencilOp = i++;                  //100
+GLmethod.stencilOpSeparate = i++;
+GLmethod.texImage2D = i++;
+GLmethod.texParameterf = i++;
+GLmethod.texParameteri = i++;
+GLmethod.texSubImage2D = i++;
+GLmethod.uniform1f = i++;
+GLmethod.uniform1fv = i++;
+GLmethod.uniform1i = i++;
+GLmethod.uniform1iv = i++;
+GLmethod.uniform2f = i++;                  //110
+GLmethod.uniform2fv = i++;
+GLmethod.uniform2i = i++;
+GLmethod.uniform2iv = i++;
+GLmethod.uniform3f = i++;
+GLmethod.uniform3fv = i++;
+GLmethod.uniform3i = i++;
+GLmethod.uniform3iv = i++;
+GLmethod.uniform4f = i++;
+GLmethod.uniform4fv = i++;
+GLmethod.uniform4i = i++;                  //120
+GLmethod.uniform4iv = i++;
+GLmethod.uniformMatrix2fv = i++;
+GLmethod.uniformMatrix3fv = i++;
+GLmethod.uniformMatrix4fv = i++;
+GLmethod.useProgram = i++;
+GLmethod.validateProgram = i++;
+GLmethod.vertexAttrib1f = i++; //new
+GLmethod.vertexAttrib2f = i++; //new
+GLmethod.vertexAttrib3f = i++; //new
+GLmethod.vertexAttrib4f = i++; //new       //130
+GLmethod.vertexAttrib1fv = i++; //new
+GLmethod.vertexAttrib2fv = i++; //new
+GLmethod.vertexAttrib3fv = i++; //new
+GLmethod.vertexAttrib4fv = i++; //new
+GLmethod.vertexAttribPointer = i++;
+GLmethod.viewport = i++;
+
+export default GLmethod;

+ 23 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/GLtype.js

@@ -0,0 +1,23 @@
+const GLtype = {};
+
+[
+    "GLbitfield",    
+    "GLboolean",
+    "GLbyte",
+    "GLclampf",
+    "GLenum",
+    "GLfloat",
+    "GLint",
+    "GLintptr",
+    "GLsizei",
+    "GLsizeiptr",
+    "GLshort",
+    "GLubyte",
+    "GLuint",
+    "GLushort"
+].sort().map((typeName, i) => GLtype[typeName] = 1 >> (i + 1));
+
+export default GLtype;
+
+
+

+ 21 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Program.js

@@ -0,0 +1,21 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLProgram';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLProgram {
+    className = name;
+
+    constructor(id) {
+        this.id = id;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 21 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Renderbuffer.js

@@ -0,0 +1,21 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLRenderBuffer';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLRenderbuffer {
+    className = name;
+
+    constructor(id) {
+        this.id = id;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 1191 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/RenderingContext.js

@@ -0,0 +1,1191 @@
+import GLenum from './GLenum';
+import ActiveInfo from './ActiveInfo';
+import Buffer from './Buffer';
+import Framebuffer from './Framebuffer';
+import Renderbuffer from './Renderbuffer';
+import Texture from './Texture';
+import Program from './Program';
+import Shader from './Shader';
+import ShaderPrecisionFormat from './ShaderPrecisionFormat';
+import UniformLocation from './UniformLocation';
+import GLmethod from './GLmethod';
+
+const processArray = (array, checkArrayType = false) => {
+
+    function joinArray(arr, sep) {
+        let res = '';
+        for (let i = 0; i < arr.length; i++) {
+            if (i !== 0) {
+                res += sep;
+            }
+            res += arr[i];
+        }
+        return res;
+    }
+
+    let type = 'Float32Array';
+    if (checkArrayType) {
+        if (array instanceof Uint8Array) {
+            type = 'Uint8Array'
+        } else if (array instanceof Uint16Array) {
+            type = 'Uint16Array';
+        } else if (array instanceof Uint32Array) {
+            type = 'Uint32Array';
+        } else if (array instanceof Float32Array) {
+            type = 'Float32Array';
+        } else {
+            throw new Error('Check array type failed. Array type is ' + typeof array);
+        }
+    }
+
+    const ArrayTypes = {
+        Uint8Array: 1,
+        Uint16Array: 2,
+        Uint32Array: 4,
+        Float32Array: 14
+    };
+    return ArrayTypes[type] + ',' + btoa(joinArray(array, ','))
+}
+
+export default class WebGLRenderingContext {
+
+    // static GBridge = null;
+
+    className = 'WebGLRenderingContext';
+
+    constructor(canvas, type, attrs) {
+        this._canvas = canvas;
+        this._type = type;
+        this._version = 'WebGL 1.0';
+        this._attrs = attrs;
+        this._map = new Map();
+
+        Object.keys(GLenum)
+            .forEach(name => Object.defineProperty(this, name, {
+                value: GLenum[name]
+            }));
+    }
+
+    get canvas() {
+        return this._canvas;
+    }
+
+    activeTexture = function (textureUnit) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.activeTexture + ',' + textureUnit,
+            true
+        );
+    }
+
+    attachShader = function (progarm, shader) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.attachShader + ',' + progarm.id + ',' + shader.id,
+            true
+        );
+    }
+
+    bindAttribLocation = function (program, index, name) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bindAttribLocation + ',' + program.id + ',' + index + ',' + name,
+            true
+        )
+    }
+
+    bindBuffer = function (target, buffer) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bindBuffer + ',' + target + ',' + (buffer ? buffer.id : 0),
+            true
+        );
+    }
+
+    bindFramebuffer = function (target, framebuffer) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bindFramebuffer + ',' + target + ',' + (framebuffer ? framebuffer.id : 0),
+            true
+        )
+    }
+
+    bindRenderbuffer = function (target, renderBuffer) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bindRenderbuffer + ',' + target + ',' + (renderBuffer ? renderBuffer.id : 0),
+            true
+        )
+    }
+
+    bindTexture = function (target, texture) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bindTexture + ',' + target + ',' + (texture ? texture.id : 0),
+            true
+        )
+    }
+
+    blendColor = function (r, g, b, a) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.blendColor + ',' + target + ',' + r + ',' + g + ',' + b + ',' + a,
+            true
+        )
+    }
+
+    blendEquation = function (mode) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.blendEquation + ',' + mode,
+            true
+        )
+    }
+
+    blendEquationSeparate = function (modeRGB, modeAlpha) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.blendEquationSeparate + ',' + modeRGB + ',' + modeAlpha,
+            true
+        )
+    }
+
+
+    blendFunc = function (sfactor, dfactor) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.blendFunc + ',' + sfactor + ',' + dfactor,
+            true
+        );
+    }
+
+    blendFuncSeparate = function (srcRGB, dstRGB, srcAlpha, dstAlpha) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.blendFuncSeparate + ',' + srcRGB + ',' + dstRGB + ',' + srcAlpha + ',' + dstAlpha,
+            true
+        );
+    }
+
+    bufferData = function (target, data, usage) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bufferData + ',' + target + ',' + processArray(data, true) + ',' + usage,
+            true
+        )
+    }
+
+    bufferSubData = function (target, offset, data) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.bufferSubData + ',' + target + ',' + offset + ',' + processArray(data, true),
+            true
+        )
+    }
+
+    checkFramebufferStatus = function (target) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.checkFramebufferStatus + ',' + target
+        );
+        return Number(result);
+    }
+
+    clear = function (mask) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.clear + ',' + mask
+        );
+        this._canvas._needRender = true;
+    }
+
+    clearColor = function (r, g, b, a) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.clearColor + ',' + r + ',' + g + ',' + b,
+            true
+        )
+    }
+
+    clearDepth = function (depth) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.clearDepth + ',' + depth,
+            true
+        )
+    }
+
+    clearStencil = function (s) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.clearStencil + ',' + s
+        );
+    }
+
+    colorMask = function (r, g, b, a) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.colorMask + ',' + r + ',' + g + ',' + b + ',' + a
+        )
+    }
+
+    compileShader = function (shader) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.compileShader + ',' + shader.id,
+            true
+        )
+    }
+
+    compressedTexImage2D = function (target, level, internalformat, width, height, border, pixels) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.compressedTexImage2D + ',' + target + ',' + level + ',' + internalformat + ',' +
+            width + ',' + height + ',' + border + ',' + processArray(pixels),
+            true
+        )
+    }
+
+    compressedTexSubImage2D = function (target, level, xoffset, yoffset, width, height, format, pixels) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.compressedTexSubImage2D + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset + ',' +
+            width + ',' + height + ',' + format + ',' + processArray(pixels),
+            true
+        )
+    }
+
+
+    copyTexImage2D = function (target, level, internalformat, x, y, width, height, border) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.copyTexImage2D + ',' + target + ',' + level + ',' + internalformat + ',' + x + ',' + y + ',' +
+            width + ',' + height + ',' + border,
+            true
+        );
+    }
+
+    copyTexSubImage2D = function (target, level, xoffset, yoffset, x, y, width, height) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.copyTexSubImage2D + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset + ',' + x + ',' + y + ',' +
+            width + ',' + height
+        );
+    }
+
+    createBuffer = function () {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.createBuffer + ''
+        );
+        const buffer = new Buffer(result);
+        this._map.set(buffer.uuid(), buffer);
+        return buffer;
+    }
+
+    createFramebuffer = function () {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.createFramebuffer + ''
+        );
+        const framebuffer = new Framebuffer(result);
+        this._map.set(framebuffer.uuid(), framebuffer);
+        return framebuffer;
+    }
+
+
+    createProgram = function () {
+        const id = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.createProgram + ''
+        );
+        const program = new Program(id);
+        this._map.set(program.uuid(), program);
+        return program;
+    }
+
+    createRenderbuffer = function () {
+        const id = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.createRenderbuffer + ''
+        )
+        const renderBuffer = new Renderbuffer(id);
+        this._map.set(renderBuffer.uuid(), renderBuffer);
+        return renderBuffer;
+    }
+
+    createShader = function (type) {
+        const id = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.createShader + ',' + type
+        )
+        const shader = new Shader(id, type);
+        this._map.set(shader.uuid(), shader);
+        return shader;
+    }
+
+    createTexture = function () {
+        const id = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.createTexture + ''
+        );
+        const texture = new Texture(id);
+        this._map.set(texture.uuid(), texture);
+        return texture;
+    }
+
+    cullFace = function (mode) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.cullFace + ',' + mode,
+            true
+        )
+    }
+
+
+    deleteBuffer = function (buffer) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.deleteBuffer + ',' + buffer.id,
+            true
+        )
+    }
+
+    deleteFramebuffer = function (framebuffer) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.deleteFramebuffer + ',' + framebuffer.id,
+            true
+        )
+    }
+
+    deleteProgram = function (program) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.deleteProgram + ',' + program.id,
+            true
+        )
+    }
+
+    deleteRenderbuffer = function (renderbuffer) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.deleteRenderbuffer + ',' + renderbuffer.id,
+            true
+        )
+    }
+
+    deleteShader = function (shader) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.deleteShader + ',' + shader.id,
+            true
+        )
+    }
+
+    deleteTexture = function (texture) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.deleteTexture + ',' + texture.id,
+            true
+        )
+    }
+
+    depthFunc = function (func) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.depthFunc + ',' + func
+        )
+    }
+
+    depthMask = function (flag) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.depthMask + ',' + Number(flag),
+            true
+        )
+    }
+
+    depthRange = function (zNear, zFar) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.depthRange + ',' + zNear + ',' + zFar,
+            true
+        )
+    }
+
+    detachShader = function (program, shader) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.detachShader + ',' + program.id + ',' + shader.id,
+            true
+        )
+    }
+
+    disable = function (cap) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.disable + ',' + cap,
+            true
+        )
+    }
+
+    disableVertexAttribArray = function (index) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.disableVertexAttribArray + ',' + index,
+            true
+        );
+    }
+
+    drawArrays = function (mode, first, count) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.drawArrays + ',' + mode + ',' + first + ',' + count
+        )
+        this._canvas._needRender = true;
+    }
+
+    drawElements = function (mode, count, type, offset) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.drawElements + ',' + mode + ',' + count + ',' + type + ',' + offset + ';'
+        );
+        this._canvas._needRender = true;
+    }
+
+    enable = function (cap) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.enable + ',' + cap,
+            true
+        );
+    }
+
+    enableVertexAttribArray = function (index) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.enableVertexAttribArray + ',' + index,
+            true
+        )
+    }
+
+
+    flush = function () {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.flush + ''
+        )
+    }
+
+    framebufferRenderbuffer = function (target, attachment, textarget, texture, level) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.framebufferRenderbuffer + ',' + target + ',' + attachment + ',' + textarget + ',' + (texture ? texture.id : 0) + ',' + level,
+            true
+        )
+    }
+
+    framebufferTexture2D = function (target, attachment, textarget, texture, level) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.framebufferTexture2D + ',' + target + ',' + attachment + ',' + textarget + ',' + (texture ? texture.id : 0) + ',' + level,
+            true
+        )
+    }
+
+    frontFace = function (mode) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.frontFace + ',' + mode,
+            true
+        )
+    }
+
+    generateMipmap = function (target) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.generateMipmap + ',' + target,
+            true
+        )
+    }
+
+    getActiveAttrib = function (progarm, index) {
+        const resultString = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getActiveAttrib + ',' + progarm.id + ',' + index
+        )
+        const [type, size, name] = resultString.split(',');
+        return new ActiveInfo({
+            type: Number(type),
+            size: Number(size),
+            name
+        });
+    }
+
+    getActiveUniform = function (progarm, index) {
+        const resultString = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getActiveUniform + ',' + progarm.id + ',' + index
+        );
+        const [type, size, name] = resultString.split(',');
+        return new ActiveInfo({
+            type: Number(type),
+            size: Number(size),
+            name
+        })
+    }
+
+    getAttachedShaders = function (progarm) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getAttachedShaders + ',' + progarm.id
+        );
+        const [type, ...ids] = result;
+        return ids.map(id => this._map.get(Shader.uuid(id)));
+    }
+
+    getAttribLocation = function (progarm, name) {
+        return WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getAttribLocation + ',' + progarm.id + ',' + name
+        )
+    }
+
+    getBufferParameter = function (target, pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getBufferParameter + ',' + target + ',' + pname
+        );
+        const [type, res] = getBufferParameter;
+        return res;
+    }
+
+    getError = function () {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getError + ''
+        )
+        return result;
+    }
+
+    getExtension = function (name) {
+        return null;
+    }
+
+    getFramebufferAttachmentParameter = function (target, attachment, pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getFramebufferAttachmentParameter + ',' + target + ',' + attachment + ',' + pname
+        )
+        switch (pname) {
+            case GLenum.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
+                return this._map.get(Renderbuffer.uuid(result)) || this._map.get(Texture.uuid(result)) || null;
+            default:
+                return result;
+        }
+    }
+
+    getParameter = function (pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getParameter + ',' + pname
+        )
+        switch (pname) {
+            case GLenum.VERSION:
+                return this._version;
+            case GLenum.ARRAY_BUFFER_BINDING: // buffer
+            case GLenum.ELEMENT_ARRAY_BUFFER_BINDING: // buffer
+                return this._map.get(Buffer.uuid(result)) || null;
+            case GLenum.CURRENT_PROGRAM: // program
+                return this._map.get(Program.uuid(result)) || null;
+            case GLenum.FRAMEBUFFER_BINDING: // framebuffer
+                return this._map.get(Framebuffer.uuid(result)) || null;
+            case GLenum.RENDERBUFFER_BINDING: // renderbuffer
+                return this._map.get(Renderbuffer.uuid(result)) || null;
+            case GLenum.TEXTURE_BINDING_2D: // texture
+            case GLenum.TEXTURE_BINDING_CUBE_MAP: // texture
+                return this._map.get(Texture.uuid(result)) || null;
+            case GLenum.ALIASED_LINE_WIDTH_RANGE: // Float32Array
+            case GLenum.ALIASED_POINT_SIZE_RANGE: // Float32Array
+            case GLenum.BLEND_COLOR: // Float32Array
+            case GLenum.COLOR_CLEAR_VALUE: // Float32Array
+            case GLenum.DEPTH_RANGE: // Float32Array
+            case GLenum.MAX_VIEWPORT_DIMS: // Int32Array
+            case GLenum.SCISSOR_BOX: // Int32Array
+            case GLenum.VIEWPORT: // Int32Array            
+            case GLenum.COMPRESSED_TEXTURE_FORMATS: // Uint32Array
+            default:
+                const [type, ...res] = result.split(',');
+                if (res.length === 1) {
+                    return Number(res[0]);
+                } else {
+                    return res.map(Number);
+                }
+        }
+    }
+
+    getProgramInfoLog = function (progarm) {
+        return WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getProgramInfoLog + ',' + progarm.id
+        )
+    }
+
+    getProgramParameter = function (program, pname) {
+        const res = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getProgramParameter + ',' + program.id + ',' + pname
+        );
+
+        const [type, result] = res.split(',').map(i => parseInt(i));
+
+        if (type === 1) {
+            return Boolean(result);
+        } else if (type === 2) {
+            return result;
+        } else {
+            throw new Error('Unrecongized program paramater ' + res + ', type: ' + typeof res);
+        }
+    }
+
+
+    getRenderbufferParameter = function (target, pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getRenderbufferParameter + ',' + target + ',' + pname
+        )
+        return result;
+    }
+
+
+    getShaderInfoLog = function (shader) {
+        return WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getShaderInfoLog + ',' + shader.id
+        );
+    }
+
+    getShaderParameter = function (shader, pname) {
+        return WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getShaderParameter + ',' + shader.id + ',' + pname
+        )
+    }
+
+    getShaderPrecisionFormat = function (shaderType, precisionType) {
+        const [rangeMin, rangeMax, precision] = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getShaderPrecisionFormat + ',' + shaderType + ',' + precisionType
+        );
+        const shaderPrecisionFormat = new ShaderPrecisionFormat({
+            rangeMin: Number(rangeMin),
+            rangeMax: Number(rangeMax),
+            precision: Number(precision)
+        });
+        return shaderPrecisionFormat;
+    }
+
+    getShaderSource = function (shader) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getShaderSource + ',' + shader.id
+        );
+        return result;
+    }
+
+    getSupportedExtensions = function () {
+        return Object.keys({});
+    }
+
+    getTexParameter = function (target, pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getTexParameter + ',' + target + ',' + pname
+        )
+        return result;
+    }
+
+    getUniformLocation = function (program, name) {
+        const id = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getUniformLocation + ',' + program.id + ',' + name
+        );
+        if (id === -1) {
+            return null;
+        } else {
+            return new UniformLocation(Number(id));
+        }
+    }
+
+    getVertexAttrib = function (index, pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getVertexAttrib + ',' + index + ',' + pname
+        );
+        switch (pname) {
+            case GLenum.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
+                return this._map.get(Buffer.uuid(result)) || null;
+            case GLenum.CURRENT_VERTEX_ATTRIB: // Float32Array
+            default:
+                return result;
+        }
+    }
+
+    getVertexAttribOffset = function (index, pname) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.getVertexAttribOffset + ',' + index + ',' + pname
+        )
+        return Number(result);
+    }
+
+    isBuffer = function (buffer) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isBuffer + ',' + buffer.id
+        )
+        return Boolean(result);
+    }
+
+    isContextLost = function () {
+        return false;
+    }
+
+    isEnabled = function (cap) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isEnabled + ',' + cap
+        )
+        return Boolean(result);
+    }
+
+    isFramebuffer = function (framebuffer) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isFramebuffer + ',' + framebuffer.id
+        )
+        return Boolean(result);
+    }
+
+    isProgram = function (program) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isProgram + ',' + program.id
+        )
+        return Boolean(result);
+    }
+
+    isRenderbuffer = function (renderBuffer) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isRenderbuffer + ',' + renderbuffer.id
+        )
+        return Boolean(result);
+    }
+
+    isShader = function (shader) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isShader + ',' + shader.id
+        )
+        return Boolean(result);
+    }
+
+    isTexture = function (texture) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.isTexture + ',' + texture.id
+        );
+        return Boolean(result);
+    }
+
+    lineWidth = function (width) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.lineWidth + ',' + width,
+            true
+        )
+    }
+
+    linkProgram = function (program) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.linkProgram + ',' + program.id,
+            true
+        );
+    }
+
+
+    pixelStorei = function (pname, param) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.pixelStorei + ',' + pname + ',' + Number(param)
+        )
+    }
+
+    polygonOffset = function (factor, units) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.polygonOffset + ',' + factor + ',' + units
+        )
+    }
+
+    readPixels = function (x, y, width, height, format, type, pixels) {
+        const result = WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.readPixels + ',' + x + ',' + y + ',' + width + ',' + height + ',' + format + ',' + type
+        )
+        return result;
+    }
+
+    renderbufferStorage = function (target, internalFormat, width, height) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.renderbufferStorage + ',' + target + ',' + internalFormat + ',' + width + ',' + height,
+            true
+        )
+    }
+
+    sampleCoverage = function (value, invert) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.sampleCoverage + ',' + value + ',' + Number(invert),
+            true
+        )
+    }
+
+    scissor = function (x, y, width, height) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.scissor + ',' + x + ',' + y + ',' + width + ',' + height,
+            true
+        )
+    }
+
+    shaderSource = function (shader, source) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.shaderSource + ',' + shader.id + ',' + source
+        )
+    }
+
+    stencilFunc = function (func, ref, mask) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.stencilFunc + ',' + func + ',' + ref + ',' + mask,
+            true
+        )
+    }
+
+    stencilFuncSeparate = function (face, func, ref, mask) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.stencilFuncSeparate + ',' + face + ',' + func + ',' + ref + ',' + mask,
+            true
+        )
+    }
+
+    stencilMask = function (mask) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.stencilMask + ',' + mask,
+            true
+        )
+    }
+
+    stencilMaskSeparate = function (face, mask) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.stencilMaskSeparate + ',' + face + ',' + mask,
+            true
+        )
+    }
+
+    stencilOp = function (fail, zfail, zpass) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.stencilOp + ',' + fail + ',' + zfail + ',' + zpass
+        )
+    }
+
+    stencilOpSeparate = function (face, fail, zfail, zpass) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.stencilOp + ',' + face + ',' + fail + ',' + zfail + ',' + zpass,
+            true
+        )
+    }
+
+    texImage2D = function (...args) {
+        WebGLRenderingContext.GBridge.texImage2D(this._canvas.id, ...args);
+    }
+
+
+    texParameterf = function (target, pname, param) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.texParameterf + ',' + target + ',' + pname + ',' + param,
+            true
+        )
+    }
+
+    texParameteri = function (target, pname, param) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.texParameteri + ',' + target + ',' + pname + ',' + param
+        )
+    }
+
+    texSubImage2D = function (...args) {
+        WebGLRenderingContext.GBridge.texSubImage2D(this._canvas.id, ...args);
+    }
+
+    uniform1f = function (location, v0) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform1f + ',' + location.id + ',' + v0
+        )
+    }
+
+    uniform1fv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform1fv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform1i = function (location, v0) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform1i + ',' + location.id + ',' + v0,
+            // true
+        )
+    }
+
+    uniform1iv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform1iv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform2f = function (location, v0, v1) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform2f + ',' + location.id + ',' + v0 + ',' + v1,
+            true
+        )
+    }
+
+    uniform2fv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform2fv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform2i = function (location, v0, v1) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform2i + ',' + location.id + ',' + v0 + ',' + v1,
+            true
+        )
+    }
+
+    uniform2iv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform2iv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform3f = function (location, v0, v1, v2) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform3f + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2,
+            true
+        )
+    }
+
+    uniform3fv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform3fv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform3i = function (location, v0, v1, v2) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform3i + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2,
+            true
+        )
+    }
+
+    uniform3iv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform3iv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform4f = function (location, v0, v1, v2, v3) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform4f + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2 + ',' + v3,
+            true
+        )
+    }
+
+    uniform4fv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform4fv + ',' + location.id + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniform4i = function (location, v0, v1, v2, v3) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform4i + ',' + location.id + ',' + v0 + ',' + v1 + ',' + v2 + ',' + v3,
+            true
+        )
+    }
+
+    uniform4iv = function (location, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniform4iv + ',' + location.id + ',' + processArray(value, true),
+            true
+        )
+    }
+
+    uniformMatrix2fv = function (location, transpose, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniformMatrix2fv + ',' + location.id + ',' + Number(transpose) + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniformMatrix3fv = function (location, transpose, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniformMatrix3fv + ',' + location.id + ',' + Number(transpose) + ',' + processArray(value),
+            true
+        )
+    }
+
+    uniformMatrix4fv = function (location, transpose, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.uniformMatrix4fv + ',' + location.id + ',' + Number(transpose) + ',' + processArray(value),
+            true
+        );
+    }
+
+    useProgram = function (progarm) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.useProgram + ',' + progarm.id + '',
+            true
+        )
+    }
+
+
+    validateProgram = function (program) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.validateProgram + ',' + program.id,
+            true
+        )
+    }
+
+    vertexAttrib1f = function (index, v0) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib1f + ',' + index + ',' + v0,
+            true
+        )
+    }
+
+    vertexAttrib2f = function (index, v0, v1) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib2f + ',' + index + ',' + v0 + ',' + v1,
+            true
+        )
+    }
+
+    vertexAttrib3f = function (index, v0, v1, v2) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib3f + ',' + index + ',' + v0 + ',' + v1 + ',' + v2,
+            true
+        )
+    }
+
+    vertexAttrib4f = function (index, v0, v1, v2, v3) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib4f + ',' + index + ',' + v0 + ',' + v1 + ',' + v2 + ',' + v3,
+            true
+        )
+    }
+
+    vertexAttrib1fv = function (index, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib1fv + ',' + index + ',' + processArray(value),
+            true
+        )
+    }
+
+    vertexAttrib2fv = function (index, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib2fv + ',' + index + ',' + processArray(value),
+            true
+        )
+    }
+
+    vertexAttrib3fv = function (index, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib3fv + ',' + index + ',' + processArray(value),
+            true
+        )
+    }
+
+    vertexAttrib4fv = function (index, value) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttrib4fv + ',' + index + ',' + processArray(value),
+            true
+        )
+    }
+
+    vertexAttribPointer = function (index, size, type, normalized, stride, offset) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.vertexAttribPointer + ',' + index + ',' + size + ',' + type + ',' + Number(normalized) + ',' + stride + ',' + offset,
+            true
+        )
+    }
+
+    viewport = function (x, y, width, height) {
+        WebGLRenderingContext.GBridge.callNative(
+            this._canvas.id,
+            GLmethod.viewport + ',' + x + ',' + y + ',' + width + ',' + height,
+            true
+        )
+    }
+}

+ 22 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Shader.js

@@ -0,0 +1,22 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLShader';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLShader {
+    className = name;
+
+    constructor(id, type) {
+        this.id = id;
+        this.type = type;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 11 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js

@@ -0,0 +1,11 @@
+export default class WebGLShaderPrecisionFormat {
+    className = 'WebGLShaderPrecisionFormat';
+
+    constructor({
+        rangeMin, rangeMax, precision
+    }) {
+        this.rangeMin = rangeMin;
+        this.rangeMax = rangeMax;
+        this.precision = precision;
+    }
+}

+ 22 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/Texture.js

@@ -0,0 +1,22 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLTexture';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLTexture {
+    className = name;
+
+    constructor(id, type) {
+        this.id = id;
+        this.type = type;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 22 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/UniformLocation.js

@@ -0,0 +1,22 @@
+import {getTransferedObjectUUID} from './classUtils';
+
+const name = 'WebGLUniformLocation';
+
+function uuid(id) {
+    return getTransferedObjectUUID(name, id);
+}
+
+export default class WebGLUniformLocation {
+    className = name;
+
+    constructor(id, type) {
+        this.id = id;
+        this.type = type;
+    }
+
+    static uuid = uuid;
+
+    uuid() {
+        return uuid(this.id);
+    }
+}

+ 3 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/context-webgl/classUtils.js

@@ -0,0 +1,3 @@
+export function getTransferedObjectUUID(name, id) {
+    return `${name.toLowerCase()}-${id}`;
+}

+ 74 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/env/canvas.js

@@ -0,0 +1,74 @@
+import GContext2D from '../context-2d/RenderingContext';
+import GContextWebGL from '../context-webgl/RenderingContext';
+
+export default class GCanvas {
+
+    // static GBridge = null;
+
+    id = null;
+
+    _needRender = true;
+
+    constructor(id, { disableAutoSwap }) {
+        this.id = id;
+
+        this._disableAutoSwap = disableAutoSwap;
+        if (disableAutoSwap) {
+            this._swapBuffers = () => {
+                GCanvas.GBridge.render(this.id);
+            }
+        }
+    }
+
+    getContext(type) {
+
+        let context = null;
+
+        if (type.match(/webgl/i)) {
+            context = new GContextWebGL(this);
+
+            context.componentId = this.id;
+
+            if (!this._disableAutoSwap) {
+                const render = () => {
+                    if (this._needRender) {
+                        GCanvas.GBridge.render(this.id);
+                        this._needRender = false;
+                    }
+                }
+                setInterval(render, 16);
+            }
+
+            GCanvas.GBridge.callSetContextType(this.id, 1); // 0 for 2d; 1 for webgl
+        } else if (type.match(/2d/i)) {
+            context = new GContext2D(this);
+
+            context.componentId = this.id;
+
+//             const render = ( callback ) => {
+// 
+//                 const commands = context._drawCommands;
+//                 context._drawCommands = '';
+// 
+//                 GCanvas.GBridge.render2d(this.id, commands, callback);
+//                 this._needRender = false;
+//             }
+// 			//draw方法触发
+// 			context._flush = render;
+//             //setInterval(render, 16);
+
+            GCanvas.GBridge.callSetContextType(this.id, 0);
+        } else {
+            throw new Error('not supported context ' + type);
+        }
+
+        return context;
+
+    }
+
+    reset() {
+        GCanvas.GBridge.callReset(this.id);
+    }
+
+
+}

+ 96 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/env/image.js

@@ -0,0 +1,96 @@
+let incId = 1;
+
+const noop = function () { };
+
+class GImage {
+
+    static GBridge = null;
+
+    constructor() {
+        this._id = incId++;
+        this._width = 0;
+        this._height = 0;
+        this._src = undefined;
+        this._onload = noop;
+        this._onerror = noop;
+        this.complete = false;
+    }
+
+    get width() {
+        return this._width;
+    }
+    set width(v) {
+        this._width = v;
+    }
+
+    get height() {
+        return this._height;
+    }
+
+    set height(v) {
+        this._height = v;
+    }
+
+    get src() {
+        return this._src;
+    }
+
+    set src(v) {
+
+        if (v.startsWith('//')) {
+            v = 'http:' + v;
+        }
+
+        this._src = v;
+
+        GImage.GBridge.perloadImage([this._src, this._id], (data) => {
+            if (typeof data === 'string') {
+                data = JSON.parse(data);
+            }
+            if (data.error) {
+                var evt = { type: 'error', target: this };
+                this.onerror(evt);
+            } else {
+                this.complete = true;
+                this.width = typeof data.width === 'number' ? data.width : 0;
+                this.height = typeof data.height === 'number' ? data.height : 0;
+                var evt = { type: 'load', target: this };
+                this.onload(evt);
+            }
+        });
+    }
+
+    addEventListener(name, listener) {
+        if (name === 'load') {
+            this.onload = listener;
+        } else if (name === 'error') {
+            this.onerror = listener;
+        }
+    }
+
+    removeEventListener(name, listener) {
+        if (name === 'load') {
+            this.onload = noop;
+        } else if (name === 'error') {
+            this.onerror = noop;
+        }
+    }
+
+    get onload() {
+        return this._onload;
+    }
+
+    set onload(v) {
+        this._onload = v;
+    }
+
+    get onerror() {
+        return this._onerror;
+    }
+
+    set onerror(v) {
+        this._onerror = v;
+    }
+}
+
+export default GImage;

+ 24 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/env/tool.js

@@ -0,0 +1,24 @@
+
+export function ArrayBufferToBase64 (buffer) {
+    var binary = '';
+    var bytes = new Uint8ClampedArray(buffer);
+    for (var len = bytes.byteLength, i = 0; i < len; i++) {
+        binary += String.fromCharCode(bytes[i]);
+    }
+    return btoa(binary);
+}
+	
+export function Base64ToUint8ClampedArray(base64String) {
+	const padding = '='.repeat((4 - base64String.length % 4) % 4);
+	const base64 = (base64String + padding)
+		.replace(/\-/g, '+')
+		.replace(/_/g, '/');
+
+	const rawData = atob(base64);
+	const outputArray = new Uint8ClampedArray(rawData.length);
+
+	for (let i = 0; i < rawData.length; ++i) {
+		outputArray[i] = rawData.charCodeAt(i);
+	}
+	return outputArray;
+}

+ 39 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/gcanvas/index.js

@@ -0,0 +1,39 @@
+import GCanvas from './env/canvas';
+import GImage from './env/image';
+
+import GWebGLRenderingContext from './context-webgl/RenderingContext';
+import GContext2D from './context-2d/RenderingContext';
+
+import GBridgeWeex from './bridge/bridge-weex';
+
+export let Image = GImage;
+
+export let WeexBridge = GBridgeWeex;
+
+export function enable(el, { bridge, debug, disableAutoSwap, disableComboCommands } = {}) {
+
+    const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge;
+
+    GBridge.callEnable(el.ref, [
+        0,      // renderMode: 0--RENDERMODE_WHEN_DIRTY, 1--RENDERMODE_CONTINUOUSLY
+        -1,     // hybridLayerType:  0--LAYER_TYPE_NONE 1--LAYER_TYPE_SOFTWARE 2--LAYER_TYPE_HARDWARE
+        false,  // supportScroll
+        false,  // newCanvasMode
+        1,      // compatible
+        'white',// clearColor
+        false   // sameLevel: newCanvasMode = true && true => GCanvasView and Webview is same level
+    ]);
+
+    if (debug === true) {
+        GBridge.callEnableDebug();
+    }
+    if (disableComboCommands) {
+        GBridge.callEnableDisableCombo();
+    }
+
+    var canvas = new GCanvas(el.ref, { disableAutoSwap });
+    canvas.width = el.style.width;
+    canvas.height = el.style.height;
+
+    return canvas;
+};

+ 485 - 0
uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue

@@ -0,0 +1,485 @@
+<template>
+  <view class="uqrcode" :style="{'width': `${size}px`, 'height': `${size}px`}">
+    <block v-if="!isReload">
+      <!-- canvas模式,默认 -->
+      <block v-if="mode === 'canvas'">
+        <!-- #ifdef APP-NVUE -->
+        <gcanvas class="uqrcode-canvas" ref="gcanvas" :style="{'width': `${size}px`, 'height': `${size}px`}"></gcanvas>
+        <!-- #endif -->
+        <!-- #ifndef APP-NVUE -->
+        <canvas class="uqrcode-canvas" :id="id" :canvas-id="id" :style="{'width': `${size}px`, 'height': `${size}px`}"></canvas>
+        <!-- #endif -->
+      </block>
+
+      <!-- view模式,兼容 -->
+      <view v-else-if="mode === 'view'" class="uqrcode-view" :style="{
+      'width': `${size}px`,
+      'height': `${size}px`,
+      'padding': `${margin}px`,
+      'background-color': backgroundColor
+      }">
+        <view class="uqrcode-view-row" v-for="(row, rowIndex) in modules.length" :key="rowIndex">
+          <view class="uqrcode-view-col" v-for="(col, colIndex) in modules.length" :key="colIndex" :style="{
+        	'width': `${tileSize}px`,
+        	'height': `${tileSize}px`,
+        	'background-color': modules[rowIndex][colIndex] ? foregroundColor : backgroundColor
+        	}">
+          </view>
+        </view>
+      </view>
+    </block>
+
+    <!-- 生成二维码的loading效果 -->
+    <!-- <view class="uqrcode-makeing" :class="{'uqrcode-make-complete': !makeing}">loading...</view> -->
+
+    <!-- H5保存提示 -->
+    <!-- #ifdef H5 -->
+    <view class="uqrcode-h5-save" v-if="isH5Save">
+      <image class="uqrcode-h5-save-image" :src="tempFilePath"></image>
+      <text class="uqrcode-h5-save-text">请长按二维码进行保存</text>
+      <view class="uqrcode-h5-save-close" @click="isH5Save=false">
+        <view class="uqrcode-h5-save-close-before"></view>
+        <view class="uqrcode-h5-save-close-after"></view>
+      </view>
+    </view>
+    <!-- #endif -->
+  </view>
+</template>
+
+<script>
+  /* 引入uqrcode核心js */
+  import uqrcode from './common/uqrcode'
+
+  /* 引入nvue所需模块 */
+  // #ifdef APP-NVUE
+  import {
+    enable,
+    WeexBridge
+  } from './gcanvas'
+  let modal = weex.requireModule("modal")
+  // #endif
+
+  export default {
+    name: 'uqrcode',
+    props: {
+      // id
+      id: {
+        type: String,
+        default: uuid()
+      },
+      // 生成模式
+      mode: {
+        type: String,
+        default: 'canvas' // canvas|view (nvue不支持canvas模式)
+      },
+      // 二维码内容
+      text: String,
+      // 二维码大小
+      size: {
+        type: Number,
+        default: 256
+      },
+      // 填充边距
+      margin: {
+        type: Number,
+        default: 0
+      },
+      // 背景色
+      backgroundColor: {
+        type: String,
+        default: '#FFFFFF'
+      },
+      // 前景色
+      foregroundColor: {
+        type: String,
+        default: '#000000'
+      },
+      // 纠错等级
+      errorCorrectLevel: {
+        type: [String, Number],
+        default: uqrcode.errorCorrectLevel.H
+      },
+      // 版本
+      typeNumber: {
+        type: Number,
+        default: -1
+      },
+      // 导出的文件类型
+      fileType: {
+        type: String,
+        default: 'png'
+      }
+    },
+    data() {
+      return {
+        canvasContext: null,
+        makeing: false,
+        delegate: null,
+        delegateParams: null,
+        tempFilePath: '',
+        isH5Save: false,
+        isReload: false
+      }
+    },
+    computed: {
+      modules() {
+        let options = {
+          ...this.$props
+        }
+        if (typeof options.errorCorrectLevel === 'string') {
+          options.errorCorrectLevel = uqrcode.errorCorrectLevel[options.errorCorrectLevel]
+        }
+        return uqrcode.getModules(options)
+      },
+      tileSize() {
+        return (this.size - this.margin * 2) / this.modules.length
+      }
+    },
+    watch: {
+      /* 深度监听props,任意属性一发生改变立即重绘二维码 */
+      $props: {
+        handler() {
+          this.reload()
+        },
+        deep: true
+      },
+      makeing(val) {
+        if (!val) {
+          if (typeof this.delegate === 'function') {
+            this.delegate(this.delegateParams)
+          }
+        }
+      }
+    },
+    mounted() {
+      this.$nextTick(() => {
+        this.make()
+      })
+    },
+    methods: {
+      reload() {
+        /* 重载组件 */
+        this.isReloadMake = true
+        this.isReload = true
+        this.$nextTick(() => {
+          this.isReload = false
+          this.$nextTick(() => {
+            setTimeout(() => {
+              this.make()
+            }, 150)
+          })
+        })
+      },
+      make() {
+        if (this.makeing) {
+          return
+        }
+        this.makeing = true
+        if (this.mode === 'canvas') {
+          let ctx = null
+
+          // #ifdef APP-NVUE
+          /* 获取元素引用 */
+          let gcanvas = this.$refs["gcanvas"]
+          /* 通过元素引用获取canvas对象 */
+          let canvasObj = enable(gcanvas, {
+            bridge: WeexBridge
+          })
+          /* 获取绘图所需的上下文,目前不支持3d */
+          ctx = canvasObj.getContext('2d')
+          // #endif
+
+          // #ifndef APP-NVUE
+          /* 获取绘图所需的上下文 */
+          ctx = uni.createCanvasContext(this.id, this)
+          // #endif
+
+          this.canvasContext = ctx
+
+          ctx.draw() // 清空之前的画布内容
+          ctx.setFillStyle(this.backgroundColor)
+          ctx.fillRect(0, 0, this.size, this.size)
+
+          for (var row = 0; row < this.modules.length; row++) {
+            for (var col = 0; col < this.modules.length; col++) {
+              // 计算每一个小块的位置
+              var x = col * this.tileSize + this.margin
+              var y = row * this.tileSize + this.margin
+              var w = this.tileSize
+              var h = this.tileSize
+
+              var style = this.modules[row][col] ? this.foregroundColor : this.backgroundColor
+              ctx.setFillStyle(style)
+              ctx.fillRect(x, y, w, h)
+            }
+          }
+
+          ctx.draw(false, () => {
+            // setTimeout(() => {
+            this.complete()
+            // }, 3000)
+          })
+        } else if (this.mode === 'view') {
+          this.complete()
+        }
+      },
+      complete(e = {}) {
+        let basic = {
+          id: this.id,
+          text: this.text,
+          mode: this.mode
+        }
+        let ages = {
+          ...basic,
+          ...e
+        }
+        this.makeing = false
+        this.$emit('complete', ages)
+      },
+      toTempFilePath(callback = {}) {
+        if (typeof callback.success != 'function') {
+          callback.success = () => {}
+        }
+        if (typeof callback.fail != 'function') {
+          callback.fail = () => {}
+        }
+        if (typeof callback.complete != 'function') {
+          callback.complete = () => {}
+        }
+
+        if (this.makeing) {
+          // 如果还在生成状态,那当前操作将托管到委托,监听生成完成后再通过委托复调当前方法
+          this.delegate = this.toTempFilePath
+          this.delegateParams = callback
+          return
+        } else {
+          this.delegate = null
+          this.delegateParams = null
+        }
+
+        let _this = this
+        // #ifdef APP-NVUE
+        this.canvasContext.toTempFilePath(
+          0,
+          0,
+          _this.size * 3, // 不知道什么原因,最少要*3,不然输出的图片只有一个角
+          _this.size * 3, // 不知道什么原因,最少要*3,不然输出的图片只有一个角
+          _this.size,
+          _this.size,
+          _this.fileType,
+          1,
+          res => {
+            _this.tempFilePath = res.tempFilePath
+            callback.success(res)
+            callback.complete(res)
+          }
+        )
+        // #endif
+
+        // #ifndef APP-NVUE
+        uni.canvasToTempFilePath({
+          canvasId: this.id,
+          fileType: this.fileType,
+          width: this.size,
+          height: this.size,
+          success: res => {
+            this.tempFilePath = res.tempFilePath
+            callback.success(res)
+          },
+          fail: err => {
+            callback.fail(err)
+          },
+          complete: res => {
+            callback.complete(res)
+          }
+        }, this)
+        // #endif
+      },
+      save(callback = {}) {
+        if (typeof callback.success != 'function') {
+          callback.success = () => {}
+        }
+        if (typeof callback.fail != 'function') {
+          callback.fail = () => {}
+        }
+        if (typeof callback.complete != 'function') {
+          callback.complete = () => {}
+        }
+
+        this.toTempFilePath({
+          success: res => {
+            // #ifdef H5
+            this.isH5Save = true
+            callback.success({
+              msg: 'H5请长按图片保存'
+            })
+            callback.complete({
+              msg: 'H5请长按图片保存'
+            })
+            // #endif
+
+            // #ifndef H5
+            uni.saveImageToPhotosAlbum({
+              filePath: this.tempFilePath,
+              success: res1 => {
+                callback.success({
+                  msg: '保存成功'
+                })
+              },
+              fail: err1 => {
+                callback.fail(err1)
+              },
+              complete: res1 => {
+                callback.complete(res1)
+              }
+            })
+            // #endif
+          },
+          fail: err => {
+            callback.fail(err)
+          }
+        })
+      }
+    }
+  }
+
+  function uuid(len = 32, firstU = true, radix = null) {
+    let chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
+    let uuid = [];
+    radix = radix || chars.length;
+
+    if (len) {
+      // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
+      for (let i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
+    } else {
+      let r;
+      // rfc4122标准要求返回的uuid中,某些位为固定的字符
+      uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
+      uuid[14] = '4';
+
+      for (let i = 0; i < 36; i++) {
+        if (!uuid[i]) {
+          r = 0 | Math.random() * 16;
+          uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
+        }
+      }
+    }
+
+    // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
+    if (firstU) {
+      uuid.shift();
+      return 'u' + uuid.join('');
+    } else {
+      return uuid.join('');
+    }
+  }
+</script>
+
+<style>
+  .uqrcode {
+    position: relative;
+  }
+
+  .uqrcode-makeing {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    /* #ifndef APP-NVUE */
+    display: flex;
+    box-sizing: border-box;
+    /* #endif */
+    justify-content: center;
+    align-items: center;
+    background-color: #FFFFFF;
+    transition-property: opacity;
+    transition-duration: 0.25s;
+    opacity: 0.88;
+  }
+
+  .uqrcode-make-complete {
+    opacity: 0;
+  }
+
+  .uqrcode-view {
+    /* #ifndef APP-NVUE */
+    display: flex;
+    box-sizing: border-box;
+    /* #endif */
+    flex-direction: column;
+  }
+
+  .uqrcode-view-row {
+    /* #ifndef APP-NVUE */
+    display: flex;
+    box-sizing: border-box;
+    /* #endif */
+    flex-direction: row;
+  }
+
+  .uqrcode-view-col {
+    /* #ifndef APP-NVUE */
+    display: flex;
+    box-sizing: border-box;
+    /* #endif */
+  }
+
+  /* #ifdef H5 */
+  .uqrcode-h5-save {
+    position: fixed;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    z-index: 100;
+    background-color: rgba(0, 0, 0, 0.68);
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+  }
+
+  .uqrcode-h5-save-image {
+    width: 512rpx;
+    height: 512rpx;
+    padding: 32rpx;
+  }
+
+  .uqrcode-h5-save-text {
+    margin-top: 20rpx;
+    font-size: 32rpx;
+    font-weight: 700;
+    color: #FFFFFF;
+  }
+
+  .uqrcode-h5-save-close {
+    position: relative;
+    margin-top: 72rpx;
+    width: 40rpx;
+    height: 40rpx;
+    border: 2rpx solid #FFFFFF;
+    border-radius: 40rpx;
+    padding: 10rpx;
+  }
+
+  .uqrcode-h5-save-close-before {
+    position: absolute;
+    top: 50%;
+    transform: translateY(-50%) rotate(45deg);
+    width: 40rpx;
+    height: 4rpx;
+    background: #FFFFFF;
+  }
+
+  .uqrcode-h5-save-close-after {
+    position: absolute;
+    top: 50%;
+    transform: translateY(-50%) rotate(-45deg);
+    width: 40rpx;
+    height: 4rpx;
+    background: #FFFFFF;
+  }
+
+  /* #endif */
+</style>

+ 82 - 0
uni_modules/Sansnn-uQRCode/package.json

@@ -0,0 +1,82 @@
+{
+  "id": "Sansnn-uQRCode",
+  "displayName": "uQRCode 二维码生成插件",
+  "version": "3.0.1",
+  "description": "uQRCode 是一款使用方式简单,易于扩展的二维码生成插件。",
+  "keywords": [
+    "uQRCode",
+    "二维码",
+    "qrcode"
+],
+  "repository": "https://github.com/Sansnn/uQRCode",
+  "engines": {
+    "HBuilderX": "^3.1.0"
+  },
+  "dcloudext": {
+    "category": [
+      "JS SDK",
+      "通用 SDK"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": ""
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "y",
+          "联盟": "y"
+        },
+        "Vue": {
+          "vue2": "y",
+          "vue3": "u"
+        }
+      }
+    }
+  }
+}

+ 210 - 0
uni_modules/Sansnn-uQRCode/readme.md

@@ -0,0 +1,210 @@
+# uQRCode
+
+uQRCode 生成方式简单,可扩展性高,如有复杂需求可通过自定义组件或修改源码完成需求。已测试H5、微信小程序、iPhoneXsMax真机、华为P20Pro真机。
+
+支持自定义二维码渲染规则,可通过 `getModules` 方法得到矩阵信息后,自行实现canvas或view+css渲染二维码,如随机颜色、圆点、方块、块与块之间的间距等。
+
+### 二维码
+**什么是QR码**
+
+QR码属于矩阵式二维码中的一个种类,由DENSO(日本电装)公司开发,由JIS和ISO将其标准化。
+
+**QR码的特点**
+
+一是高速读取(QR就是取自“Quick Response”的首字母),通过摄像头从拍摄到解码到显示内容也就三秒左右,对摄像的角度也没有什么要求;
+
+二是高容量、高密度,理论上内容经过压缩处理后可以存7089个数字,4296个字母和数字混合字符,2953个8位字节数据,1817个汉字;
+
+三是支持纠错处理,按照QR码的标准文档说明,QR码的纠错分为4个级别,分别是:
+- level L : 最大 7% 的错误能够被纠正;
+- level M : 最大 15% 的错误能够被纠正;
+- level Q : 最大 25% 的错误能够被纠正;
+- level H : 最大 30% 的错误能够被纠正;
+
+四是结构化,看似无规则的图形,其实对区域有严格的定义。
+
+更多二维码介绍及原理:[https://blog.csdn.net/jason_ldh/article/details/11801355](https://blog.csdn.net/jason_ldh/article/details/11801355)
+
+### 简单使用
+
+在 `template` 中创建 `<uqrcode/>`,并指定生成内容 `text`
+
+```html
+<uqrcode ref="uQRCode" text="uQRCode 3.0" />
+```
+
+### 属性说明
+
+|属性名						|类型					|可选值						|默认值		|是否必填	|说明														|
+|---							|---					|---							|---			|---			|:---														|
+|id								|String				|-								|随机生成	|否				|组件标识/canvasId							|
+|mode							|String				|canvas/view			|canvas		|否				|生成模式												|
+|text							|String				|-								|-				|是				|二维码内容											|
+|size							|Number				|-								|256			|否				|二维码大小,单位px							|
+|margin						|Number				|-								|0				|否				|填充边距,单位px								|
+|backgroundColor	|String				|-								|#FFFFFF	|否				|背景色													|
+|foregroundColor	|String				|-								|#000000	|否				|前景色													|
+|errorCorrectLevel|String/Number|L/M/Q/H/1/0/3/2	|H				|否				|纠错等级L/M/Q/H分别对应1/0/3/2	|
+|typeNumber				|Number				|-								|-1				|否				|版本														|
+|fileType					|String				|png/jpg					|png			|否				|导出的文件类型									|
+
+### 方法说明
+
+|方法名|说明|
+|---|:---|
+|[toTempFilePath](#totempfilepathobject)|导出临时文件路径|
+|[save](#saveobject)|保存二维码|
+
+### toTempFilePath(OBJECT)
+
+导出临时文件路径
+
+**OBJECT参数说明**
+
+|参数			|类型			|必填	|默认值	|说明																							|
+|---			|---			|---	|---		|:---																							|
+|success	|Function	|否		|-			|方法调用成功的回调函数														|
+|fail			|Function	|否		|-			|方法调用失败的回调函数														|
+|complete	|Function	|否		|-			|方法调用结束的回调函数(调用成功、失败都会执行)	|
+
+#### 示例
+
+```html
+<template>
+  <view>
+    <uqrcode ref="uQRCode" text="uQRCode 3.0" />
+    <button @click="toTempFilePath">导出临时文件路径</button>
+  </view>
+</template>
+```
+
+```javascript
+export default {
+  methods: {
+    toTempFilePath() {
+      this.$refs.uQRCode.toTempFilePath({
+        success: res => {
+          console.log(res)
+        }
+      })
+    }
+  }
+}
+```
+
+### save(OBJECT)
+
+保存二维码
+
+**OBJECT参数说明**
+
+|参数			|类型			|必填	|默认值	|说明																							|
+|---			|---			|---	|---		|:---																							|
+|success	|Function	|否		|-			|方法调用成功的回调函数														|
+|fail			|Function	|否		|-			|方法调用失败的回调函数														|
+|complete	|Function	|否		|-			|方法调用结束的回调函数(调用成功、失败都会执行)	|
+
+#### 示例
+
+```html
+<template>
+  <view>
+    <uqrcode ref="uQRCode" text="uQRCode 3.0" />
+    <button @click="save">保存二维码</button>
+  </view>
+</template>
+```
+
+```javascript
+export default {
+  methods: {
+    save() {
+      this.$refs.uQRCode.save({
+        success: res => {
+          console.log(res)
+        }
+      })
+    }
+  }
+}
+```
+
+### 高级使用
+
+在 `template` 中创建 `<canvas/>` 并设置 `id`,画布宽高
+
+```html
+<canvas id="qrcode" canvas-id="qrcode" :style="{'width': `${size}px`, 'height': `${size}px`}" />
+```
+
+在 `script` 中引用js文件并调用方法生成矩阵
+
+```javascript
+import uQRCode from '@/uni_modules/Sansnn-uQRCode/components/uqrcode/common/uqrcode.js'
+
+export default {
+  data() {
+    return {
+      size: 256,
+      margin: 10,
+      backgroundColor: '#FFFFFF',
+      foregroundColor: '#000000'
+    }
+  },
+  onReady() {
+    let modules = uQRCode.getModules({
+      text: 'uQRCode 3.0',
+      errorCorrectLevel: uQRCode.errorCorrectLevel.H
+    })
+    let tileSize = (this.size - this.margin * 2) / modules.length
+    // 获取绘图所需的上下文
+    let ctx = uni.createCanvasContext('qrcode', this)
+    // 开始绘制
+    ctx.setFillStyle(this.backgroundColor)
+    ctx.fillRect(0, 0, this.size, this.size)
+    for (var row = 0; row < modules.length; row++) {
+      for (var col = 0; col < modules.length; col++) {
+        // 计算每一个小块的位置
+        var x = col * tileSize + this.margin
+        var y = row * tileSize + this.margin
+        var w = tileSize
+        var h = tileSize
+    
+        var style = modules[row][col] ? this.foregroundColor : this.backgroundColor
+        ctx.setFillStyle(style)
+        ctx.fillRect(x, y, w, h)
+      }
+    }
+    ctx.draw()
+  }
+}
+```
+
+### uqrcode.js 方法说明
+
+|方法名|说明|
+|---|:---|
+|[getModules](#getmodulesoptions)|可以得到二维码矩阵信息,可根据返回的矩阵信息自行实现二维码生成|
+
+### getModules(options)
+
+根据内容得到二维码矩阵信息
+
+|参数							|类型		|必填	|默认值	|说明															|
+|---							|---		|---	|---		|:---															|
+|text							|String	|是		|-			|二维码内容												|
+|errorCorrectLevel|Number	|否		|2			|纠错等级,1/0/3/2分别对应L/M/Q/H	|
+|typeNumber				|Number	|否		|-1			|版本															|
+
+### 常见问题
+**关于高级使用二维码生成不完整**
+
+size的单位是px,请尽量避免使用rpx,如果canvas的单位是rpx,那么不同设备屏幕分辨率不一样,rpx转换成px后的画布尺寸不足以放下全部内容,实际绘制图案超出,就会出现不完整或者没有填充完整画布的情况。
+
+**如何扫码跳转指定网页**
+
+text参数直接放入完整的网页地址即可,例如:`https://ext.dcloud.net.cn/plugin?id=1287`。微信客户端不能是ip地址。
+
+**H5长按识别**
+
+canvas无法长按识别,长按识别需要是图片才行,所以需要先调用`toTempFilePath`方法得到临时路径,再用image组件显示即可。

+ 3 - 1
uview-ui/components/u-calendar/u-calendar.vue

@@ -51,7 +51,7 @@
 					<text v-if="endDate">至{{endDate}}</text>
 				</view>
 				<view class="u-calendar__bottom__btn">
-					<u-button :type="btnType" shape="circle" size="default" @click="btnFix(false)">确定</u-button>
+					<u-button :type="btnType" shape="circle" :custom-style="{background:'#2AA47F',color:'#fff'}" size="default" @click="btnFix(false)">清除</u-button>
 				</view>
 			</view>
 		</view>
@@ -395,8 +395,10 @@
 				if (!this.openDisAbled(this.year, this.month, day)) {
 					this.day = day;
 					let date = `${this.year}-${this.month}-${day}`;
+					// console.log(date);
 					if (this.mode == 'date') {
 						this.activeDate = date;
+						this.$emit('clicktime',date)
 					} else {
 						let compare = new Date(date.replace(/\-/g, '/')).getTime() < new Date(this.startDate.replace(/\-/g, '/')).getTime()
 						if (this.isStart || compare) {

+ 1 - 1
uview-ui/components/u-column-notice/u-column-notice.vue

@@ -20,7 +20,7 @@
 					@tap="click(index)"
 					:class="['u-type-' + type]"
 				>
-					{{ item }}
+					{{ item.advertise_name || '' }}
 				</view>
 			</swiper-item>
 		</swiper>

+ 4 - 3
uview-ui/components/u-upload/u-upload.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="u-upload" v-if="!disabled">
+	<view class="u-upload">
 		<view
 			v-if="showUploadList"
 			class="u-list-item u-preview-wrap"
@@ -31,7 +31,7 @@
 			<image @tap.stop="doPreviewImage(item.url || item.path, index)" class="u-preview-image" v-if="!item.isImage" :src="item.url || item.path" :mode="imageMode"></image>
 		</view>
 		<slot name="file" :file="lists"></slot>
-		<view style="display: inline-block;" @tap="selectFile" v-if="maxCount > lists.length">
+		<view style="display: inline-block;" @tap="selectFile" v-if="maxCount > lists.length && !disabled">
 			<slot name="addBtn"></slot>
 			<view
 				v-if="!customBtn"
@@ -376,6 +376,7 @@ export default {
 			// 全部上传完成
 			if (index >= this.lists.length) {
 				this.$emit('on-uploaded', this.lists, this.index);
+				// uni.hideLoading()
 				return;
 			}
 			// 检查是否是已上传或者正在上传中
@@ -438,7 +439,7 @@ export default {
 					this.uploadError(index, e);
 				},
 				complete: res => {
-					uni.hideLoading();
+					// uni.hideLoading();
 					this.uploading = false;
 					this.uploadFile(index + 1);
 					this.$emit('on-change', res, index, this.lists, this.index);

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff