zhaojs
2023-06-10 69ea24e8fdfb41fc48c3fdb8c444645c13b1bbc4
uniapp/pages/rankinglist/common_act.vue
@@ -1,15 +1,19 @@
<template>
   <view>
      <web-view :webview-styles="webviewStyles" :src="webviewUrl" @message='received'></web-view>
   </view>
</template>
<script>
   var wv
   var wv;
   export default {
      data() {
         return {
            empowerModel: false,
            webviewUrl: '',
            user:'',
            webviewStyles: {
               progress: {
                  color: '#EE1B14'
@@ -25,9 +29,10 @@
         }
         else{
            const value = uni.getStorageSync('userInfo');
            console.log(value);
             this.user = value;
            if(options.t_url)
            {
               console.log(encodeURI(decodeURIComponent(options.t_url)+"?token="+value.token+"&userid="+value.id));
               this.webviewUrl = encodeURI(decodeURIComponent(options.t_url)+"?token="+value.token+"&userid="+value.id);
            }
         }
@@ -36,45 +41,21 @@
      onReady() {
        this.clearMuiBack();
      },
      methods: {
         received(e) {
            console.log(e);
            var res=e.detail.data[0];
            if(res.action=='target_tb')
             if(res.action=='back')
            {
               this.getTbsrc(res.data.goodsId);
               this.backLast();
            }
         },
         //跳转淘宝
         getTbsrc(goodsid) {
           var that = this;
           this.$u.api.getPrivilegeLink({
             goodsId: goodsid,
             type: 0
           }).then(e => {
              console.log(e);
             if (e.code != 0) return that.$alert(e.msg)
             var res = e.data.info;
             var tburl = res.shortUrl
             // #ifdef APP-PLUS
             if (plus.runtime.isApplicationExist({
                 pname: 'com.taobao.taobao',
                 action: 'taobao://'
               })) {
               const plug = uni.requireNativePlugin('xiguazhu-baichuan')
               plug.detailPage({
                 url: tburl,
                 "openType": 0
               }, result => {
                 //  console.log(result);
               });
             } else {
               uni.navigateTo({
                 url: '../webView/webView?url=' + tburl
               })
             }
             // #endif
           }).catch(function(err) {})
         backLast()
         {
            uni.navigateBack({
               delta: 1
            });
         },
         // 关闭mui返回
           clearMuiBack() {