mpaccount.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view>
  3. <image mode="widthFix" style="width: 100%;" :src="param.mpaccount"></image>
  4. <view class="padding">
  5. <view class="text-xl text-bold padding-tb solid-bottom">嵌入公众号</view>
  6. <view class="padding-tb text-lg solids-bottom">APPID:{{appid}}</view>
  7. <view class="padding-tb text-lg solids-bottom">小店主页路径:/pages/worker/shop?workerid={{workerinfo.id}}</view>
  8. <view class="padding flex flex-direction">
  9. <button class="cu-btn bg-blue margin-tb-sm lg" @tap="setCopyText">一键复制</button>
  10. </view>
  11. <view class="padding flex flex-direction">
  12. <button class="cu-btn bg-blue lg" @tap="goPage('/pages/tool/sinpage?field=wxmp')">不知道怎么使用?点击看说明!</button>
  13. </view>
  14. </view>
  15. <!-- 说明书弹框 -->
  16. <view class="cu-modal" :class="modal.name=='agreeModal'?'show':''">
  17. <view class="cu-dialog agreemodal">
  18. <image class="" src="../../static/images/weituo.png" mode="widthFix"></image>
  19. <text class="cuIcon-close text-white closeIcon padding" @tap="hideModalzql"></text>
  20. <view class="flex-direction align-center avatarBox" style="border-radius: 15rpx 15rpx 0 0; background-color: #FFFFFF;">
  21. <view class="padding-tb text-lg">1.打开微信公众平台
  22. 2.点击跨界菜单</view>
  23. </view>
  24. <view class="agreeBtn padding-top-xs" @tap="agreeCommission">
  25. <text>&nbsp;</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. var _this;
  33. export default {
  34. data() {
  35. return {
  36. param: {},
  37. userinfo: false,
  38. workerinfo: null,
  39. appid: "",
  40. modal: {
  41. name: null
  42. }
  43. }
  44. },
  45. onLoad: function() {
  46. _this = this;
  47. _this.userinfo = uni.getStorageSync('userinfo') || false;
  48. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  49. if (_this.workerinfo === false) {
  50. uni.reLaunch({
  51. url: "/pages/my/my"
  52. });
  53. return false;
  54. }
  55. _this.$req.ajax({
  56. path: "worker/pagempaccount",
  57. data: {}
  58. }).then((data) => {
  59. _this.param = data.param;
  60. _this.appid = data.appid;
  61. }).catch((err) => {
  62. uni.showModal({
  63. title: '信息提示',
  64. content: err,
  65. showCancel: false
  66. });
  67. });
  68. },
  69. methods: {
  70. setCopyText: function(pageurl) {
  71. uni.setClipboardData({
  72. data: "APPID:"+_this.appid+",小店主页路径:/pages/worker/shop?workerid="+_this.workerinfo.id,
  73. success: function () {
  74. console.log('success');
  75. }
  76. });
  77. },
  78. openShuoming: function() {
  79. _this.showModal('agreeModal');
  80. },
  81. // 弹窗显示隐藏
  82. showModal: function(e) {
  83. // var modalname = e.currentTarget ? e.currentTarget.dataset.modalname : e;
  84. _this.modal.name = e;
  85. uni.hideTabBar();
  86. },
  87. goPage: function(pageurl) {
  88. uni.navigateTo({
  89. url: pageurl,
  90. fail: function() {
  91. uni.switchTab({
  92. url: pageurl
  93. });
  94. }
  95. });
  96. },
  97. hideModalzql: function() {
  98. console.log("不接受委托,关闭弹窗");
  99. uni.setStorageSync('parentid', 0);
  100. _this.modal.name = null;
  101. uni.showTabBar();
  102. }
  103. }
  104. }
  105. </script>
  106. <style>
  107. /* 小程序码进入同意经纪人委托弹窗 */
  108. .agreemodal {
  109. width: 85%;
  110. height: auto;
  111. background: rgba(0,0,0,0);
  112. border-radius: 15rpx;
  113. }
  114. .avatarBox {
  115. position: absolute;
  116. top: 70rpx;
  117. left: 0;
  118. right: 0;
  119. bottom: 0;
  120. margin: 0 auto;
  121. font-weight: 600;
  122. }
  123. .closeIcon {
  124. width: 40rpx;
  125. height: 40rpx;
  126. font-size: 40rpx;
  127. position: absolute;
  128. top: 0;
  129. right: 0;
  130. }
  131. .agreeBtn {
  132. width: 85%;
  133. position: absolute;
  134. top: 73%;
  135. left: 0;
  136. right: 0;
  137. bottom: 14.5%;
  138. margin: 0 auto;
  139. border-radius: 15rpx;
  140. }
  141. </style>