guhongwei пре 2 година
родитељ
комит
5127114676
4 измењених фајлова са 34 додато и 13 уклоњено
  1. 17 4
      common/api.js
  2. 7 0
      config.js
  3. 4 4
      package.json
  4. 6 5
      pages/login/index.vue

+ 17 - 4
common/api.js

@@ -1,9 +1,22 @@
 import config from '../config.js';
 import config from '../config.js';
 const getDomain = (uri, method, type) => {
 const getDomain = (uri, method, type) => {
-	if (type && type == 'file') return config.serverUrl + '/files' + uri;
-	if (type && type == 'integral') return config.serverUrl + '/point/zr/v1/api' + uri;
-	if (uri.startsWith('/wechat/api')) return config.serverUrl + uri;
-	else return config.serverUrl + '/point/v1/api' + uri;
+	let wx_env = config.wx_miniProgram;
+	let system = config.system;
+	let url = config.serverUrl;
+	if (type && type == 'file') return url + `/files` + uri;
+	if (type && type == 'integral') return url + `/point/zr/v1/api` + uri;
+	if (uri.startsWith('/wechat/api')) return url + uri;
+	else {
+		if (system.uniPlatform == 'app') {
+			return url + `/point/v1/api` + uri;
+		} else if (system.uniPlatform == 'mp-weixin') {
+			if (wx_env.envVersion == 'develop' || wx_env.envVersion == 'trial') {
+				return url + `/${config.wx_dev}/point/v1/api` + uri;
+			} else if (wx_env.envVersion == 'release') {
+				return url + '/point/v1/api' + uri;
+			}
+		}
+	}
 }
 }
 // 获取token
 // 获取token
 const getToken = () => {
 const getToken = () => {

+ 7 - 0
config.js

@@ -1,7 +1,14 @@
+// 微信版本
+const wx_min = uni.getAccountInfoSync();
+// 设备信息
+const system = uni.getSystemInfoSync();
 export default {
 export default {
 	serverUrl: 'https://broadcast.waityou24.cn',
 	serverUrl: 'https://broadcast.waityou24.cn',
 	// serverUrl: 'http://192.168.223.1:12111',
 	// serverUrl: 'http://192.168.223.1:12111',
 	wx_projectkey: 'tnhqApp', //pointApp
 	wx_projectkey: 'tnhqApp', //pointApp
+	wx_miniProgram: wx_min.miniProgram,
+	system: system,
+	wx_dev: 'dev',
 	share: {},
 	share: {},
 	china: [
 	china: [
 		//全国地址
 		//全国地址

+ 4 - 4
package.json

@@ -1,6 +1,6 @@
 {
 {
-  "dependencies": {
-    "decimal.js": "^10.4.1",
-    "moment": "^2.29.4"
-  }
+	"dependencies": {
+		"decimal.js": "^10.4.1",
+		"moment": "^2.29.4"
+	}
 }
 }

+ 6 - 5
pages/login/index.vue

@@ -79,7 +79,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</uni-popup>
 		</uni-popup>
-		<!-- 		<uni-popup ref="dialogShow" type="dialog">
+		<!-- <uni-popup ref="dialogShow" type="dialog">
 			<uni-popup-dialog :title="dialog.title" mode="base" :before-close="true" @confirm="diaSubmit(dialog)" @close="diaReset(dialog)">
 			<uni-popup-dialog :title="dialog.title" mode="base" :before-close="true" @confirm="diaSubmit(dialog)" @close="diaReset(dialog)">
 				<view class="dialog dialog_1" v-if="dialog.type=='1'">
 				<view class="dialog dialog_1" v-if="dialog.type=='1'">
 					<uni-forms ref="phoneForm" :model="phoneForm" label-width="auto">
 					<uni-forms ref="phoneForm" :model="phoneForm" label-width="auto">
@@ -155,11 +155,11 @@
 					{
 					{
 						text: '微信',
 						text: '微信',
 						value: 0
 						value: 0
+					},
+					{
+						text: '短信验证',
+						value: 1
 					}
 					}
-					// {
-					// 	text: '短信验证',
-					// 	value: 1
-					// }
 				],
 				],
 			};
 			};
 		},
 		},
@@ -517,6 +517,7 @@
 				const that = this;
 				const that = this;
 				that.$refs.dialogShow.open();
 				that.$refs.dialogShow.open();
 			},
 			},
+			// 获取手机号
 			async getUserPhone(e) {
 			async getUserPhone(e) {
 				const that = this;
 				const that = this;
 				let user = that.user;
 				let user = that.user;