Browse Source

Merge branch 'master' of http://git.lcpcp.cc/root/lcoco

py 1 year ago
parent
commit
059d55a500

+ 2 - 2
.env.dev.js

@@ -1,6 +1,6 @@
 const config = {
-	baseUrl: 'www.icoco.tech:9999/admin',
-	socketUrl: 'www.icoco.tech:9999/admin',
+	baseUrl: 'icoco.tech',
+	socketUrl: 'icoco.tech',
     appName:'开发环境'
 }
 module.exports = config;

+ 2 - 2
.env.prod.js

@@ -1,6 +1,6 @@
 const config = {
-    baseUrl: 'www.icoco.tech:9999/admin',
-    socketUrl: 'www.icoco.tech:9999/admin',
+    baseUrl: 'icoco.tech',
+    socketUrl: 'icoco.tech',
     appName:'正式环境'
 }
 module.exports = config;

+ 3 - 1
api/login.js

@@ -2,6 +2,8 @@ import {request} from '@/service/ajax'
 
 const newsUrl = '/utility/'
 // 登陆
-export const login = (data) => request(newsUrl + 'one_click_login', 'post', { ...data },false)
+// export const login = (data) => request(newsUrl + 'one_click_login', 'post', { ...data },false)
+export const login = (data) => request('/auth/oauth2/token', 'post', { ...data },false)
 export const forgetPassword = (data) => request(newsUrl + 'forget_password', 'post', { ...data },false)
 export const register = (data) => request(newsUrl + 'register', 'post', { ...data },true)
+export const filUserInfo = (data) => request(newsUrl + 'fill_user_info', 'post', { ...data },true)

+ 9 - 1
manifest.json

@@ -130,12 +130,20 @@
             "https" : false,
             "proxy" : {
                 "/utility" : {
-                    "target" : "http://www.icoco.tech:9999/admin",
+                    "target" : "https://icoco.tech/admin",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {
                         "^/utility" : "utility"
                     }
+                },
+                "/auth" : {
+                    "target" : "https://icoco.tech/",
+                    "changeOrigin" : true,
+                    "secure" : false,
+                    "pathRewrite" : {
+                        "^/auth" : "auth"
+                    }
                 }
             }
         }

+ 11 - 14
pages/login/localPhoneLogin.vue

@@ -147,23 +147,20 @@ export default {
       //#endif
     },
     oneClickLogin(mobile){
-      login({'mobile':mobile}).then((res)=>{
-        console.log(res)
-        if(res.code===0){
-            tools.setLoginData(res.data)
-            setTimeout(()=>{
-              // uni.switchTab({
-              //   'url':'/pages/index/index'
-              // })
-              uni.navigateTo({
-                'url':'/pages/perfect/sexAndAge'
-              })
-            },1500)
-        }else{
-
+      mobile='13900139001'
+      login({'mobile':mobile,'grant_type':'mobile','scope':'server'}).then((res)=>{
+        tools.setLoginData(res)
+        if(res.isNewUser){
+          uni.navigateTo({
+            'url':'/pages/perfect/sexAndAge'
+          })
+        }else {
+          tools.setLoginData(res.data)
+          setTimeout(()=>{
             uni.navigateTo({
               'url':'/pages/perfect/sexAndAge'
             })
+          },1500)
         }
       }).catch((e)=>{
         console.log(e)

+ 2 - 2
pages/perfect/nickname.vue

@@ -34,7 +34,7 @@
 <script>
 import EnNav from "@/components/en-utils/en-nav/en-nav";
 import tools from "@/service/tools";
-import {register} from "@/api/login";
+import {filUserInfo, register} from "@/api/login";
 export default {
   components: {EnNav},
   data() {
@@ -62,7 +62,7 @@ export default {
         let mobile=uni.getStorageSync('mobile')
         let dateOfBirth=uni.getStorageSync('dateOfBirth')
         let gender=uni.getStorageSync('gender')
-        register({'mobile':mobile,'dateOfBirth':dateOfBirth,'gender':gender,'nickname':this.nickname,'password':this.password}).then((res)=>{
+        filUserInfo({'mobile':mobile,'dateOfBirth':dateOfBirth,'gender':gender,'nickname':this.nickname,'password':this.password}).then((res)=>{
           if(res.code===0){
             tools.setLoginData(res.data)
             uni.navigateTo({

+ 1 - 0
pages/perfect/sexAndAge.vue

@@ -137,6 +137,7 @@ export default {
     setNextStep(){
       if(this.isOK){
         uni.setStorageSync('dateOfBirth', this.ageObj.year+'-'+this.ageObj.month+'-'+this.ageObj.day)
+        uni.setStorageSync('gender', this.sex)
         uni.navigateTo({
           'url':'/pages/perfect/nickname'
         })

+ 8 - 1
pages/wallet/gift-wall.vue

@@ -13,7 +13,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="head-right sys-size-28 sys-color-gray-3 sys-radius-200 sys-background-yellow">波点兑换</view>
+				<view class="head-right sys-size-28 sys-color-gray-3 sys-radius-200 sys-background-yellow" @click="to(1)">波点兑换</view>
 			</view>
 			<view class="box-nav">
 				<view class="sys-size-32 nav-name" :class="navId === item.id?'s-view':'n-view'"
@@ -61,6 +61,13 @@
 				this.navId = item.id;
 				this.navIndex = i;
 			},
+			to(type,item){
+				if(type === 1){
+					uni.navigateTo({
+						url:'/pages/wallet/wave-point'
+					})
+				}
+			},
 		}
 	}
 </script>

+ 3 - 1
pages/wallet/model/income.vue

@@ -40,7 +40,9 @@
 		methods:{
 			selectFun(type){
 				if(type === 1){
-					// 波点兑换
+					uni.navigateTo({
+						url:'/pages/wallet/wave-point'
+					})
 				}else if(type === 2){
 					// 兑换JM币
 				}else if(type === 3){

+ 119 - 4
pages/wallet/wave-point.vue

@@ -3,7 +3,7 @@
 		<Nav class='nav-view' :title="isScroll?'波点兑换中心':''" :titleColor="isScroll?'#333':'#fff'" 
 		:bgckgroundBox="isScroll?'#fff':'transparent'" :rightShow='true' :rightType='2'>
 			<template v-slot:right>
-				<view class="nav-right-box sys-size-24" :class="isScroll?'view-n':'view-s'">兑换记录</view>
+				<view class="nav-right-box sys-size-24" :class="isScroll?'view-n':'view-s'" @click="to(1)">兑换记录</view>
 			</template>
 		</Nav>
 		<image class="bg-img" src="@/static/img/wallet/bd-bg.png" mode="aspectFill"></image>
@@ -17,9 +17,38 @@
 		<scroll-view scroll-y="true" class="list-scroll" @scrolltolower="scrolltolower">
 			<view class="list-home">
 				<view class="list-box" v-for="(item,i) in 10" :key="i">
-					<view class="box-top">
+					<image v-if="i%2===0" class="box-bg" src="@/static/img/wallet/shop-bg.png" mode="aspectFill"></image>
+					<image v-else class="box-bg" src="@/static/img/wallet/shop-bg-right.png" mode="aspectFill"></image>
+					
+					<view class="box-top" v-if="navId === 3">
 						<view class="box-1 sys-size-24">剩余0</view>
 						<image class="type-3" src="@/static/img/circle/1.png" mode="scaleToFill"></image>
+						<view class="box-san-left" v-if="i%2===0"></view>
+						<view class="box-san-right" v-else></view>
+					</view>
+					<view class="box-top" v-else>
+						<view class="box-2">
+							<view class="box-2-c">
+								<text class="sys-size-28 sys-color-gray-3 sys-weight-600">3天</text>
+								<image v-if="navId===2" src="@/static/img/wallet/fj.png" mode="aspectFill"></image>
+								<!-- <image src="@/static/img/wallet/vip-shop.png" mode="aspectFill"></image> -->
+								<!-- <image src="@/static/img/wallet/x-shop.png" mode="aspectFill"></image> -->
+								<image v-else src="@/static/img/wallet/svip-shop.png" mode="aspectFill"></image>
+							</view>
+						</view>
+					</view>
+					
+					<view class="box-name sys-size-32 sys-color-white sys-weight-500 sys-webkit-box">
+						速度与激情速度与激情速度与激情
+					</view>
+					<view class="box-name-xian"><view></view></view>
+					<view class="box-b">
+						<view class="box-b-left">
+							<text class="sys-size-36 sys-color-00E7EA sys-weight-600">20K</text>
+							<text class="sys-size-24 sys-color-gray-9">波点</text>
+						</view>
+						<!-- <image src="@/static/img/wallet/dh.png" mode="aspectFill"></image> -->
+						<image src="@/static/img/wallet/yqg.png" mode="aspectFill"></image>
 					</view>
 				</view>
 			</view>
@@ -49,6 +78,13 @@
 					this.navLeft = i * 250 + 110;
 				}
 			},
+			to(type,item){
+				if(type === 1){
+					uni.navigateTo({
+						url:'/pages/wallet/bill'
+					})
+				}
+			}
 		},
 	}
 </script>
@@ -126,14 +162,62 @@
 				.list-box{
 					width: 333rpx;
 					height: 444rpx;
-					background: url('@/static/img/wallet/shop-bg.png') no-repeat;
-					background-size: 100% 100%;
+					position: relative;
 					margin-bottom: 28rpx;
+					.box-bg{
+						width: 333rpx;
+						height: 444rpx;
+						position: absolute;
+						top: 0;
+						left: 0;
+					}
 					.box-top{
 						width: 313rpx;
 						height: 264rpx;
 						margin:2rpx 8rpx 10rpx 10rpx;
 						position: relative;
+						.box-2{
+							width: 313rpx;
+							height: 264rpx;
+							box-sizing: border-box;
+							padding-top: 118rpx;
+							.box-2-c{
+								width: 128rpx;
+								height: 52rpx;
+								line-height: 52rpx;
+								background: #FFFFFF;
+								border-radius: 0rpx 16rpx 16rpx 0rpx;
+								margin: 0 78rpx 0 128rpx;
+								box-sizing: border-box;
+								padding-left: 60rpx;
+								position: relative;
+								image{
+									width: 100rpx;
+									height: 100rpx;
+									position: absolute;
+									left: -50rpx;
+									top: -28rpx;
+								}
+							}
+						}
+						.box-san-left{
+							position: absolute;
+							top: -20rpx;
+							left: -8rpx;
+							border-top: 25rpx solid transparent;
+							border-bottom: 25rpx solid transparent;
+							border-right: 25rpx solid #081432;
+							transform:rotate(45deg);
+						}
+						.box-san-right{
+							position: absolute;
+							top: -20rpx;
+							right: -8rpx;
+							border-top: 25rpx solid transparent;
+							border-bottom: 25rpx solid transparent;
+							border-left: 25rpx solid #081432;
+							transform:rotate(-45deg);
+						}
 						.type-3{
 							width: 100%;
 							height: 100%;
@@ -153,6 +237,37 @@
 							background: #182137;
 						}
 					}
+					.box-name{
+						box-sizing: border-box;
+						padding: 18rpx 35rpx 0 35rpx;
+						position: relative;
+					}
+					.box-name-xian{
+						box-sizing: border-box;
+						padding: 0 35rpx;
+						margin-top: 24rpx;
+						position: relative;
+						view{
+							width: 100%;
+							border-bottom: 2rpx dashed #274077;
+						}
+					}
+					.box-b{
+						box-sizing: border-box;
+						padding: 18rpx 35rpx 0 35rpx;
+						display: flex;
+						justify-content: space-between;
+						position: relative;
+						.box-b-left{
+							text{
+								margin-right: 4rpx;
+							}
+						}
+						image{
+							width: 108rpx;
+							height: 48rpx;
+						}
+					}
 				}
 			}
 			

+ 17 - 6
service/ajax.js

@@ -10,7 +10,23 @@ BASE_URL ='https://' + process.uniEnv.baseUrl;
  * post请求封装
  */
 export const request = (url, method, data, show = false) => {
+  console.log(url)
   let token=uni.getStorageSync('token')
+  let header={
+    'content-type': 'application/json',
+    'hversion': '1.0',
+    'Authorization': '',
+    'CLIENT-TOC': 'Y',
+  }
+  if(url==='/auth/oauth2/token'){
+    token='Basic YXBwOmFwcA=='
+    // header['CLIENT-TOC']='Y'
+    url=url+tools.addQueryString(data)
+  }else {
+    token= 'Bearer '+token
+  }
+  header.Authorization=token
+  console.log(header)
   // data.token = token;
   // data.m_id = uni.getStorageSync('m_id')
   if (show) {
@@ -26,12 +42,7 @@ export const request = (url, method, data, show = false) => {
       url:BASE_URL+  url,
       data: data,
       method: method || 'post',
-      header: {
-        'content-type': 'application/json',
-        'hversion': '1.0',
-        'Authorization': 'Bearer cd58ee97-5700-45f3-ae1f-9bebef504fc1'
-        // 'Authorization': 'Bearer '+token
-      },
+      header: header,
       success: (res) => {
         if (res.statusCode === 200) {
           // console.log('应答信息-----------------------')

+ 16 - 5
service/tools.js

@@ -354,10 +354,10 @@ tools.getDateYM = ()=>{
  * @param type
  */
 tools.setLoginData = function (data) {
-    uni.setStorageSync('token', data.accessToken)
-    uni.setStorageSync('tokenType', data.tokenType)
-    uni.setStorageSync('refreshToken', data.refreshToken)
-    uni.setStorageSync('mobile', data.mobile)
+    uni.setStorageSync('token', data.access_token)
+    uni.setStorageSync('tokenType', data.token_type)
+    uni.setStorageSync('refreshToken', data.access_token)
+    uni.setStorageSync('mobile', data.username)
     tools.success('登陆成功')
     // setTimeout(() => {
     //     if (data.status * 1 === 0) {
@@ -374,7 +374,14 @@ tools.setLoginData = function (data) {
 
 
 }
-
+tools.addQueryString=function (params) {
+    let str = '';
+    for (let Key in params) {
+        str += Key + '=' + params[Key] + '&';
+    }
+    return '?' + str;
+    //return '?' + str.substr(0, str.length -1); 严谨一些
+}
 tools.setCosToken=function (data){
     uni.setStorageSync('cosToken',data)
 }
@@ -382,6 +389,10 @@ tools.delCosToken=function (data){
     uni.removeStorageSync('cosToken')
 }
 
+
+
+
+
 tools.getCosToken=function (){
   let cosToken= uni.getStorageSync('cosToken')
     if(!cosToken){

+ 6 - 2
service/txOssSts.js

@@ -120,14 +120,18 @@ cosServe.getSignUrl=function (url){
     console.log(url)
     url= url.replace('https://','')
     url= url.replace('http://','')
-    url= url.replace('icoco-1317650740.cos.ap-guangzhou.myqcloud.com','')
+    url= url.replace('icoco-1317650740.cos.ap-guangzhou.myqcloud.com/','')
     console.log(url)
     console.log('开始签名----------------------------'+url)
+    console.log({
+        Bucket: Bucket,
+        Region: Region,
+        Key: url, /* 存储在桶里的对象键(例如1.jpg,a/b/test.txt),支持中文,必须字段 */
+    })
     let newUrl= cos.getObjectUrl({
         Bucket: Bucket,
         Region: Region,
         Key: url, /* 存储在桶里的对象键(例如1.jpg,a/b/test.txt),支持中文,必须字段 */
-        Sign: true,
     })
     console.log('签名完成----------------------------'+newUrl)
     console.log(newUrl)

+ 3 - 0
static/css/sys.css

@@ -81,6 +81,9 @@
 .sys-color-white{
   color: #fff;
 }
+.sys-color-00E7EA{
+  color: #00E7EA;
+}
 .sys-color-green{
   color: #12CE87;
 }

BIN
static/img/wallet/shop-bg-right.png