瀏覽代碼

引入微信jssdk、商品详情页协议唤起app

maple 11 月之前
父節點
當前提交
1083298416
共有 20 個文件被更改,包括 1235 次插入103 次删除
  1. 0 16
      App.vue
  2. 22 0
      common/jswx.js
  3. 1 0
      common/jweixin-1.6.0.js
  4. 216 0
      common/request/index-shop.js
  5. 441 0
      common/request/request-shop.js
  6. 48 0
      common/sign.js
  7. 11 0
      common/style/uni.css
  8. 1 0
      config/global.config.js
  9. 18 12
      main.js
  10. 8 3
      package-lock.json
  11. 2 1
      package.json
  12. 7 7
      pages.json
  13. 5 8
      pages/down.vue
  14. 449 48
      pages/goods.vue
  15. 6 8
      pages/index.vue
  16. 二進制
      static/font/iconfont2.ttf
  17. 二進制
      static/font/iconfont2.woff
  18. 二進制
      static/font/iconfont2.woff2
  19. 二進制
      static/kefu.png
  20. 二進制
      static/logo.png

+ 0 - 16
App.vue

@@ -25,22 +25,6 @@
 					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')

+ 22 - 0
common/jswx.js

@@ -0,0 +1,22 @@
+import jswx from 'weixin-js-sdk'
+import sign from './sign.js'
+console.log('jswx===>>', jswx)
+console.log('sign===>>', sign)
+// 
+// 初始化微信配置
+jswx.config({
+  debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+  appId: '', // 必填,公众号的唯一标识
+  timestamp: '', // 必填,生成签名的时间戳
+  nonceStr: '', // 必填,生成签名的随机串
+  signature: '', // 必填,签名
+  jsApiList: [] // 必填,需要使用的JS接口列表
+});
+jswx.ready(function(res) {
+  console.log('res===>', res)
+  // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+});
+jswx.error(function(error) {
+  console.log('error===>>', error)
+  // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+});

文件差異過大導致無法顯示
+ 1 - 0
common/jweixin-1.6.0.js


+ 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 };

+ 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
+ */

+ 48 - 0
common/sign.js

@@ -0,0 +1,48 @@
+const createNonceStr = function () {
+  return Math.random().toString(36).substr(2, 15);
+};
+
+const createTimestamp = function () {
+  return parseInt(new Date().getTime() / 1000) + '';
+};
+
+const raw = function (args) {
+  const keys = Object.keys(args);
+  keys = keys.sort()
+  const newArgs = {};
+  keys.forEach(function (key) {
+    newArgs[key.toLowerCase()] = args[key];
+  });
+
+  const string = '';
+  for (const 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) {
+  const ret = {
+    jsapi_ticket: jsapi_ticket,
+    nonceStr: createNonceStr(),
+    timestamp: createTimestamp(),
+    url: url
+  };
+  const string = raw(ret);
+      jsSHA = require('jssha');
+      shaObj = new jsSHA(string, 'TEXT');
+  ret.signature = shaObj.getHash('SHA-1', 'HEX');
+
+  return ret;
+};
+
+module.exports = sign;

+ 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;

+ 1 - 0
config/global.config.js

@@ -2,6 +2,7 @@ const CONFIG = {
   assetsPath: '/static', // 静态资源路径
   // 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})$",
 };

+ 18 - 12
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/jswx.js'
 // 网络状态监听
 // uni.getNetworkType({
 // 	success: res => {
@@ -28,8 +33,8 @@ import Directives from './directives/index.js';
 // });
 
 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-weapp')
 }
 
 
@@ -38,13 +43,14 @@ 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);
@@ -52,7 +58,7 @@ 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'
@@ -61,7 +67,7 @@ Vue.filter('keepTwo', value => {
  */
 
 const app = new Vue({
-	store,
-	...App
+  store,
+  ...App
 })
-app.$mount()
+app.$mount()

+ 8 - 3
package-lock.json

@@ -705,6 +705,11 @@
                 "graceful-fs": "^4.1.6"
             }
         },
+        "jssha": {
+            "version": "3.3.1",
+            "resolved": "https://registry.npmjs.org/jssha/-/jssha-3.3.1.tgz",
+            "integrity": "sha512-VCMZj12FCFMQYcFLPRm/0lOBbLi8uM2BhXPTqw3U4YAfs4AZfiApOoBLoN8cQE60Z50m1MYMTQVCfgF/KaCVhQ=="
+        },
         "limiter": {
             "version": "1.1.5",
             "resolved": "https://registry.npm.taobao.org/limiter/download/limiter-1.1.5.tgz",
@@ -1330,9 +1335,9 @@
             "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
         },
         "weixin-js-sdk": {
-            "version": "1.6.0",
-            "resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz",
-            "integrity": "sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ=="
+            "version": "1.6.5",
+            "resolved": "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.6.5.tgz",
+            "integrity": "sha512-Gph1WAWB2YN/lMOFB/ymb+hbU/wYazzJgu6PMMktCy9cSCeW5wA6Zwt0dpahJbJ+RJEwtTv2x9iIu0U4enuVSQ=="
         },
         "which-module": {
             "version": "2.0.0",

+ 2 - 1
package.json

@@ -14,8 +14,9 @@
     },
     "dependencies": {
         "clipboard": "^2.0.6",
+        "jssha": "^3.3.1",
         "lite-server": "^2.6.1",
         "uview-ui": "^2.0.36",
-        "weixin-js-sdk": "^1.6.0"
+        "weixin-js-sdk": "^1.6.5"
     }
 }

+ 7 - 7
pages.json

@@ -25,13 +25,13 @@
 				"navigationStyle": "custom"
 			}
 		},
-		// {
-		//   "path": "pages/index",
-		//   "style": {
-		//     "navigationBarTitleText": "松河生活商城",
-		//     "navigationStyle": "custom"
-		//   }
-		// },
+		{
+		  "path": "pages/index",
+		  "style": {
+		    "navigationBarTitleText": "宜格优选",
+		    "navigationStyle": "custom"
+		  }
+		},
 		// {
 		//   "path": "pages/register",
 		//   "style": {

+ 5 - 8
pages/down.vue

@@ -13,23 +13,18 @@
 			<image src="/static/down/downApps.png" mode="aspectFit" class="logo"></image>
 		</view>
 		<view class="btn-row">
-			<button class="btn" @click="downLoad(0)">
+			<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)">
+			<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>
-			<!-- <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>
 </template>
@@ -46,10 +41,12 @@
 					statusBarFontColor: "#1A1A1A",
 				},
 				appInfo: null,
-				showHint: false
+				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

+ 449 - 48
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,74 @@
           <!-- <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 class="jump-box" @click="openApp">
+      <image class="logo-img" src="/static/logo.png" mode="aspectFill"></image>
+      <view class="tip">打开宜格服务APP</view>
+    </view>
+
     <ldLoading isFullScreen :active="loading"></ldLoading>
   </view>
 </template>
 
 <script>
+  import comment from "@/components/ld-comment/ld-comment.vue";
   export default {
-    components: {},
+    components: {
+      comment
+    },
     data() {
       return {
         config: {
@@ -116,6 +167,8 @@
           statusBarFontColor: "#FFFFFF",
           backTabPage: "",
         },
+        //手机状态栏高度
+        statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
         imglist: [], //详情图片数组
         dataForm: {}, //商品详情
         shop: {}, //店铺信息
@@ -124,6 +177,11 @@
         btnText: "打开App",
         time1: [0, 0, 0, 0],
         type: null,
+        commentList: [],
+        isChecked: 0,
+        goodsInfo: {},
+        timer: null,
+        showHint: false,
       };
     },
     props: {
@@ -151,25 +209,100 @@
       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;
-        } else {
-          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{
+        	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
+        if (type == 0) { //  安卓处理
+          let ifr = document.createElement('iframe');
+          ifr.src = `ygfwUrlSchemes://goodsTypeJump=${this.options.type}&goodsIdJump=${this.options.id}`;
+          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处理
+          let url = `ygfwUrlSchemes://goodsTypeJump=${this.options.type}&goodsIdJump=${this.options.id}`
+          alert(url)
+          window.location = url
+          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 +313,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 +331,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 +355,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 +382,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 +395,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 +499,8 @@
     background-color: #fff6ee;
   }
 
-  .mt80 {
-    margin-top: 80rpx;
+  .mt30 {
+    margin-top: 30rpx;
   }
 
   .product {
@@ -355,16 +512,16 @@
     position: relative;
 
     .swiper {
-      height: 620rpx;
+      height: 700rpx;
 
       video {
         width: 100%;
-        height: 620rpx;
+        height: 700rpx;
       }
 
       image {
         width: 100%;
-        height: 620rpx;
+        height: 700rpx;
       }
     }
 
@@ -372,14 +529,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 +548,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 +673,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 +704,7 @@
   }
 
   .btn-bg-dccda4 {
-    background: #dccda4;
+    background: #FA6138;
     border-radius: 48rpx 0rpx 0rpx 48rpx;
   }
 
@@ -448,13 +714,36 @@
   }
 
   .tab {
+    position: sticky;
+    top: 0;
+    background-color: #fff;
     padding-top: 38rpx;
+    z-index: 9;
 
-    .active {
-      font-size: 30rpx;
-      color: #00321e;
-      font-weight: 700;
-      border-bottom: 1rpx solid #00321e;
+    .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;
+
+        &::before {
+          width: 100%;
+        }
+      }
     }
   }
 
@@ -462,11 +751,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 +809,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 +899,71 @@
       }
     }
   }
-</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;
+  	}
+  }
+</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
     },

二進制
static/font/iconfont2.ttf


二進制
static/font/iconfont2.woff


二進制
static/font/iconfont2.woff2


二進制
static/kefu.png


二進制
static/logo.png