소스 검색

客服消息修改

xiabx 5 년 전
부모
커밋
8348037a21
3개의 변경된 파일25개의 추가작업 그리고 10개의 파일을 삭제
  1. 6 0
      src/api/index.js
  2. 1 1
      src/app.ux
  3. 18 9
      src/views/Index/index.ux

+ 6 - 0
src/api/index.js

@@ -144,3 +144,9 @@ export const chapterOrders = params => {
     `/books/${params.bid}/balance/chapterOrders/${params.chapter_id}`
   );
 };
+//用户客服二维码
+export const getCustomQrcode = () => {
+  return fly.get(
+    `/customer_img`
+  );
+};

+ 1 - 1
src/app.ux

@@ -28,7 +28,7 @@ export default {
   createShortcut: it.hasCreateShortCut,
   data: {
     backClickCount: 0,
-    cutomerQrcode: "https://cdn-novel.iycdm.com/static/img/kefu20190331.png",
+    cutomerQrcode: "",
     weChat:"wxlxf1099"
   }
 };

+ 18 - 9
src/views/Index/index.ux

@@ -28,7 +28,7 @@
       </div>
     </div>
     <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop"> </image>
-    <sign-page if="{{showSignPop}}" ></sign-page>
+    <sign-page if="{{showSignPop}}"></sign-page>
     <short-page if="{{showShortPop}}"></short-page>
     <div class="stack-popup" @click="closeWrap" if="showPopup">
       <div class="customer-popup">
@@ -36,8 +36,8 @@
         <text class="desc">
           复制微信号或者保存二维码到本地至微信添加客服好友
         </text>
-        <image src="{{$app.$def.data.cutomerQrcode}}" @longpress="saveImg"></image>
-        <div class="duplication"><text class="duplication-text">微信号:{{$app.$def.data.weChat}}</text><text class="duplication-button" @click="duplication">复制</text></div>
+        <image src="{{cutomerQrcode}}" @longpress="saveImg"></image>
+        <div class="duplication"><text class="duplication-text">微信号:{{cutomerName}}</text><text class="duplication-button" @click="duplication">复制</text></div>
       </div>
     </div>
   </stack>
@@ -46,6 +46,7 @@
 <script>
 import clipboard from '@system.clipboard';
 import prompt from '@system.prompt';
+import { getCustomQrcode } from '../../api/index.js';
 import { downImg, getStore } from '../../api/utils.js';
 export default {
   private: {
@@ -82,14 +83,17 @@ export default {
     current: 0,
     showPopup: false,
     showSignPop: false,
-    showShortPop: false
+    showShortPop: false,
+    cutomerQrcode: '',
+    cutomerName:''
   },
-   onInit() {
+  onInit() {
     this.$on('dispathEvt', this.changeSignPop);
     //今日已签到过不在弹框签到
-    if(this.$app.$def.data.backClickCount === 0){
-      this.showShortPop=true;
+    if (this.$app.$def.data.backClickCount === 0) {
+      this.showShortPop = true;
     }
+    this.getCoustom();
   },
   onBackPress() {
     // 退出逻辑
@@ -106,6 +110,11 @@ export default {
   onMenuPress() {
     this.$app.$def.showMenu();
   },
+  async getCoustom() {
+    let res = await getCustomQrcode();
+    this.cutomerQrcode = res.url;
+    this.cutomerName = res.name;
+  },
   tabbarChange(tab) {
     this.current = tab.index;
     this.$page.setTitleBar({ text: this.tabbar[tab.index].title });
@@ -122,7 +131,7 @@ export default {
   //复制客服微信
   duplication() {
     clipboard.set({
-      text: this.$app.$def.data.weChat,
+      text: this.cutomerName, 
       success: function (data) {
         prompt.showToast({
           message: '复制成功!'
@@ -132,7 +141,7 @@ export default {
   },
   //长按保存图片
   saveImg() {
-    downImg(this.$app.$def.data.cutomerQrcode);
+    downImg(this.cutomerQrcode);
   },
   openCustomer() {
     this.showPopup = true;