tremble 5 years ago
parent
commit
2a6abe73b3

+ 1 - 1
mobile/build/webpack.dev.conf.js

@@ -10,7 +10,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
 const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
 const portfinder = require('portfinder')
 
-const HOST = '192.168.0.208'
+const HOST = '192.168.0.123'
 const PORT = process.env.PORT && Number(process.env.PORT)
 
 const devWebpackConfig = merge(baseWebpackConfig, {

+ 1 - 1
mobile/config/index.js

@@ -13,7 +13,7 @@ module.exports = {
     proxyTable: {},
 
     // Various Dev Server settings
-    host: '192.168.0.86', // can be overwritten by process.env.HOST
+    host: '192.168.0.123', // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 58 - 0
mobile/src/App.vue

@@ -13,6 +13,8 @@ import '@/assets/font/iconfont.css'
 import header from '@/pages/layout/header'
 import footer from '@/pages/layout/footer'
 import browser from '@/util/browser'
+import wx from 'weixin-js-sdk'
+import jsonp from 'jsonp'
 
 export default {
   name: 'App',
@@ -32,6 +34,61 @@ export default {
       }
     }
   },
+  methods: {
+    wxShare () {
+      let url = location.href.split('#')[0]
+      jsonp('https://www.4dage.com/wechat/jssdk/share/?uri=' +
+  window.escape(url) + '&name=厦门四维时代微信公众号', 'success_jsonp', function (err, data) {
+        if (err) {
+          console.err(err)
+        } else {
+          wx.config({
+            debug: false, // 开启调试模式
+            appId: data.appId,
+            timestamp: data.timestamp,
+            nonceStr: data.nonceStr,
+            signature: data.signature,
+            jsApiList: ['checkJsApi',
+              'onMenuShareTimeline',
+              'onMenuShareAppMessage',
+              'onMenuShareQQ',
+              'onMenuShareWeibo',
+              'hideMenuItems',
+              'showMenuItems',
+              'hideAllNonBaseMenuItem',
+              'showAllNonBaseMenuItem',
+              'translateVoice',
+              'startRecord',
+              'stopRecord',
+              'onRecordEnd',
+              'playVoice',
+              'pauseVoice',
+              'stopVoice',
+              'uploadVoice',
+              'downloadVoice']
+          })
+        }
+        wx.ready(function () {
+          var shareData = {
+            title: '四维看看', //  标题
+            desc: '可将线下场景自动转为线上四维场景。好用不贵,全球百万用户首选', //  描述
+            link: window.location.href, //  分享的URL,必须和当前打开的网页的URL是一样的
+            imgUrl: 'https://4dkk.4dage.com/FDKKIMG/icon/kankan_icon180.png', //  缩略图地址
+            success: function () {
+
+            },
+            cancel: function () {
+
+            }
+          }
+          wx.onMenuShareAppMessage(shareData)
+          wx.onMenuShareTimeline(shareData)
+          wx.onMenuShareQQ(shareData)
+          wx.onMenuShareQZone(shareData)
+        })
+      })
+    }
+  },
   mounted () {
     if (!this.isMobile) {
       location.href = '/'
@@ -43,6 +100,7 @@ export default {
       this.$store.dispatch('getInfo', {url: '/user/getUserInfo', name: 'info'})
       this.$store.dispatch('getCart')
     }
+    this.wxShare()
   },
   components: {
     iheader: header,

+ 6 - 0
mobile/src/pages/account/codeLogin/index.vue

@@ -88,6 +88,12 @@ export default {
       if (!reg.phone.test(this.phone)) {
         return
       }
+      let resp = await this.$http
+        .post('/sso/user/checkUser', {phoneNum: this.phone})
+
+      if (resp.data.code !== 0) {
+        return this.$toast.show('warn', this.langToast[resp.data.code])
+      }
       let res = await this.$store.dispatch('getAuthCode', {
         phone: this.phone,
         code: Number(this.codeActive[1].substr(1))

+ 3 - 2
mobile/src/pages/account/forget/index.vue

@@ -150,11 +150,12 @@ export default {
       if (this.password.length < 8 || this.confirmpass.length < 8) {
         return this.$toast.show('warn', this.langToast['31'])
       }
+      let temp = encodeStr(Base64.encode(this.password), Base64.encode(this.confirmpass))
 
       let params = {
-        password: encodeStr(Base64.encode(this.password)),
+        password: temp[0],
         phoneNum: this.phone,
-        confirmPwd: this.confirmpass,
+        confirmPwd: temp[1],
         msgAuthCode: this.authCode
       }
       let res = await this.$http({

+ 4 - 2
mobile/src/pages/account/manage/change/index.vue

@@ -129,10 +129,12 @@ export default {
       if (this.password.length < 8 || this.confirmpassword.length < 8) {
         return this.$toast.show('warn', this.langToast['31'])
       }
+      let temp = encodeStr(Base64.encode(this.password), Base64.encode(this.confirmpassword))
+
       let params = {
-        password: encodeStr(Base64.encode(this.password)),
+        password: temp[0],
         phoneNum: this.info.userName,
-        confirmPwd: this.confirmpassword,
+        confirmPwd: temp[1],
         msgAuthCode: this.code
       }
       let res = await this.$http({

+ 3 - 2
mobile/src/pages/account/register/index.vue

@@ -176,14 +176,15 @@ export default {
       }
 
       let country = Number(this.codeActive[1].substr(1))
+      let temp = encodeStr(Base64.encode(this.password), Base64.encode(this.confirmPass))
 
       let params = {
-        password: encodeStr(Base64.encode(this.password)),
+        password: temp[0],
         phoneNum: this.phone,
         msgAuthCode: this.authCode,
         nickName: this.nickname,
         country,
-        confirmPwd: this.confirmPass
+        confirmPwd: temp[1]
       }
       let res = await this.$http({
         method: 'post',

+ 7 - 1
mobile/src/util/index.js

@@ -53,7 +53,7 @@ module.exports = {
       // + ' ' + (String(hour).length > 1 ? hour : '0' + hour) + ':' + (String(minute).length > 1 ? minute : '0' + minute) +
       //  ':' + (String(second).length > 1 ? second : '0' + second)
   },
-  encodeStr: function (str) {
+  encodeStr: function (str, strv = '') {
     const NUM = 2
     const front = randomWord(false, 8)
     const middle = randomWord(false, 8)
@@ -62,6 +62,12 @@ module.exports = {
     let str1 = str.substring(0, NUM)
     let str2 = str.substring(NUM)
 
+    if (strv) {
+      let strv1 = strv.substring(0, NUM)
+      let strv2 = strv.substring(NUM)
+      return [front + str2 + middle + str1 + end, front + strv2 + middle + strv1 + end]
+    }
+
     return front + str2 + middle + str1 + end
   }
 }

+ 1 - 1
pc/build/webpack.dev.conf.js

@@ -10,7 +10,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
 const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
 const portfinder = require('portfinder')
 
-const HOST = '192.168.0.208'
+const HOST = '192.168.0.123'
 const PORT = process.env.PORT && Number(process.env.PORT)
 
 const devWebpackConfig = merge(baseWebpackConfig, {

+ 37 - 13
pc/src/page/chat/index.vue

@@ -9,7 +9,8 @@
     <div class="chat-con" :class="{active:showAside}">
       <div class="c-top">
         <img :src="language === 'en'?`${$cdn}images/chat-logo-en.png`:`${$cdn}images/chat-logo.png`" alt>
-        <p v-html="langChat.title"></p>
+        <p :style="{'font-size':language === 'en'?'14px':'16px'}" v-html="langChat.title"></p>
+        <img v-if="language !== 'en'" class="wechat-qr" :src="`${$cdn}images/chat-ecode.jpg`" alt>
         <!-- <div class="avatar">
           <div v-for="(item,i) in kefu" :key="i">
             <img :src="item.avatar" alt="">
@@ -17,10 +18,13 @@
           </div>
         </div> -->
       </div>
-      <div class="c-bottom">
-        <div class="input"><input autocomplete="off" ref="sInput" v-model="email" :placeholder="langChat.p1" type="text"></div>
-        <!-- <div class="input"><input autocomplete="off" v-model="phone" :placeholder="langChat.p2" type="text"></div> -->
-        <div class="input"><textarea v-model="content" :placeholder="langChat.p3" type="text" /></div>
+      <div :class="{'c-bottom':true,'c-b-en':language === 'en'}" >
+        <div class="cb-input">
+          <div class="cb-title" v-if="language !== 'en'">请留言</div>
+          <div class="input"><input autocomplete="off" ref="sInput" v-model="email" :placeholder="langChat.p1" type="text"></div>
+          <!-- <div class="input"><input autocomplete="off" v-model="phone" :placeholder="langChat.p2" type="text"></div> -->
+          <div class="input"><textarea v-model="content" :placeholder="langChat.p3" type="text" /></div>
+        </div>
         <div class="btn" @click="send">{{langChat.send}}</div>
       </div>
     </div>
@@ -168,7 +172,6 @@ $lincolor:#d0d0d1;
     .img-active{
       opacity: 1;
       transform: translate(-50%,-50%) scale(1);
-
     }
   }
   .chat-con{
@@ -189,12 +192,18 @@ $lincolor:#d0d0d1;
     .c-top{
       background-color: #2ae1d7;
       color: #2d2d2d;
-      padding: 20px 10%;
-      height: 131px;
+      padding: 23px 7% 26px;
       position: relative;
-      &>img{
-        margin-bottom: 10px;
+      justify-content: space-between;
+      &>img:first-of-type{
+        margin-bottom: 6px;
+      }
+      .wechat-qr{
+        max-width: 120px;
+        max-height: 120px;
+        margin-top: 20px;
       }
+
       .avatar{
         display: flex;
         text-align: center;
@@ -211,16 +220,24 @@ $lincolor:#d0d0d1;
         }
       }
     }
+
     .c-bottom{
-      height: calc(503px - 131px - 20px);
-      padding:0 10%;
+      height: calc(503px - 261px - 20px);
+      padding:10px 0 0 7%;
       position: relative;
+      .cb-title{
+        color: #a5a5a5;
+        font-size: 16px;
+      }
+      .cb-input{
+        width: 252px;
+      }
       .btn{
         bottom: 20px;
         right: 20px;
         position: absolute;
         background-color: #2ae1d7;
-        width: 90px;
+        width: 72px;
         text-align: center;
         line-height: 30px;
         height: 30px;
@@ -228,6 +245,13 @@ $lincolor:#d0d0d1;
         cursor: pointer;
       }
     }
+     .c-b-en{
+      height: calc(503px - 131px - 20px);
+      padding:0 7%;
+      .cb-input{
+        width: 100%;
+      }
+    }
   }
   .active{
     max-height: 503px;

+ 4 - 2
pc/src/page/layout/aside/temp/ltemp/forget.vue

@@ -130,10 +130,12 @@ export default {
       if (this.password.length < 8 || this.confirmpass.length < 8) {
         return this.$toast.show('warn', this.langToast['31'])
       }
+
+      let temp = encodeStr(Base64.encode(this.password), Base64.encode(this.confirmpass))
       let params = {
-        password: encodeStr(Base64.encode(this.password)),
+        password: temp[0],
         phoneNum: this.phone,
-        confirmPwd: this.confirmpass,
+        confirmPwd: temp[1],
         msgAuthCode: this.authCode
       }
       let res = await this.$http({

+ 6 - 0
pc/src/page/layout/aside/temp/ltemp/login.vue

@@ -150,6 +150,12 @@ export default {
       if (!reg.phone.test(this.phone)) {
         return
       }
+      let resp = await this.$http
+        .post('/sso/user/checkUser', {phoneNum: this.phone})
+
+      if (resp.data.code !== 0) {
+        return this.$toast.show('warn', this.langToast[resp.data.code])
+      }
       let res = await this.$store.dispatch('getAuthCode', {
         phone: this.phone,
         code: Number(this.codeActive[1].substr(1))

+ 4 - 2
pc/src/page/layout/aside/temp/ltemp/register.vue

@@ -165,13 +165,15 @@ export default {
       }
 
       let country = Number(this.codeActive[1].substr(1))
+      let temp = encodeStr(Base64.encode(this.password), Base64.encode(this.confirmPass))
+
       let params = {
-        password: encodeStr(Base64.encode(this.password)),
+        password: temp[0],
         phoneNum: this.phone,
         msgAuthCode: this.authCode,
         nickName: this.nickname,
         country,
-        confirmPwd: this.confirmPass
+        confirmPwd: temp[1]
       }
       let res = await this.$http({
         method: 'post',

+ 4 - 3
pc/src/page/manage/temp/change.vue

@@ -8,7 +8,6 @@
         <input autocomplete="off" v-model="code" type="text" :placeholder="langModify.codep">
         <div v-if="!jishi" @click="getAuthCode" class="code btn parmary">{{langModify.code}}</div>
         <div v-else class="code btn parmary">{{language==='en'?`Resend after ${interTime}s`:`${interTime}s后重新发送`}}</div>
-
       </div>
       <div class="input">
         <input readonly onfocus="this.removeAttribute('readonly')"  autocomplete="new-password" :style="{color:password&&password.length<8?'#ff0000':'#000'}" maxlength='16' v-model="password" type="password" :placeholder="langModify.newpass">
@@ -108,10 +107,12 @@ export default {
         return
       }
 
+      let temp = encodeStr(Base64.encode(this.password), Base64.encode(this.confirmpass))
+
       let params = {
-        password: encodeStr(Base64.encode(this.password)),
+        password: temp[0],
         phoneNum: this.info.userName,
-        confirmPwd: this.confirmpass,
+        confirmPwd: temp[1],
         msgAuthCode: this.code
       }
 

+ 2 - 2
pc/src/store/language/home_cn.js

@@ -230,8 +230,8 @@ export default {
     ]
   },
   chat: {
-    title: '联系我们!<br/>请留下您的信息,我们将会在2个工作日内回复您。',
-    p1: '请留下您的联系方式(邮箱地址或电话号码)',
+    title: '微信客服<br/><span style="font-size:14px">工作时间:周一至周五9:00-18:30</span>',
+    p1: '请留下您的联系方式 (邮箱或电话号码)',
     p2: '请留下您的电话',
     p3: '请写下您的留言信息',
     send: '发送'

+ 7 - 1
pc/src/util/index.js

@@ -72,7 +72,7 @@ module.exports = {
       //  ':' + (String(second).length > 1 ? second : '0' + second)
   },
 
-  encodeStr: function (str) {
+  encodeStr: function (str, strv = '') {
     const NUM = 2
     const front = randomWord(false, 8)
     const middle = randomWord(false, 8)
@@ -81,6 +81,12 @@ module.exports = {
     let str1 = str.substring(0, NUM)
     let str2 = str.substring(NUM)
 
+    if (strv) {
+      let strv1 = strv.substring(0, NUM)
+      let strv2 = strv.substring(NUM)
+      return [front + str2 + middle + str1 + end, front + strv2 + middle + strv1 + end]
+    }
+
     return front + str2 + middle + str1 + end
   }
 }