Quellcode durchsuchen

Merge branch 'master' of http://115.29.66.169:10080/yicangzongtai/share_h5

Fly vor 10 Monaten
Ursprung
Commit
e0ed36267f

+ 6 - 7
.hbuilderx/launch.json

@@ -5,12 +5,11 @@
             "playground" : "standard",
             "type" : "uni-app:app-android"
         },
-	{
-		"app-plus" : 
-		{
-			"launchtype" : "local"
-		},
-		"type" : "uniCloud"
-	}
+        {
+            "app-plus" : {
+                "launchtype" : "local"
+            },
+            "type" : "uniCloud"
+        }
     ]
 }

+ 45 - 60
App.vue

@@ -1,67 +1,52 @@
 <script>
-  export default {
-    globalData: {
-      //全局配置参数 
-      barHeight: 0,
-      screenWidth: 0,
-      screenHeight: 0,
-      viewHeight: 0,
-    },
-    onLaunch: function(options) {
-      console.log("APP----onLaunch", options);
-      if (options.query.code) {
-        uni.setStorageSync('code', options.query.code)
-      }
+	export default {
+		globalData: {
+			//全局配置参数 
+			barHeight: 0,
+			screenWidth: 0,
+			screenHeight: 0,
+			viewHeight: 0,
+		},
+		onLaunch: function(options) {
+			console.log("APP----onLaunch", options);
+			if (options.query.code) {
+				uni.setStorageSync('code', options.query.code)
+			}
 
-      // #ifdef APP-PLUS
-      // App平台检测升级,服务端代码是通过uniCloud的云函数实现的,详情可参考:https://ext.dcloud.net.cn/plugin?id=2226
-      // #endif
-      //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
-      uni.getSystemInfo({
-        success: (res) => {
-          console.log(res)
-          this.globalData.barHeight = res.statusBarHeight;
-          this.globalData.screenWidth = res.screenWidth;
-          this.globalData.screenHeight = res.screenHeight;
-          this.globalData.viewHeight = res.windowHeight
-        }
-      });
-      /**
-       * 校验session_key是否失效
-       * 如果失效,则清空登录态,当需要登录的时候,从login.wxml重新登录
-       */
-      uni.checkSession({
-        success() {
-          // sessionKey有效没有过期
-          console.log("checkSession success");
-        },
-        fail() {
-          // sessionKey已经失效,过期
-          console.log("checkSession fail");
-          // 清空登录所有相关信息
-          // clearLoginStatus();
-        }
-      });
-    },
-    onShow: function() {
-      console.log('App Show')
-    },
-    onHide: function() {
-      console.log('App Hide')
-    },
-    globalData: {
-      test: ''
-    }
-  }
+			// #ifdef APP-PLUS
+			// App平台检测升级,服务端代码是通过uniCloud的云函数实现的,详情可参考:https://ext.dcloud.net.cn/plugin?id=2226
+			// #endif
+			//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
+			uni.getSystemInfo({
+				success: (res) => {
+					this.globalData.barHeight = res.statusBarHeight;
+					this.globalData.screenWidth = res.screenWidth;
+					this.globalData.screenHeight = res.screenHeight;
+					this.globalData.viewHeight = res.windowHeight
+				}
+			});
+		},
+		onShow: function() {
+			console.log('App Show')
+		},
+		onHide: function() {
+			console.log('App Hide')
+		},
+		globalData: {
+			test: ''
+		}
+	}
 </script>
 
 <style lang="scss">
-  /* #ifndef APP-PLUS-NVUE */
-  /* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
-  @import './common/style/uni.css';
-  /* #endif*/
+		@import "uview-ui/index.scss";
+	/* #ifndef APP-PLUS-NVUE */
+	/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
+	@import './common/style/uni.css';
+	/* #endif*/
+	/*每个页面公共css */
 
-  uni-radio .uni-radio-input .uni-radio-input-checked {
-    background: #FF0000 !important;
-  }
+	uni-radio .uni-radio-input .uni-radio-input-checked {
+		background: #FF0000 !important;
+	}
 </style>

+ 216 - 0
common/request/index-shop.js

@@ -0,0 +1,216 @@
+/* eslint-disable */
+import Request from './request-shop';
+import { refreshToken } from '@/api/login';
+import indexConfig from '@/config/global.config.js';
+import mUtil from '@/common/util.js';
+import store from '@/store';
+
+const shopHttp = new Request();
+
+// request全局参数设置
+shopHttp.setConfig(config => {
+	/* 设置全局配置 */
+	config.baseUrl = indexConfig.baseShopUrl; /* 根域名不同 */
+	const systemInfo = uni.getSystemInfoSync();
+	const systemInfoHeaders = {
+		'device-name': systemInfo.brand, // 设备名称
+		width: systemInfo.screenWidth, // 屏幕宽度
+		height: systemInfo.screenHeight, // 屏幕高度
+		os: systemInfo.platform, // 客户端平台
+		'os-version': systemInfo.system // 操作系统版本
+	};
+	config.header = {
+		...config.header,
+		...systemInfoHeaders,
+	};
+	return config;
+});
+
+let isRefreshing = false;
+let requests = [];
+shopHttp.interceptor.request(
+	config => {
+
+		if(config.isToken==false){
+
+		}else{
+			config.header['token'] = uni.getStorageSync('token');
+		}
+		/* 请求之前拦截器 */
+	
+		// config.header['client'] = 'applet';
+		config.header['client'] = 'app';
+		// 单商户
+		// config.header['merchant-id'] = uni.getStorageSync('merchantId') || 1;
+		return config;
+	},
+	error => {
+		return Promise.reject(error);
+	}
+);
+
+// 刷新refreshToken
+async function handleRefreshToken(refresh_token) {
+	const params = {};
+	params.group = mUtil.platformGroupFilter();
+	params.refresh_token = refresh_token;
+	await shopHttp.post(refreshToken, params).then(async r => {
+		store.commit('login', r.data);
+		isRefreshing = false;
+	});
+}
+shopHttp.interceptor.response(
+	async response => {
+		/* 请求之后拦截器 */
+		switch (response.data.code) {
+			case 200:
+				return response.data;
+			case 400:
+				mUtil.toast('错误的请求');
+				return Promise.reject(response.data.message);
+				break;
+			case 50020:
+				uni.removeStorageSync('token');
+				uni.showModal({
+					content: '会话已过期,是否跳转登录页面?',
+					success: confirmRes => {
+						if (confirmRes.confirm) {
+							uni.reLaunch({
+								url:'/pages/research/register/login'
+							})
+						}
+					}
+				});
+			case 50000:
+				isRefreshing = false;
+				if (response.config.url === refreshToken) {
+					uni.removeStorageSync('token');
+					await store.commit('logout');
+					uni.showModal({
+						content: '会话已过期,是否跳转登录页面?',
+						success: confirmRes => {
+							if (confirmRes.confirm) {
+								uni.reLaunch({
+									url:'/pages/research/register/login'
+								})
+							}
+						}
+					});
+					break;
+				} else {
+					// 如果refreshToken为空 则直接跳转登录
+					if (!store.state.refreshToken) {
+						uni.removeStorageSync('token');
+						await store.commit('logout');
+						uni.showModal({
+							content: '会话已过期,是否跳转登录页面?',
+							success: confirmRes => {
+								if (confirmRes.confirm) {
+									uni.reLaunch({
+										url:'/pages/research/register/login'
+									})
+									
+								}
+							}
+						});
+						// throw response.data.message;
+					} else {
+						// isRefreshing同一个页面只执行一次
+						if (!isRefreshing) {
+							isRefreshing = true;
+							// 刷新token
+							await handleRefreshToken(store.state.refreshToken, response);
+							requests.forEach(cb => cb());
+							requests = [];
+							isRefreshing = false;
+							return shopHttp.request(response.config);
+						} else {
+							return new Promise(resolve => {
+								// 将resolve放进队列,用一个函数形式来保存,等token刷新后直接执行
+								requests.push(() => {
+									resolve(shopHttp.request(response.config));
+								});
+							});
+						}
+					}
+				}
+				break;
+			case 20041:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return 
+			case 20047:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return
+			case 20049:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return
+			case 20050:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return 
+			case 20022:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return 
+			case 20057:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return 
+			case 20058:
+				mUtil.toast(response.data.msg);
+				setTimeout(()=>{
+					uni.navigateBack({
+						delta:1
+					})
+				},1000)
+				return 
+			case 405:
+				mUtil.toast(response.data.msg);
+				return Promise.reject(response.data.msg);
+			case 404:
+				mUtil.toast(response.data.msg);
+				return Promise.reject(response.data.msg);
+			case 429:
+				mUtil.toast(response.data.msg);
+				return Promise.reject(response.data.msg);
+			case 500:
+				mUtil.toast(response.data.msg);
+				return Promise.reject(response.data.msg);
+			default:
+				mUtil.toast(response.data.msg);
+				return Promise.reject(response.data.msg);
+		}
+	},
+	error => {
+		return Promise.reject(error);
+	}
+);
+
+export { shopHttp };

+ 1 - 1
common/request/index.js

@@ -21,7 +21,7 @@ http.setConfig(config => {
 	};
 	config.header = {
 		...config.header,
-		...systemInfoHeaders
+		...systemInfoHeaders,
 	};
 	return config;
 });

+ 441 - 0
common/request/request-shop.js

@@ -0,0 +1,441 @@
+/**
+ * Request 1.0.6
+ * @Class Request
+ * @description luch-request 1.0.6 http请求插件
+ * @Author lu-ch
+ * @Date 2020-03-17
+ * @Email webwork.s@qq.com
+ * http://ext.dcloud.net.cn/plugin?id=392
+ */
+export default class Request {
+	config = {
+		baseUrl: '',
+		header: {
+			'content-type': 'application/json'
+		},
+		method: 'GET',
+		dataType: 'json',
+		// #ifndef MP-ALIPAY || APP-PLUS
+		responseType: 'text',
+		// #endif
+		custom: {},
+		// #ifdef MP-ALIPAY
+		timeout: 30000,
+		// #endif
+		// #ifdef APP-PLUS
+		sslVerify: true
+		// #endif
+	};
+
+	static posUrl(url) {
+		/* 判断url是否为绝对路径 */
+		return /(http|https):\/\/([\w.]+\/?)\S*/.test(url);
+	}
+
+	static mergeUrl(url, baseUrl, params) {
+		let mergeUrl = Request.posUrl(url) ? url : `${baseUrl}${url}`;
+		if (Object.keys(params).length !== 0) {
+			const paramsH = Request.addQueryString(params);
+			mergeUrl += mergeUrl.includes('?') ? `&${paramsH}` : `?${paramsH}`;
+		}
+		return mergeUrl;
+	}
+
+	static addQueryString(params) {
+		let paramsData = '';
+		Object.keys(params).forEach(function(key) {
+			paramsData += key + '=' + encodeURIComponent(params[key]) + '&';
+		});
+		return paramsData.substring(0, paramsData.length - 1);
+	}
+
+	/**
+	 * @property {Function} request 请求拦截器
+	 * @property {Function} response 响应拦截器
+	 * @type {{request: Request.interceptor.request, response: Request.interceptor.response}}
+	 */
+	interceptor = {
+		/**
+		 * @param {Request~requestCallback} cb - 请求之前拦截,接收一个函数(config, cancel)=> {return config}。第一个参数为全局config,第二个参数为函数,调用则取消本次请求。
+		 */
+		request: cb => {
+			if (cb) {
+				this.requestBeforeFun = cb;
+			}
+		},
+		/**
+		 * @param {Request~responseCallback} cb 响应拦截器,对响应数据做点什么
+		 * @param {Request~responseErrCallback} ecb 响应拦截器,对响应错误做点什么
+		 */
+		response: (cb, ecb) => {
+			if (cb) {
+				this.requestComFun = cb;
+			}
+			if (ecb) {
+				this.requestComFail = ecb;
+			}
+		}
+	};
+
+	requestBeforeFun(config) {
+		return config;
+	}
+
+	requestComFun(response) {
+		return response;
+	}
+
+	requestComFail(response) {
+		return response;
+	}
+
+	/**
+	 * 自定义验证器,如果返回true 则进入响应拦截器的响应成功函数(resolve),否则进入响应拦截器的响应错误函数(reject)
+	 * @param { Number } statusCode - 请求响应体statusCode(只读)
+	 * @return { Boolean } 如果为true,则 resolve, 否则 reject
+	 */
+	validateStatus(statusCode) {
+		return statusCode === 200;
+	}
+
+	/**
+	 * @Function
+	 * @param {Request~setConfigCallback} f - 设置全局默认配置
+	 */
+	setConfig(f) {
+		this.config = f(this.config);
+	}
+
+	/**
+	 * @Function
+	 * @param {Object} options - 请求配置项
+	 * @prop {String} options.url - 请求路径
+	 * @prop {Object} options.data - 请求参数
+	 * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
+	 * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
+	 * @prop {Object} [options.header = config.header] - 请求header
+	 * @prop {Object} [options.method = config.method] - 请求方法
+	 * @returns {Promise<unknown>}
+	 */
+	async request(options = {}) {
+		options.baseUrl = this.config.baseUrl;
+		options.dataType = options.dataType || this.config.dataType;
+		// #ifndef MP-ALIPAY || APP-PLUS
+		options.responseType = options.responseType || this.config.responseType;
+		// #endif
+		// #ifdef MP-ALIPAY
+		options.timeout = options.timeout || this.config.timeout;
+		// #endif
+		options.url = options.url || '';
+		options.data = options.data || {};
+		options.params = options.params || {};
+		options.header = options.header || this.config.header;
+		options.method = options.method || this.config.method;
+		options.custom = { ...this.config.custom, ...(options.custom || {}) };
+		// #ifdef APP-PLUS
+		options.sslVerify =
+			options.sslVerify === undefined
+				? this.config.sslVerify
+				: options.sslVerify;
+		// #endif
+		options.getTask = options.getTask || this.config.getTask;
+		return new Promise((resolve, reject) => {
+			let next = true;
+			const cancel = (t = 'handle cancel', config = options) => {
+				const err = {
+					errMsg: t,
+					config: config
+				};
+				reject(err);
+				next = false;
+			};
+
+			const handleRe = { ...this.requestBeforeFun(options, cancel) };
+			const _config = { ...handleRe };
+			if (!next) return;
+			const requestTask = uni.request({
+				url: Request.mergeUrl(_config.url, _config.baseUrl, _config.params),
+				data: _config.data,
+				header: _config.header,
+				method: _config.method,
+				// #ifdef MP-ALIPAY
+				timeout: _config.timeout,
+				// #endif
+				dataType: _config.dataType,
+				// #ifndef MP-ALIPAY || APP-PLUS
+				responseType: _config.responseType,
+				// #endif
+				// #ifdef APP-PLUS
+				sslVerify: _config.sslVerify,
+				// #endif
+				complete: response => {
+					response.config = handleRe;
+					if (this.validateStatus(response.statusCode)) {
+						// 成功
+						response = this.requestComFun(response);
+						resolve(response);
+					} else {
+						response = this.requestComFail(response);
+						reject(response);
+					}
+				}
+			});
+			if (handleRe.getTask) {
+				handleRe.getTask(requestTask, handleRe);
+			}
+		});
+	}
+
+	get(url, params = {},isToken) {
+ 
+		return this.request({
+			url,
+			method: 'GET',
+			params,
+			isToken
+		});
+	}
+
+	post(url, data, options = {},isToken) {
+		return this.request({
+			url,
+			data,
+			method: 'POST',
+			...options,
+			isToken
+		});
+	}
+
+	// #ifndef MP-ALIPAY
+	put(url, data, options = {},isToken) {
+		return this.request({
+			url,
+			data,
+			method: 'PUT',
+			...options,
+			isToken
+		});
+	}
+
+	// #endif
+
+	// #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
+	delete(url, data, options = {},isToken) {
+		return this.request({
+			url,
+			data,
+			method: 'DELETE',
+			...options,
+			isToken
+		});
+	}
+
+	// #endif
+
+	// #ifdef APP-PLUS || H5 || MP-WEIXIN
+	connect(url, data, options = {}) {
+		return this.request({
+			url,
+			data,
+			method: 'CONNECT',
+			...options
+		});
+	}
+
+	// #endif
+
+	// #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
+	head(url, data, options = {}) {
+		return this.request({
+			url,
+			data,
+			method: 'HEAD',
+			...options
+		});
+	}
+
+	// #endif
+
+	// #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU
+	options(url, data, options = {}) {
+		return this.request({
+			url,
+			data,
+			method: 'OPTIONS',
+			...options
+		});
+	}
+
+	// #endif
+
+	// #ifdef APP-PLUS || H5 || MP-WEIXIN
+	trace(url, data, options = {}) {
+		return this.request({
+			url,
+			data,
+			method: 'TRACE',
+			...options
+		});
+	}
+
+	// #endif
+
+	upload(
+		url,
+		{
+			// #ifdef APP-PLUS
+			files,
+			// #endif
+			// #ifdef MP-ALIPAY
+			fileType,
+			// #endif
+			filePath,
+			name,
+			header,
+			formData = {},
+			custom = {},
+			params = {},
+			getTask
+		}
+	) {
+		return new Promise((resolve, reject) => {
+			let next = true;
+			const globalHeader = { ...this.config.header };
+			delete globalHeader['content-type'];
+			delete globalHeader['Content-Type'];
+			const pubConfig = {
+				baseUrl: this.config.baseUrl,
+				url,
+				// #ifdef MP-ALIPAY
+				fileType,
+				// #endif
+				filePath,
+				method: 'UPLOAD',
+				name,
+				header: header || globalHeader,
+				formData,
+				params,
+				custom: { ...this.config.custom, ...custom },
+				getTask: getTask || this.config.getTask
+			};
+			// #ifdef APP-PLUS
+			if (files) {
+				pubConfig.files = files;
+			}
+			// #endif
+			const cancel = (t = 'handle cancel', config = pubConfig) => {
+				const err = {
+					errMsg: t,
+					config: config
+				};
+				reject(err);
+				next = false;
+			};
+
+			const handleRe = { ...this.requestBeforeFun(pubConfig, cancel) };
+			const _config = {
+				url: Request.mergeUrl(handleRe.url, handleRe.baseUrl, handleRe.params),
+				// #ifdef MP-ALIPAY
+				fileType: handleRe.fileType,
+				// #endif
+				filePath: handleRe.filePath,
+				name: handleRe.name,
+				header: handleRe.header,
+				formData: handleRe.formData,
+				complete: response => {
+					response.config = handleRe;
+					if (typeof response.data === 'string') {
+						response.data = JSON.parse(response.data);
+					}
+					if (this.validateStatus(response.statusCode)) {
+						// 成功
+						response = this.requestComFun(response);
+						resolve(response);
+					} else {
+						response = this.requestComFail(response);
+						reject(response);
+					}
+				}
+			};
+			// #ifdef APP-PLUS
+			if (handleRe.files) {
+				_config.files = handleRe.files;
+			}
+			// #endif
+			if (!next) return;
+			const requestTask = uni.uploadFile(_config);
+			if (handleRe.getTask) {
+				handleRe.getTask(requestTask, handleRe);
+			}
+		});
+	}
+
+	download(url, options = {}) {
+		return new Promise((resolve, reject) => {
+			let next = true;
+			const pubConfig = {
+				baseUrl: this.config.baseUrl,
+				url,
+				method: 'DOWNLOAD',
+				header: options.header || this.config.header,
+				params: options.params || {},
+				custom: { ...this.config.custom, ...(options.custom || {}) },
+				getTask: options.getTask || this.config.getTask
+			};
+			const cancel = (t = 'handle cancel', config = pubConfig) => {
+				const err = {
+					errMsg: t,
+					config: config
+				};
+				reject(err);
+				next = false;
+			};
+
+			const handleRe = { ...this.requestBeforeFun(pubConfig, cancel) };
+			if (!next) return;
+			const requestTask = uni.downloadFile({
+				url: Request.mergeUrl(handleRe.url, handleRe.baseUrl, handleRe.params),
+				header: handleRe.header,
+				complete: response => {
+					response.config = handleRe;
+					if (this.validateStatus(response.statusCode)) {
+						// 成功
+						response = this.requestComFun(response);
+						resolve(response);
+					} else {
+						response = this.requestComFail(response);
+						reject(response);
+					}
+				}
+			});
+			if (handleRe.getTask) {
+				handleRe.getTask(requestTask, handleRe);
+			}
+		});
+	}
+}
+/**
+ * setConfig回调
+ * @return {Object} - 返回操作后的config
+ * @callback Request~setConfigCallback
+ * @param {Object} config - 全局默认config
+ */
+/**
+ * 请求拦截器回调
+ * @return {Object} - 返回操作后的config
+ * @callback Request~requestCallback
+ * @param {Object} config - 全局config
+ * @param {Function} [cancel] - 取消请求钩子,调用会取消本次请求
+ */
+/**
+ * 响应拦截器回调
+ * @return {Object} - 返回操作后的response
+ * @callback Request~responseCallback
+ * @param {Object} response - 请求结果 response
+ */
+/**
+ * 响应错误拦截器回调
+ * @return {Object} - 返回操作后的response
+ * @callback Request~responseErrCallback
+ * @param {Object} response - 请求结果 response
+ */

+ 11 - 0
common/style/uni.css

@@ -17,6 +17,17 @@
 	-moz-osx-font-smoothing: grayscale;
 }
 
+@font-face {
+  font-family: "iconfont2";
+  /* Project id 3514483 */
+  src: url('@/static/font/iconfont2.woff2') format('woff2'),
+    url('@/static/font/iconfont2.woff') format('woff'),
+    url('@/static/font/iconfont2.ttf') format('truetype');
+}
+.iconfont2 {
+  font-family: "iconfont2";
+}
+
 /*通用 */
 view {
 	font-size: 28rpx;

+ 85 - 0
common/wx/jswx.js

@@ -0,0 +1,85 @@
+import wx from 'weixin-js-sdk'
+import sign from './sign.js'
+
+// const baseWxUrl = "https://api.weixin.qq.com/cgi-bin"
+const baseWxUrl = "https://yigefuwuapp.ycbrain.com/cgi-bin"
+const appId = "wxe7a47acc00b6aa5d";
+const appSecret = "11d94f98e6dd0e09a5b7872fb88fdb91";
+
+const requestFun = ({
+  method = 'GET',
+  url,
+  data
+}) => {
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: baseWxUrl + url, //仅为示例,并非真实接口地址。
+      data: data,
+      method: method,
+      success: (res) => {
+        resolve(res.data)
+      },
+      fail: (err) => {
+        console.log('err=>', err)
+      }
+    });
+  })
+}
+const getWXToken = () => {
+  requestFun({
+    url: '/token',
+    data: {
+      grant_type: 'client_credential',
+      appid: appId,
+      secret: appSecret
+    }
+  }).then(res => {
+    if (res) {
+      getWXJSTicket(res)
+      uni.setStorage({
+        key: 'wx_access_token',
+        data: res.access_token
+      })
+    }
+  })
+}
+const getWXJSTicket = (data) => {
+  requestFun({
+    url: '/ticket/getticket',
+    data: {
+      access_token: data.access_token,
+      type: 'jsapi',
+    }
+  }).then(res => {
+    if (res && res.errmsg == "ok") {
+      uni.setStorage({
+        key: 'wx_js_ticket',
+        data: res.ticket
+      })
+      const initData = sign(res.ticket, location.href.split('#')[0])
+      initWX(initData)
+    }
+  })
+}
+getWXToken()
+
+// 初始化微信配置
+const initWX = (data) => {
+  wx.config({
+    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+    appId: appId, // 必填,公众号的唯一标识
+    timestamp: data.timestamp, // 必填,生成签名的时间戳
+    nonceStr: data.nonceStr, // 必填,生成签名的随机串
+    signature: data.signature, // 必填,签名
+    jsApiList: ['chooseImage', 'checkJsApi'], // 必填,需要使用的JS接口列表
+    openTagList: ['wx-open-launch-app'] // 可选,需要使用的开放标签列表
+  });
+  wx.ready(function(res) {
+    console.log('res===>>', res)
+    // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+  });
+  wx.error(function(error) {
+    console.log('error===>>', error)
+    // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+  });
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
common/wx/jweixin-1.6.0.js


Datei-Diff unterdrückt, da er zu groß ist
+ 34 - 0
common/wx/sha.js


+ 49 - 0
common/wx/sign.js

@@ -0,0 +1,49 @@
+import jsSHA from './sha.js'
+
+const createNonceStr = function() {
+  return Math.random().toString(36).substr(2, 15);
+};
+
+const createTimestamp = function() {
+  return parseInt(new Date().getTime() / 1000) + '';
+};
+
+const raw = function(args) {
+  let keys = Object.keys(args);
+  keys = keys.sort()
+  let newArgs = {};
+  keys.forEach(function(key) {
+    newArgs[key.toLowerCase()] = args[key];
+  });
+
+  let string = '';
+  for (let k in newArgs) {
+    string += '&' + k + '=' + newArgs[k];
+  }
+  string = string.substr(1);
+  return string;
+};
+
+/**
+ * @synopsis 签名算法 
+ *
+ * @param jsapi_ticket 用于签名的 jsapi_ticket
+ * @param url 用于签名的 url ,注意必须动态获取,不能 hardcode
+ *
+ * @returns
+ */
+const sign = function(jsapi_ticket, url) {
+  let ret = {
+    jsapi_ticket: jsapi_ticket,
+    nonceStr: createNonceStr(),
+    timestamp: createTimestamp(),
+    url: url
+  };
+  let string = raw(ret);
+  let shaObj = new jsSHA(string, 'TEXT');
+  ret.signature = shaObj.getHash('SHA-1', 'HEX');
+
+  return ret;
+};
+
+module.exports = sign;

+ 10 - 0
common/wx/util.js

@@ -0,0 +1,10 @@
+export const isWeiXin = () => {
+  const ua = navigator.userAgent.toLowerCase();
+  if (ua.match(/MicroMessenger/i) == "micromessenger") {
+    //在微信中打开
+    console.log('微信');
+    return true
+  } else {
+    return false
+  }
+}

+ 2 - 1
config/global.config.js

@@ -1,7 +1,8 @@
 const CONFIG = {
   assetsPath: '/static', // 静态资源路径
-  // baseUrl: 'http://192.168.0.17:8196/api', // 后台接口请求地址
+  // baseUrl: 'http://192.168.0.151:8196/api', // 后台接口请求地址
   baseUrl: 'https://yigefuwuapp.ycbrain.com/prod-api/api', // 后台接口请求地址
+  baseShopUrl: 'https://yigefuwuapp.ycbrain.com/shop-api/api',
   telRegex: "^(1)\\d{10}$", //手机正则
   mailVerify: "^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$",
 };

+ 22 - 13
main.js

@@ -6,15 +6,20 @@ import store from './store'
 import $mAssetsPath from '@/config/assets.config.js';
 import $mConfig from '@/config/global.config.js';
 // 引入全局方法
-import { http } from '@/common/request';
+import {
+  http
+} from '@/common/request/index.js';
+import {
+  shopHttp
+} from '@/common/request/index-shop.js';
 import $mUtil from '@/common/util.js';
 // 全局组件
-import navbar from '@/components/hx-navbar/hx-navbar.nvue';	
+import navbar from '@/components/hx-navbar/hx-navbar.nvue';
 import ldLoading from '@/components/ld-loading/index.vue';
 import nodata from '@/components/noData/nodata.vue';
 import loadMore from '@/components/uni-load-more/uni-load-more.vue';
 import Directives from './directives/index.js';
-
+import '@/common/wx/jswx.js'
 // 网络状态监听
 // uni.getNetworkType({
 // 	success: res => {
@@ -27,9 +32,11 @@ import Directives from './directives/index.js';
 // 	store.dispatch('networkStateChange', res.networkType);
 // });
 
+Vue.config.ignoredElements.push('wx-open-launch-app')
 if (process.env.NODE_ENV === 'production') {
-	Vue.config.productionTip = false;
-	Vue.config.ignoredElements.push('wx-open-launch-weapp')
+  Vue.config.productionTip = false;
+  Vue.config.ignoredElements.push('wx-open-launch-app')
+  // Vue.config.ignoredElements.push('wx-open-launch-weapp')
 }
 
 
@@ -38,19 +45,22 @@ Vue.prototype.$store = store
 Vue.prototype.$adpid = ""
 
 Vue.prototype.$http = http;
+Vue.prototype.$shopHttp = shopHttp;
 Vue.prototype.$mConfig = $mConfig;
 Vue.prototype.$mAssetsPath = $mAssetsPath;
 Vue.prototype.$mUtil = $mUtil;
-Vue.component('navbar',navbar);
+Vue.component('navbar', navbar);
 Vue.component('ldLoading', ldLoading);
-Vue.component('nodata',nodata);
-Vue.component('loadMore',loadMore);
+Vue.component('nodata', nodata);
+Vue.component('loadMore', loadMore);
 App.mpType = 'app'
+import uView from "uview-ui";
+Vue.use(uView);
 
 Vue.use(Directives);
 // 保留小数点后两位
 Vue.filter('keepTwo', value => {
-  return  (Math.floor((value || 0) * 100) / 100).toFixed(2);
+  return (Math.floor((value || 0) * 100) / 100).toFixed(2);
 });
 
 // import Vue from 'vue'
@@ -58,9 +68,8 @@ Vue.filter('keepTwo', value => {
  * 注册指令
  */
 
-
 const app = new Vue({
-	store,
-	...App
+  store,
+  ...App
 })
-app.$mount()
+app.$mount()

+ 22 - 3
manifest.json

@@ -2,8 +2,8 @@
     "name" : "宜格分享",
     "appid" : "__UNI__90011BF",
     "description" : "应用描述",
-    "versionName" : "1.0.2",
-    "versionCode" : 102,
+    "versionName" : "1.2.0",
+    "versionCode" : 120,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -142,6 +142,9 @@
             "mode" : "hash",
             "base" : "/yige-h5/"
         },
+        "contentSecurityPolicy" : {
+            "frame-src" : "https://*.qq.com webcompt:"
+        },
         "sdkConfigs" : {
             "maps" : {
                 "qqmap" : {
@@ -155,7 +158,23 @@
         "title" : "宜格服务",
         "devServer" : {
             "https" : false,
-            "port" : 8084
+            "port" : 8084,
+            "proxy" : {
+                "/api" : {
+                    "target" : "https://yigefuwuapp.ycbrain.com/shop-api",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/api" : ""
+                    }
+                },
+                "/wxapi" : {
+                    "target" : "https://yigefuwuapp.ycbrain.com",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/wxapi" : ""
+                    }
+                }
+            }
         },
         "optimization" : {
             "treeShaking" : {

Datei-Diff unterdrückt, da er zu groß ist
+ 528 - 788
package-lock.json


+ 2 - 1
package.json

@@ -15,6 +15,7 @@
     "dependencies": {
         "clipboard": "^2.0.6",
         "lite-server": "^2.6.1",
-        "weixin-js-sdk": "^1.6.0"
+        "uview-ui": "^2.0.36",
+        "weixin-js-sdk": "^1.6.5"
     }
 }

+ 24 - 7
pages.json

@@ -1,4 +1,7 @@
 {
+	"easycom": {
+			"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+		},
 	"pages": [
 		// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
@@ -22,13 +25,13 @@
 				"navigationStyle": "custom"
 			}
 		},
-		// {
-		//   "path": "pages/index",
-		//   "style": {
-		//     "navigationBarTitleText": "松河生活商城",
-		//     "navigationStyle": "custom"
-		//   }
-		// },
+		{
+		  "path": "pages/index",
+		  "style": {
+		    "navigationBarTitleText": "宜格优选",
+		    "navigationStyle": "custom"
+		  }
+		},
 		// {
 		//   "path": "pages/register",
 		//   "style": {
@@ -56,6 +59,20 @@
 				"navigationBarTitleText": "咨询电话",
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/yigePayCenter",
+			"style": {
+				"navigationBarTitleText": "宜格收银台",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/yigePay",
+			"style": {
+				"navigationBarTitleText": "I宜昌统一支付管理平台",
+				"navigationStyle": "custom"
+			}
 		}
 		// {
 		// 	"path":"pages/login",

+ 186 - 183
pages/down.vue

@@ -1,148 +1,149 @@
 <template>
-	<view class="bg">
-		<!-- <navbar backColor="#fff" :config="config"></navbar> -->
-		<!-- v-if="showHint" -->
-		<view class="view-alert" v-if="showHint">
-			<view class="alert-text">
-				点击右上角按钮,然后在弹出的菜单中,点击在浏览器中打开,即可下载安装
-			</view>
-			<image class="alert-arrow" src="../static/alert-arrow.png" mode="aspectFit"></image>
-		</view>
-
-		<view class="top-box">
-			<image src="/static/down/downApps.png" mode="aspectFit" class="logo"></image>
-		</view>
-		<view class="btn-row">
-			<button class="btn" @click="downLoad(0)">
-				<image src="/static/login/btn_01.png" mode="aspectFit" class="logo"></image>
-				<text>安卓下载</text>
-			</button>
-			<button class="btn" @click="downLoad(1)">
-				<image src="/static/login/btn_02.png" mode="aspectFit" class="logo"></image>
-				<text>IOS下载</text>
-			</button>
-			<!-- <view class="" style="width: 100%; height: 30rpx;">
-
-			</view> -->
-			<button class="btn pdr0" @click.stop="onWeChat()">
-				<image src="/static/login/btn_03.png" mode="aspectFit" class="logo"></image>
-				<text>宜格服务小程序</text>
-			</button>
-
-
-		</view>
-	</view>
+  <view class="bg">
+    <!-- <navbar backColor="#fff" :config="config"></navbar> -->
+    <!-- v-if="showHint" -->
+    <view class="view-alert" v-if="showHint">
+      <view class="alert-text">
+        点击右上角按钮,然后在弹出的菜单中,点击在浏览器中打开,即可下载安装
+      </view>
+      <image class="alert-arrow" src="../static/alert-arrow.png" mode="aspectFit"></image>
+    </view>
+
+    <view class="top-box">
+      <image src="/static/down/downApps.png" mode="aspectFit" class="logo"></image>
+    </view>
+    <view class="btn-row">
+      <button class="btn" @click="downLoad(0)" v-if="osName == 'android'">
+        <image src="/static/login/btn_01.png" mode="aspectFit" class="logo"></image>
+        <text>安卓下载</text>
+      </button>
+      <button class="btn" @click="downLoad(1)" v-if="osName == 'ios'">
+        <image src="/static/login/btn_02.png" mode="aspectFit" class="logo"></image>
+        <text>IOS下载</text>
+      </button>
+      <button class="btn pdr0" @click.stop="onWeChat()">
+        <image src="/static/login/btn_03.png" mode="aspectFit" class="logo"></image>
+        <text>宜格服务小程序</text>
+      </button>
+    </view>
+  </view>
 </template>
 <script>
-	export default {
-		data() {
-			return {
-				config: {
-					back: true, //false是tolbar页面 是则不写
-					title: '"宜格服务"懂宜昌,更懂你!',
-					color: "#1A1A1A",
-					//背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
-					backgroundColor: [1, "#fff"],
-					statusBarFontColor: "#1A1A1A",
-				},
-				appInfo: null,
-				showHint: false
-			};
-		},
-		onLoad(options) {
-			// const ua = navigator.userAgent.toLowerCase()
-			// const isWeixin = ua.indexOf('micromessenger') != -1;
-			// this.showHint = isWeixin
-		},
-
-		methods: {
-			getData(type) {
-				
-				this.$http.get("/app/version/newest", {
-					type: type
-				}).then((res) => {
-					if (res && res.data && res.code == 200) {
-						window.location.href = res.data.downloadLink
-					} else {
-						this.$mUtil.toast("暂无下载地址")
-					}
-				});
-			},
-			downLoad(type) {
-				const ua = navigator.userAgent.toLowerCase()
-				const isWeixin = ua.indexOf('micromessenger') != -1;
-				if(isWeixin){
-					this.showHint = isWeixin;
-					uni.pageScrollTo({
-						scrollTop:0
-					})
-				}else{
-					this.getData(type)
-				}
-			},
-			onWeChat() {
-				location.href='weixin://dl/business/?appid=wxe67b047223bd1446&path=pages/homeQX/index'
-			},
-
-		},
-	};
+  export default {
+    data() {
+      return {
+        config: {
+          back: true, //false是tolbar页面 是则不写
+          title: '"宜格服务"懂宜昌,更懂你!',
+          color: "#1A1A1A",
+          //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
+          backgroundColor: [1, "#fff"],
+          statusBarFontColor: "#1A1A1A",
+        },
+        appInfo: null,
+        showHint: false,
+        osName: uni.getSystemInfoSync().osName
+      };
+    },
+    onLoad(options) {
+      this.osName = uni.getSystemInfoSync().osName
+      // const ua = navigator.userAgent.toLowerCase()
+      // const isWeixin = ua.indexOf('micromessenger') != -1;
+      // this.showHint = isWeixin
+    },
+
+    methods: {
+      getData(type) {
+        this.$http.get("/app/version/newest", {
+          type: type
+        }).then((res) => {
+          if (res && res.data && res.code == 200) {
+            try {
+              if (type == 0) {
+                window.location = "ygfwUrlSchemes://"
+              }
+            } catch (e) {}
+            window.location.href = res.data.downloadLink;
+          } else {
+            this.$mUtil.toast("暂无下载地址")
+          }
+        });
+      },
+      downLoad(type) {
+        const ua = navigator.userAgent.toLowerCase()
+        const isWeixin = ua.indexOf('micromessenger') != -1;
+        if (isWeixin) {
+          this.showHint = isWeixin;
+          uni.pageScrollTo({
+            scrollTop: 0
+          })
+        } else {
+          this.getData(type)
+        }
+      },
+      onWeChat() {
+        location.href = 'weixin://dl/business/?appid=wxe67b047223bd1446&path=pages/homeQX/index'
+      },
+
+    },
+  };
 </script>
 <style>
-	page {
-		width: 750rpx;
-		min-height: 100vh;
-		overflow: hidden;
-	}
+  page {
+    width: 750rpx;
+    min-height: 100vh;
+    overflow: hidden;
+  }
 </style>
 <style lang='scss' scopd>
-	* {
-		padding: 0;
-		margin: 0;
-	}
+  * {
+    padding: 0;
+    margin: 0;
+  }
 
-	.view-alert {
-		/* position: absolute;
+  .view-alert {
+    /* position: absolute;
 		left: 0;
 		top: 0;
 		z-index: 9; */
-		width: 750rpx;
-		background: rgb(52, 52, 52);
-		margin-left: 0px;
-		margin-right: 0px;
-		padding: 60rpx 30rpx 60rpx 60rpx;
-		box-shadow: rgba(22, 22, 23, 0.62) 0px -10px 16px inset;
-		display: flex;
-		justify-content: space-between;
-		align-items: stretch;
-		box-sizing: border-box;
-
-		.alert-text {
-			flex: 1;
-			color: #7f7e7e;
-			font-weight: 400 !important;
-			padding-right: 60rpx;
-			line-height: 1.5;
-		}
-
-		.alert-arrow {
-			flex-shrink: 0;
-			width: 60rpx;
-			height: 60rpx;
-			margin-top: -30rpx;
-		}
-	}
-
-	.bg {
-		width: 100%;
-		min-height: 100vh;
-
-		background: url('../static/down/downBG.png') no-repeat top center;
-		background-size: 100% 100%;
-		padding-bottom: 118rpx;
-	}
-
-	.top-box {
-		/* 	position: absolute;
+    width: 750rpx;
+    background: rgb(52, 52, 52);
+    margin-left: 0px;
+    margin-right: 0px;
+    padding: 60rpx 30rpx 60rpx 60rpx;
+    box-shadow: rgba(22, 22, 23, 0.62) 0px -10px 16px inset;
+    display: flex;
+    justify-content: space-between;
+    align-items: stretch;
+    box-sizing: border-box;
+
+    .alert-text {
+      flex: 1;
+      color: #7f7e7e;
+      font-weight: 400 !important;
+      padding-right: 60rpx;
+      line-height: 1.5;
+    }
+
+    .alert-arrow {
+      flex-shrink: 0;
+      width: 60rpx;
+      height: 60rpx;
+      margin-top: -30rpx;
+    }
+  }
+
+  .bg {
+    width: 100%;
+    min-height: 100vh;
+
+    background: url('../static/down/downBG.png') no-repeat top center;
+    background-size: 100% 100%;
+    padding-bottom: 118rpx;
+  }
+
+  .top-box {
+    /* 	position: absolute;
 		display: flex;
 		width: 100%;
 		align-items: center;
@@ -150,57 +151,59 @@
 		top: 400rpx;
 		left: 50%;
 		transform: translateX(-50%); */
-		/* margin: 117rpx auto; */
-		padding: 117rpx 74px 0 44rpx;
-		width: 632rpx;
-
-		.logo {
-			width: 632rpx;
-			height: 993rpx;
-		}
-	}
-
-	.btn-row {
-		display: flex;
-		width: 100%;
-		justify-content: space-around;
-		flex-direction: column;
-		align-items: center;
-		/* position: fixed; */
-		/* 
+    /* margin: 117rpx auto; */
+    padding: 117rpx 74px 0 44rpx;
+    width: 632rpx;
+
+    .logo {
+      width: 632rpx;
+      height: 993rpx;
+    }
+  }
+
+  .btn-row {
+    display: flex;
+    width: 100%;
+    justify-content: space-around;
+    flex-direction: column;
+    align-items: center;
+    /* position: fixed; */
+    /* 
 		bottom: 400rpx;
 		left: 50%;
 		transform: translateX(-50%); */
 
-		.btn {
-			border-radius: 60rpx;
-			width: 401rpx;
-			height: 97rpx;
-			background: linear-gradient(189deg, #a7f4ff 0%, #45e3ff 100%), #edf4fc;
-			border-radius: 20rpx;
-			margin-top: 49rpx;
-			display: flex;
-			align-items: center;
-			/* justify-content: center; */
-			font-family: AlimamaShuHeiTi, AlimamaShuHeiTi-Bold;
-			font-weight: 700;
-			color: #333333;
-			padding: 0 34rpx 0 54rpx;
-
-			image {
-				flex-shrink: 0;
-				width: 60rpx;
-				height: 60rpx;
-				/* margin-right: 10rpx; */
-			}
-
-			text {
-				flex: 1;
-				text-align: center;
-			}
-		}
-	}
-	.pdr0{
-		padding-right: 0 !important;
-	}
+    .btn {
+      border-radius: 60rpx;
+      width: 401rpx;
+      height: 97rpx;
+      /* background: linear-gradient(189deg, #a7f4ff 0%, #45e3ff 100%), #edf4fc; */
+      background: linear-gradient(189deg, #bbfdbd 0%, #a4f0a4 100%), #edf4fc;
+      border-radius: 20rpx;
+      margin-top: 49rpx;
+      display: flex;
+      align-items: center;
+      /* justify-content: center; */
+      font-family: AlimamaShuHeiTi, AlimamaShuHeiTi-Bold;
+      font-weight: 700;
+      color: #333333;
+      padding: 0 34rpx 0 54rpx;
+
+      image {
+        flex-shrink: 0;
+        width: 60rpx;
+        height: 60rpx;
+        /* margin-right: 10rpx; */
+      }
+
+      text {
+        flex: 1;
+        text-align: center;
+      }
+    }
+  }
+
+  .pdr0 {
+    padding-right: 0 !important;
+  }
 </style>

+ 527 - 47
pages/goods.vue

@@ -1,6 +1,11 @@
 <template>
   <view class="container">
-
+    <view class="view-alert" v-if="showHint">
+      <view class="alert-text">
+        点击右上角按钮,然后在弹出的菜单中,点击在浏览器中打开。
+      </view>
+      <image class="alert-arrow" src="../static/alert-arrow.png" mode="aspectFit"></image>
+    </view>
     <view class="product">
       <view class="u-bg-fff pb40">
         <view class="pic">
@@ -47,7 +52,7 @@
             </view>
           </view>
 
-          <view class="mt80 u-plr30">
+          <view class="mt30 u-plr30">
             <view>
               <text class="u-font34 u-bold u-1A1A1A">{{ dataForm.title }}</text>
             </view>
@@ -83,28 +88,109 @@
           <!-- <view class="iconfont">&#xe6c7;</view> -->
         </view>
       </view>
+
+      <view class="u-bg-fff u-mt10">
+        <view class="tab u-flex-center-sa u-font30 u-1A1A1A u-border-one-one"
+          :style="`top: calc(${statusBarHeight}px + 44px)`">
+          <view @tap="change(0)" class="pb30" :class="{ active: isChecked == 0 }">商品详情</view>
+          <view @tap="change(1)" class="pb30" :class="{ active: isChecked == 1 }">
+            用户评论({{ commentList.length }})</view>
+        </view>
+        <view class="u-mt10">
+          <!--商品详情-->
+          <view v-if="isChecked == 0">
+            <view class="richText ql-editor-box">
+              <rich-text :nodes="goodsInfo.mobile_detail"></rich-text>
+            </view>
+          </view>
+          <!--评论-->
+          <view class="u-plr30" v-else>
+            <comment :value="commentList"></comment>
+          </view>
+        </view>
+      </view>
     </view>
 
     <view class="bottom-btn u-bg-fff">
       <view class="pt-pb30 u-plr30 u-flex-center-sb">
+        <view class="leftbox">
+          <button @click="handleTip()" class="u-text-center goods-tools">
+            <view class="iconfont2 u-font44 u-999">&#xe684;</view>
+            <view class="u-font28 u-1A1A1A">分享</view>
+          </button>
+          <view class="goods-tools service" @click="handleTip()">
+            <image src="@/static/kefu.png" mode="aspectFill"></image>
+            <view class="u-font28 u-1A1A1A">客服</view>
+          </view>
+          <view class="cart" @click="handleTip()">
+            <view class="u-text-center goods-tools">
+              <view class="iconfont2 car-icon u-font44 u-999">&#xe600;</view>
+              <view class="u-font28 u-1A1A1A">购物车</view>
+            </view>
+          </view>
+        </view>
+        <!--普通商品-->
         <view class="u-flex-center">
-          <button class="buy-btn u-DCCDA4 u-font30" @click="open(0)">
-            查看更多
-          </button> <button class="buy-btn u-DCCDA4 u-font30" @click="open(1)">
-            下载App
+          <button class="cart-btn u-font30" @click="handleTip()" v-if="dataForm.area_feature != 1">
+            加入购物车
+          </button>
+          <button class="buy-btn u-font30" @click="handleTip()">
+            立即购买
           </button>
         </view>
-
       </view>
     </view>
 
+    <view v-if="!isWeiXin" class="jump-box" @click="openApp">
+      <image class="logo-img" src="/static/logo.png" mode="aspectFill"></image>
+      <view class="tip">打开宜格服务APP</view>
+    </view>
+
+    <view class="wx-open" v-else>
+      <wx-open-launch-app id="launch-btn" appid="wx2cbf40f5fffa9e80" :extinfo="queryPath" @launch="launchApp"
+        @error="errorApp">
+        <script type="text/wxtag-template">
+          <style>
+            .btn { 
+							border: none;
+              /* width: 150px; */
+              height: 40px;
+              padding: 0 15px;
+              color: #fff;
+              background-color: #6be5f8;
+              border-radius: 20px;
+							display: flex;
+              justify-content: center;
+							align-items: center;
+              text-align: center;
+              font-size: 14px;
+            }
+						.logo-img {
+						  width: 20px;
+						  height: 20px;
+						  margin-right: 5px;
+						  box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
+						}
+          </style>
+          <button class="btn">
+						<image class="logo-img" src="https://yigefuwuapp.ycbrain.com/ycimg/logo.png" mode="aspectFill"></image>
+						<text>打开宜格服务APP</text>
+					</button>
+        </script>
+      </wx-open-launch-app>
+    </view>
+
     <ldLoading isFullScreen :active="loading"></ldLoading>
   </view>
 </template>
 
 <script>
+  import comment from "@/components/ld-comment/ld-comment.vue";
+	import { isWeiXin } from "@/common/wx/util.js"
   export default {
-    components: {},
+    components: {
+      comment
+    },
     data() {
       return {
         config: {
@@ -116,6 +202,8 @@
           statusBarFontColor: "#FFFFFF",
           backTabPage: "",
         },
+        //手机状态栏高度
+        statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
         imglist: [], //详情图片数组
         dataForm: {}, //商品详情
         shop: {}, //店铺信息
@@ -124,6 +212,13 @@
         btnText: "打开App",
         time1: [0, 0, 0, 0],
         type: null,
+        commentList: [],
+        isChecked: 0,
+        goodsInfo: {},
+        timer: null,
+        showHint: false,
+        queryPath: null,
+				isWeiXin: isWeiXin()
       };
     },
     props: {
@@ -138,7 +233,11 @@
       },
     },
     created() {
+			// console.log(isWeiXin(),"=============")
       this.type = this.options.type;
+      this.queryPath = `jumpType=goods&goodsType=${this.options.type}&goodsId=${this.options.id}`
+      // alert('res=>' + uni.getStorageSync('wx_access_token'))
+      // alert('res=>' + uni.getStorageSync('wx_js_ticket'))
       if ((this.options.type == 1 || this.options.type == 5) && this.options.id) {
         this.getDefaultDetailInfo(this.options.id);
       }
@@ -151,25 +250,113 @@
       if (this.options.type == 4 && this.options.id) {
         this.getserviceDetailInfo(this.options.id);
       }
+      this.goodsDetail(this.options.id)
+      this.loadComment(this.options.id);
+    },
+    onShow() {
+      document.addEventListener("visibilitychange", function() {
+        if (that.timer) {
+          that.opening = false
+          clearTimeout(that.timer)
+        }
+      }, false);
     },
-    onShow() {},
     onLoad(options) {},
 
     methods: {
-      open(number) {
-        if (number == 0) {
-          window.location.href = "lida://&pageType=1&type=" + this.type + "&id=" + this.goodsId + "&shareId=" + this
-            .options.shareId + '&teamId=' + this.options.teamId;
+      launchApp(e) {
+        console.log(e, 1111)
+      },
+      errorApp(e) {
+				// alert(e + 1111111111111)
+        console.log(e, 2222)
+				uni.navigateTo({
+					url: "/pages/down"
+				})
+      },
+      openApp() {
+        const ua = navigator.userAgent.toLowerCase()
+        const isWeixin = ua.indexOf('micromessenger') != -1;
+        if (isWeixin) {
+          this.showHint = isWeixin;
+          uni.pageScrollTo({
+            scrollTop: 0
+          })
         } else {
-          uni.navigateTo({
-            url: "/pages/down",
-          });
+          const osName = uni.getSystemInfoSync().osName
+          if (osName == 'android') {
+            this.getData(0)
+          } else {
+            this.getData(1)
+          }
         }
       },
+      getData(type) {
+        this.$http.get("/app/version/newest", {
+          type: type
+        }).then((res) => {
+          if (res && res.data && res.code == 200) {
+            // try {
+            //   if (type == 0) {
+            //     window.location = "ygfwUrlSchemes://"
+            //   }
+            // } catch (e) {}
+            // window.location.href = res.data.downloadLink;
+            this.browserOpenApp(type, res.data.downloadLink)
+          } else {
+            this.$mUtil.toast("暂无下载地址")
+          }
+        });
+      },
+      browserOpenApp(type, url) {
+        let that = this
+        that.opening = true
+        let params = JSON.stringify({
+          goodsTypeJump: that.options.type,
+          goodsIdJump: that.options.id
+        })
+        let schemeUrl = `ygfwUrlSchemes://jumpType=goods&goodsType=${that.options.type}&goodsId=${that.options.id}`
+        if (type == 0) { //  安卓处理
+          let ifr = document.createElement('iframe');
+          ifr.src = schemeUrl;
+          ifr.style.display = 'none';
+          document.body.appendChild(ifr);
+          that.timer = window.setTimeout(function() { //  未安装的情况
+            that.opening = false
+            document.body.removeChild(ifr);
+            //  提示下载
+            let r = confirm("未安装APP? 是否去下载页下载!")
+            if (r) {
+              uni.navigateTo({
+                url: '/pages/down'
+              })
+            }
+          }, 5000)
+        } else { //  IOS处理
+          window.location = schemeUrl
+          that.timer = setTimeout(function() { //  未安装的情况
+            that.opening = false
+            //  跳转app store
+            let r = confirm("未安装APP? 是否去下载页下载!")
+            if (r) {
+              uni.navigateTo({
+                url: '/pages/down'
+              })
+            }
+          }, 5000);
+        }
+      },
+      handleTip() {
+        uni.showToast({
+          title: '请前往宜格服务APP操作!',
+          icon: 'none',
+          duration: 2000
+        })
+      },
 
       // 获取主页数据
       getIndexList(shopid) {
-        this.$http.get("/yxt/shop/info/" + shopid).then((res) => {
+        this.$shopHttp.get("/yxt/shop/info/" + shopid).then((res) => {
           uni.stopPullDownRefresh();
           this.loading = false;
           if (res.data && res.code == 200) {
@@ -180,7 +367,7 @@
 
       //普通商品
       getDefaultDetailInfo(id) {
-        this.$http.get("/goods/info/" + id).then((res) => {
+        this.$shopHttp.get("/goods/info/" + id).then((res) => {
           this.loading = false;
           if (res && res.code == 200) {
             this.dataForm = res.data;
@@ -198,7 +385,7 @@
       },
       /**组团商品*/
       getGroupsDetailInfo(id) {
-        this.$http.get("/groupbuy/activitygoods/goodsInfo/" + id).then((res) => {
+        this.$shopHttp.get("/groupbuy/activitygoods/goodsInfo/" + id).then((res) => {
           this.loading = false;
 
           if (res && res.code == 200) {
@@ -222,14 +409,14 @@
         });
       },
       getSeckillDetail(id) {
-        this.$http
+        this.$shopHttp
           .get("/marketing/seckillActivityGoods/info/" + id)
           .then((res) => {
             this.loading = false;
             if (res && res.code == 200) {
               this.dataForm = res.data;
               this.goodsId = res.data.id;
-              this.$http.get("/yxt/shop/info/" + res.data.shop_id).then((res) => {
+              this.$shopHttp.get("/yxt/shop/info/" + res.data.shop_id).then((res) => {
                 if (res.data && res.code == 200) {
                   this.shop = res.data;
                 }
@@ -249,7 +436,7 @@
           });
       },
       getserviceDetailInfo(id) {
-        this.$http.get("/service/goods/info/" + id).then((res) => {
+        this.$shopHttp.get("/service/goods/info/" + id).then((res) => {
           this.loading = false;
           if (res && res.code == 200) {
             this.dataForm = res.data;
@@ -262,6 +449,30 @@
           }
         });
       },
+      /**
+       * 详情
+       * */
+      goodsDetail(id) {
+        this.$shopHttp.get(`/goods/content/${id}`).then((res) => {
+          if (res && res.code == 200) {
+            this.goodsInfo = res.data;
+          }
+        });
+      },
+      /*评论*/
+      loadComment(id) {
+        this.$shopHttp
+          .get(`/comment/orderGoods/getgoodscomments/${id}`)
+          .then((res) => {
+            if (res && res.code == 200) {
+              this.commentList = res.list;
+            }
+          });
+      },
+      //评论,商品详情切换
+      change(i) {
+        this.isChecked = i;
+      },
     },
   };
 </script>
@@ -342,8 +553,8 @@
     background-color: #fff6ee;
   }
 
-  .mt80 {
-    margin-top: 80rpx;
+  .mt30 {
+    margin-top: 30rpx;
   }
 
   .product {
@@ -355,16 +566,16 @@
     position: relative;
 
     .swiper {
-      height: 620rpx;
+      height: 700rpx;
 
       video {
         width: 100%;
-        height: 620rpx;
+        height: 700rpx;
       }
 
       image {
         width: 100%;
-        height: 620rpx;
+        height: 700rpx;
       }
     }
 
@@ -372,14 +583,13 @@
       width: 100%;
       position: absolute;
       top: 580rpx;
-      background: linear-gradient(left, #00321e, #284534);
-      border-radius: 20rpx 20rpx 0px 0px;
+      background: #FA6138;
       position: relative;
       top: 0px;
-      z-index: 9999;
+      z-index: 9;
 
       .discount {
-        color: #89a895;
+        color: #ffffff;
       }
 
       .p-ab {
@@ -392,6 +602,116 @@
 
   .richText {
     padding: 30rpx;
+
+    /deep/ img {
+      margin-top: 0 !important;
+      vertical-align: middle;
+    }
+  }
+
+  // 富文本展示
+  .ql-editor-box {
+    text-align: justify;
+
+    /deep/ .ql-indent-1 {
+      margin-left: 96rpx;
+    }
+
+    /deep/ .ql-indent-2 {
+      margin-left: 192rpx;
+    }
+
+    /deep/ .ql-indent-3 {
+      margin-left: 288rpx;
+    }
+
+    /deep/ .ql-indent-4 {
+      margin-left: 384rpx;
+    }
+
+    /deep/ .ql-indent-5 {
+      margin-left: 480rpx;
+    }
+
+    /deep/ .ql-indent-6 {
+      margin-left: 576rpx;
+    }
+
+    /deep/ .ql-indent-7 {
+      margin-left: 672rpx;
+    }
+
+    /deep/ .ql-indent-8 {
+      margin-left: 768rpx;
+    }
+
+    /deep/ img {
+      max-width: 100%;
+    }
+
+    /deep/ .ql-align-center {
+      text-align: center;
+    }
+
+    /deep/ .ql-align-right {
+      text-align: right;
+    }
+
+    /deep/ blockquote {
+      display: block;
+      border-left: 8px solid #d0e5f2;
+      padding: 5px 10px;
+      margin: 10px 0;
+      line-height: 1.4;
+      font-size: 100%;
+      background-color: #f1f1f1;
+    }
+
+    /deep/ .ql-indent-1 {
+      margin-left: 60rpx;
+    }
+
+    /deep/ .ql-indent-2 {
+      margin-left: 120rpx;
+    }
+
+    /deep/ .ql-indent-3 {
+      margin-left: 180rpx;
+    }
+
+    /deep/ .ql-indent-4 {
+      margin-left: 240rpx;
+    }
+
+    /deep/ .ql-indent-5 {
+      margin-left: 300rpx;
+    }
+
+    /deep/ .ql-size-huge {
+      font-size: 80rpx;
+      display: inline-block;
+      line-height: 90rpx;
+    }
+
+    /deep/ .ql-size-large {
+      font-size: 48rpx;
+      display: inline-block;
+      line-height: 50rpx;
+    }
+
+    /deep/ .ql-size-small {
+      font-size: 24rpx;
+      display: inline-block;
+      line-height: 30rpx;
+    }
+
+    /deep/ .ql-font-serif {
+      font-family: Georgia, Times New Roman, serif;
+    }
+
+    /deep/ .ql-font-monospace {
+      font-family: Monaco, Courier New, monospace;
+    }
   }
 
   //秒杀,拼团样式
@@ -407,12 +727,12 @@
   .triangle-bottomright {
     width: 0;
     height: 0;
-    border-bottom: 108rpx solid #dccda4;
+    border-bottom: 108rpx solid #FA6138;
     border-left: 60rpx solid transparent;
   }
 
   .seckill {
-    background-color: #dccda4;
+    background-color: #FA6138;
     color: #00321e;
     padding: 16rpx;
     padding-right: 28rpx;
@@ -438,7 +758,7 @@
   }
 
   .btn-bg-dccda4 {
-    background: #dccda4;
+    background: #FA6138;
     border-radius: 48rpx 0rpx 0rpx 48rpx;
   }
 
@@ -448,13 +768,36 @@
   }
 
   .tab {
+    position: sticky;
+    top: 0;
+    background-color: #fff;
     padding-top: 38rpx;
+    z-index: 9;
+
+    .pb30 {
+      position: relative;
+
+      &::before {
+        content: '';
+        position: absolute;
+        left: 50%;
+        bottom: 0;
+        transform: translateX(-50%);
+        width: 0;
+        height: 2px;
+        background: #FA6138;
+        transition: all 0.3s;
+      }
+
+      &.active {
+        font-size: 30rpx;
+        color: #FA6138;
+        font-weight: 700;
 
-    .active {
-      font-size: 30rpx;
-      color: #00321e;
-      font-weight: 700;
-      border-bottom: 1rpx solid #00321e;
+        &::before {
+          width: 100%;
+        }
+      }
     }
   }
 
@@ -462,11 +805,52 @@
     width: 100%;
     position: fixed;
     bottom: 0;
+    z-index: 9;
     border-top: 1rpx solid #e6e6e6;
 
+    .leftbox {
+      display: flex;
+      align-items: center;
+      height: 84rpx;
+
+      .u-text-center {
+        margin-right: 20rpx;
+      }
+
+      .service {
+
+        image {
+          width: 40rpx;
+          height: 40rpx;
+          margin: 0 auto;
+        }
+
+        margin-right: 20rpx;
+      }
+    }
+
     .cart {
       position: relative;
 
+      .car-icon {
+        position: relative;
+
+        .nums {
+          font-size: 20rpx;
+          color: #FFFFFF;
+          font-weight: 400;
+          padding: 4rpx;
+          height: 30rpx;
+          min-width: 30rpx;
+          line-height: 23rpx;
+          background-color: #FF0000;
+          border-radius: 15rpx;
+          position: absolute;
+          right: 5rpx;
+          top: -10rpx;
+        }
+      }
+
       .number {
         position: absolute;
         top: -10rpx;
@@ -479,19 +863,23 @@
     }
 
     .cart-btn {
-      width: 230rpx;
+      width: 200rpx;
       height: 85rpx;
-      background: #dccda4;
-      border-radius: 43rpx 0rpx 0rpx 43rpx;
+      line-height: 85rpx;
+      background: #FF9651;
+      color: white;
+      border-radius: 40rpx;
+      margin-right: 10rpx;
     }
 
     .buy-btn {
-      width: 340rpx;
+      width: 200rpx;
       height: 85rpx;
-      color: #fff;
+      color: white;
       line-height: 85rpx;
-      background: #3775F6;
-      border-radius: 43rpx;
+      background: #FA6138;
+      border-radius: 40rpx;
+      margin-left: 10rpx;
     }
   }
 
@@ -565,4 +953,96 @@
       }
     }
   }
-</style>
+
+  .goods-tools {
+    display: flex;
+    flex-direction: column;
+    justify-content: flex-end;
+    height: 84rpx;
+    line-height: 42rpx;
+  }
+
+  .jump-box {
+    position: fixed;
+    left: 50%;
+    bottom: 200rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 350rpx;
+    height: 80rpx;
+    color: #fff;
+    background-color: #6be5f8;
+    border-radius: 40rpx;
+    transform: translateX(-50%);
+    z-index: 99;
+
+    .logo-img {
+      width: 40rpx;
+      height: 40rpx;
+      margin-right: 10rpx;
+      box-shadow: 0 0 10rpx 10rpx rgba(0, 0, 0, 0.1);
+    }
+
+    .tip {
+      font-size: 28rpx;
+    }
+  }
+
+  .view-alert {
+    /* position: absolute;
+  	left: 0;
+  	top: 0;
+  	z-index: 9; */
+    width: 750rpx;
+    background: rgb(52, 52, 52);
+    margin-left: 0px;
+    margin-right: 0px;
+    padding: 60rpx 30rpx 60rpx 60rpx;
+    box-shadow: rgba(22, 22, 23, 0.62) 0px -10px 16px inset;
+    display: flex;
+    justify-content: space-between;
+    align-items: stretch;
+    box-sizing: border-box;
+
+    .alert-text {
+      flex: 1;
+      color: #7f7e7e;
+      font-weight: 400 !important;
+      padding-right: 60rpx;
+      line-height: 1.5;
+    }
+
+    .alert-arrow {
+      flex-shrink: 0;
+      width: 60rpx;
+      height: 60rpx;
+      margin-top: -30rpx;
+    }
+  }
+
+  .wx-open {
+    position: fixed;
+    bottom: 200rpx;
+    left: 50%;
+    // width: 300rpx;
+    height: 80rpx;
+    color: red;
+    transform: translateX(-50%);
+    z-index: 9;
+
+   // >>> #launch-btn {
+   //    width: 300rpx;
+   //    height: 100rpx;
+
+   //    .btn {
+   //      width: 100%;
+   //      height: 100%;
+   //      font-size: 28rpx;
+   //      border: none;
+   //      border-radius: 8rpx;
+   //      background-color: #fff;
+   //    }
+   //  }
+  }
+</style>

+ 6 - 8
pages/index.vue

@@ -1,9 +1,9 @@
 <template>
   <view>
-    <!-- <navbar :config="config"></navbar> -->
+    <navbar :config="config"></navbar>
     <goods v-if="pageType==1" :options='options'></goods>
-    <articles v-if="pageType==2" :options='options'></articles>
-    <works v-if="pageType==3" :options='options'></works>
+    <!-- <articles v-if="pageType==2" :options='options'></articles>
+    <works v-if="pageType==3" :options='options'></works> -->
   </view>
 </template>
 
@@ -24,18 +24,16 @@
       return {
         config: {
           back: false, //false是tolbar页面 是则不写
-          title: "松河生活商城",
-          color: "#fff",
+          title: "宜格优选",
+          color: "#1a1a1a",
           //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
-          backgroundColor: [1, "#00321E"],
-          statusBarFontColor: "#ffffff",
+          backgroundColor: [1, "#ffffff"],
         },
         pageType: 1,
         options: null
       };
     },
     onLoad(options) {
-      console.log(options, 111)
       this.pageType = options.pageType
       this.options = options
     },

+ 42 - 4
pages/payCentre.vue

@@ -1,7 +1,12 @@
 <template>
 	<view class="body">
-		<image src="/static/payCentre/loading.gif" mode=""></image>
-		<view>支付中</view>
+		<!-- <image src="/static/payCentre/loading.gif" mode=""></image> -->
+		<image class="payLogo" src="/static/payCentre/payLogo.png" mode=""></image>
+		<view>
+			正在进入宜格收银台 
+			<text>{{text}}s</text>
+		</view>
+		<view class="footerBox">宜昌城市大脑运营管理有限公司提供技术支持</view>
 	</view>
 </template>
 
@@ -10,7 +15,8 @@
 	export default {
 		data() {
 			return {
-				data:""
+				data:"",
+				text:3
 			}
 		},
 		onLoad(options) {
@@ -20,10 +26,20 @@
 				// })
 				setTimeout(()=>{
 					this.goto(options.orderNo)
-				},100)
+				},100);
 			}
+			this.init()
 		},
 		methods: {
+			init(){
+				this.text=3;
+				let setTime=setInterval(()=>{
+					this.text--;
+					if(this.text==0&&setTime){
+						clearInterval(setTime)
+					}
+				},1000)
+			},
 			goto(orderNo) {
 				try {
 					uniWeb.webView.postMessage({
@@ -49,5 +65,27 @@
 			width: 200rpx;
 			height: 200rpx;
 		}
+		.payLogo{
+			width: 294rpx;
+			height: 294rpx;
+		}
+		>view{
+			font-size: 30rpx;
+			color: #333333;
+			font-weight: 700;
+			margin-top: 45rpx;
+			text{
+				font-size: 36rpx;
+				color: #FF0511;
+			}
+		}
+		.footerBox{
+			width: 100%;
+			font-size: 24rpx;
+			color: #999999;
+			text-align: center;
+			position: fixed;
+			bottom: 90rpx;
+		}
 	}
 </style>

+ 2 - 1
pages/paySuccess.vue

@@ -36,7 +36,7 @@
 					// document.body.appendChild(ifr);
 					window.location = "ygfwUrlSchemes://&orderNo=" + this.orderNo;
 				} else {
-					window.location = "https://yigeapp.songlanyun.com" 
+					window.location = "https://yigeapp.songlanyun.com"
 					// window.open("https://apps.apple.com/cn/app/nano-health/id1615496457");
 					// window.location="https://appstore.nanomirai.com"
 					// window.location = "https://yigeapp.songlanyun.com/ygfw/" //你的苹果应用app链接 
@@ -69,6 +69,7 @@
 			height: 200rpx;
 		}
 
+
 		button {
 			width: 80%;
 			margin: 200rpx auto 0;

+ 79 - 0
pages/yigePay.vue

@@ -0,0 +1,79 @@
+<template>
+	<view class="Body" >
+		<view class="left">
+			<image src="/static/staticPc/bg2.png" mode=""></image>
+		</view>
+		<view class="right">
+			<image class="right_logo" src="/static/staticPc/logo1.png" mode=""></image>
+			<view class="right_title">I宜昌统一支付管理平台</view>
+			<view class="right_btn" @click="jump('https://hmpay.sandpay.com.cn/merchant/login')">商户登录</view>
+			<view class="right_btn" @click="jump('https://yichang.sandpay.com.cn/agent/')">代理商登录</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default{
+		data(){
+			return{
+				
+			}
+		},
+		methods:{
+			jump(url){
+				window.open(url)
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.Body{
+		background: url('@/static/staticPc/bg1.png');
+		background-size: cover;
+		width: 100%;
+		height: 100vh;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.left{
+				font-size: 0;
+			image{
+				width: 836px;
+				height: 788px;
+			}
+		}
+		.right{
+			width: 664px;
+			height: 788px;
+			background: #fff;
+			text-align: center;
+			padding-top: 100px;
+			box-sizing: border-box;
+			.right_logo{
+				width: 257px;
+				height: 54px;
+			}
+			.right_title{
+				font-size: 48px;
+				font-family: Microsoft YaHei, Microsoft YaHei-Bold;
+				font-weight: 700;
+				text-align: center;
+				color: #3384ED;
+				margin-top: 40px;
+				margin-bottom: 120px;
+			}
+			.right_btn{
+				width: 455px;
+				height: 76px;
+				background: #3081eb;
+				border-radius: 10px;
+				color: #ffffff;
+				font-size: 30px;
+				line-height: 76px;
+				margin: 44px auto;
+				cursor: pointer;
+			}
+		}
+	}
+</style>

+ 222 - 0
pages/yigePayCenter.vue

@@ -0,0 +1,222 @@
+<template>
+	<view>
+		<u-navbar leftIconColor="#2AABB0" title="" :autoBack="true" placeholder>
+			<view slot="center" class="navCenter">
+				<image src="/static/staticPay/icon1.png" mode=""></image>
+				<view>宜格收银台</view>
+			</view>
+		</u-navbar>
+		<view class="garyArea">
+			<view class="garyArea_val">¥0.00</view>
+			<view class="garyArea_lab">付款金额</view>
+		</view>
+		<view class="btnArea">
+			<view class="btnArea_title">支付方式</view>
+			<view class="btnArea_item" @click="activeFun(1)">
+				<view class="btnArea_item_l">
+					<image src="/static/staticPay/icon3.png" mode=""></image>
+					<view>微信支付</view>
+				</view>
+				<view class="btnArea_item_r" :class="{active:activeIndex==1}">
+					<view></view>
+				</view>
+			</view>
+			<view class="btnArea_item" @click="activeFun(0)">
+				<view class="btnArea_item_l">
+					<image src="/static/staticPay/icon2.png" mode=""></image>
+					<view>支付宝</view>
+				</view>
+				<view class="btnArea_item_r " :class="{active:activeIndex==0}">
+					<view></view>
+				</view>
+			</view>
+
+			<view class="btnArea_btn" @click="clickBtn()">
+				确认支付 {{time}}
+			</view>
+			<view class="btnArea_tig">
+				请在
+				<text>20</text>
+				分钟内完成付款,否则订单失效
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				time:"00.20.00",
+				activeIndex:1
+			}
+		},
+		onLoad() {
+			console.log(uni.$u.config.v);
+			this.clock()
+		},
+		methods: {
+			activeFun(index){
+				this.activeIndex=index;
+			},
+			clickBtn(){
+				uni.showToast({
+					icon:"none",
+					title: '请在APP中发起支付',
+					duration: 2000
+				});
+			},
+			clock(times = 1200) {
+				//页面加载时设置需要倒计时的秒数,计算小时
+				var shi = parseInt(times / 3600);
+				if (shi < 10) {
+					shi = "0" + shi
+				}
+				//计算分钟
+				var fen = parseInt((times % 3600) / 60);
+				if (fen < 10) {
+					fen = "0" + fen
+				}
+				//计算秒
+				var miao = (times % 3600) % 60;
+				if (miao < 10) {
+					miao = "0" + miao
+				}
+				this.time=shi+':'+fen + ":" + miao
+				let timeout
+				if (times > 0) {
+					times=times - 1
+					//定时1秒,然后调用自身clock方法
+					timeout = setTimeout(() => {
+						this.clock(times);
+					}, 1000);
+				} else {
+					clearTimeout(timeout)
+					return
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.navCenter {
+		display: flex;
+		align-items: center;
+
+		image {
+			width: 43rpx;
+			height: 44rpx;
+			margin-right: 6rpx;
+		}
+
+		>view {
+			font-size: 36rpx;
+			color: #1A1A1A;
+			font-weight: 700;
+		}
+	}
+
+	.garyArea {
+		background: #F5F5F5;
+		padding: 70rpx 0 90rpx 0;
+
+		.garyArea_val {
+			font-size: 50rpx;
+			color: #2AABB0;
+			font-weight: 700;
+			;
+			text-align: center;
+		}
+
+		.garyArea_lab {
+			font-size: 28rpx;
+			color: #666666;
+			text-align: center;
+		}
+	}
+
+	.btnArea {
+		padding: 54rpx 60rpx;
+		border-radius: 40rpx 40rpx 0 0;
+		position: relative;
+		background: #FFFFFF;
+		top: -40rpx;
+		.btnArea_title {
+			font-size: 32rpx;
+			color: #333333;
+			font-weight: 700;
+			margin-bottom: 50rpx;
+		}
+
+		.btnArea_item {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-top: 30rpx;
+
+			.btnArea_item_l {
+				font-size: 28rpx;
+				color: #666666;
+				display: flex;
+				align-items: center;
+
+				image {
+					width: 58rpx;
+					height: 58rpx;
+					margin-right: 20rpx;
+				}
+			}
+
+			.btnArea_item_r {
+				width: 36rpx;
+				height: 36rpx;
+				border: 1rpx solid #B3B3B3;
+				border-radius: 50%;
+
+				>view {
+					display: none;
+				}
+			}
+
+			.active {
+				border-color: rgb(28,167,175);
+				display: flex;
+				align-items: center;
+				justify-content: center;
+
+				>view {
+					display: block;
+					width: 18rpx;
+					height: 18rpx;
+					border-radius: 50%;
+					background: rgb(28,167,175);
+				}
+			}
+		}
+
+		.btnArea_btn {
+			width: 630rpx;
+			height: 90rpx;
+			background: linear-gradient(#29b2a2 0%, #2aa7bd 100%);
+			border-radius: 45rpx;
+			margin: 100rpx auto 0;
+			text-align: center;
+			line-height: 90rpx;
+			font-size: 32rpx;
+			color: #FFFFFF;
+		}
+
+		.btnArea_tig {
+			font-size: 24rpx;
+			color: #808080;
+			margin-top: 26rpx;
+			text-align: center;
+			letter-spacing: 2rpx;
+			font-weight: 600;
+			text {
+				color: #FF0000;
+			}
+		}
+	}
+</style>

BIN
static/down/downApps.png


BIN
static/down/downApps1.png


BIN
static/down/downBG.png


BIN
static/down/downBG1.png


BIN
static/font/iconfont2.ttf


BIN
static/font/iconfont2.woff


BIN
static/font/iconfont2.woff2


BIN
static/kefu.png


BIN
static/logo.png


BIN
static/payCentre/payLogo.png


BIN
static/staticPay/icon1.png


BIN
static/staticPay/icon2.png


BIN
static/staticPay/icon3.png


BIN
static/staticPc/bg1.png


BIN
static/staticPc/bg2.png


BIN
static/staticPc/logo1.png


BIN
static/wxbtn.png


+ 1 - 1
uni.scss

@@ -11,7 +11,7 @@
  *
  * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  */
-
+@import 'uview-ui/theme.scss';
 /* 颜色变量 */
 
 /* 行为相关颜色 */