多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

286 lines
7.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view>
  3. <u-mask :show="show" z-index="10000">
  4. <view class="warp">
  5. <view class="rect" @tap.stop>
  6. <!-- 关闭按钮 -->
  7. <image @click="showcos" src="http://36.138.125.206:8081/ceres-local-file/static/img/guanbi.png" class="guanbi" mode=""></image>
  8. <!-- 内容 -->
  9. <view>
  10. <image src="http://36.138.125.206:8081/ceres-local-file/static/img/banyuan.png" style="width: 100%;height: 44rpx;" mode=""></image>
  11. </view>
  12. <view style="padding: 30rpx;">
  13. <!-- 个人信息 -->
  14. <view class="user">
  15. <view>
  16. <image :src="listitem.headImage" style="width: 90rpx;height: 90rpx;border-radius: 50%;"
  17. mode=""></image>
  18. </view>
  19. <view style="margin-left: 20rpx;">
  20. <p style="margin-top: 5rpx; font-size: 28rpx;">{{listitem.name}}</p>
  21. <p style="margin-top: 10rpx; font-size: 20rpx; color: #9A9A9A;">
  22. {{listitem.extensionReason}}</p>
  23. </view>
  24. <view style="color: #C5AA7B;font-size: 24rpx;flex: 1; text-align: right;line-height: 45rpx;"
  25. v-if="listitem.invitationCode">
  26. 邀请码{{listitem.invitationCode}}
  27. </view>
  28. </view>
  29. <!-- 图片宣传 -->
  30. <view>
  31. <image :src="listitem.image" style="width: 100%;height:500rpx;" mode=""></image>
  32. </view>
  33. <view style="display: flex;margin-top: 40upx;">
  34. <view style="flex: 1;line-height: 40rpx;">
  35. <p style="color: #343434;font-size: 24rpx;">点击二维码保存到本地长按识别小程序</p>
  36. <p style="color: #666666;font-size: 22rpx;">来自cereshop商城小程序</p>
  37. </view>
  38. <view style="margin-left: 60rpx;" v-if="listitem.ifLogo">
  39. <!-- <image :src="img" style="width: 118rpx;height: 118rpx;" mode=""></image> -->
  40. <view class="qrimg-i" @click="saveQrcode">
  41. <tki-qrcode :show="true" cid="qrcode2" ref="qrcode" :val="erweima" :size="size"
  42. :onval="onval" :loadMake="loadMake" :usingComponents="true" />
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 分享 -->
  48. </view>
  49. </view>
  50. <view class="fenx">
  51. <view class="shareBox">
  52. <button open-type="share">
  53. <view @click="WXfenx" style="flex: 1;text-align: center;display: flex;">
  54. <view style="margin-left: 120rpx;">
  55. <image src="http://36.138.125.206:8081/ceres-local-file/static/img/weixin2x.png" mode=""></image>
  56. </view>
  57. <view style="margin-left: 10rpx;font-size: 28rpx;color: #333333">分享到微信</view>
  58. </view>
  59. </button>
  60. </view>
  61. <!-- <view class="share">-->
  62. <!-- <button open-type="share">-->
  63. <!-- <image :src="item.icon" mode='heightFix' @click="share_action"></image>-->
  64. <!-- <text>分享</text>-->
  65. <!-- </button>-->
  66. <!-- </view>-->
  67. <view class="linkBtnBox" @click="FZlianj">
  68. <view class="linkBox">
  69. <image src="http://36.138.125.206:8081/ceres-local-file/static/img/lianjie.png" mode=""></image>
  70. </view>
  71. <view style="margin-left: 10rpx;">
  72. 复制链接
  73. </view>
  74. </view>
  75. </view>
  76. </u-mask>
  77. </view>
  78. </template>
  79. <script>
  80. const NET = require('../../utils/request')
  81. const API = require('../../config/api')
  82. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
  83. export default {
  84. data() {
  85. return {
  86. size: 110, // 二维码大小
  87. onval: true, // val值变化时自动重新生成二维码
  88. loadMake: true, // 组件加载完成后自动生成二维码
  89. erweima: '',
  90. show: true,
  91. item: {},
  92. listitem: {},
  93. FindSalesPromQuery: {
  94. type: 1,
  95. tenantCode: ''
  96. },
  97. shopId: 0,
  98. salesId: 0
  99. }
  100. },
  101. components: {
  102. tkiQrcode
  103. },
  104. onLoad: function(options) {
  105. this.shopId = JSON.parse(options.shopId)
  106. this.salesId = uni.getStorageSync("salesId")
  107. this.erweima = '/pages/tabbar/index/index'
  108. this.getFindSalesPromConfig()
  109. },
  110. onShow() {
  111. //这是设置右上角的三个点点击后是否可以分享给微信好友,或朋友圈
  112. wx.showShareMenu({
  113. withShareTicket: true,
  114. //设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
  115. menus: ["shareAppMessage", "shareTimeline"]
  116. })
  117. },
  118. methods: {
  119. getFindSalesPromConfig() {
  120. NET.request(API.FindSalesPromConfig, {
  121. title: "推广店铺",
  122. shopId: this.shopId,
  123. distributorId: this.salesId
  124. }, 'GET').then(res => {
  125. this.listitem = res.data
  126. }).catch(res => {})
  127. },
  128. showcos() {
  129. uni.navigateBack({
  130. delta: 1
  131. })
  132. },
  133. WXfenx() {},
  134. FZlianj() {
  135. // API.shareLink + '/#/pages/store/index?storeId='+this.shopId+'&salesId='+this.salesId
  136. uni.setClipboardData({
  137. data: API.shareLink + '/#/pages_category_page1/store/index?storeId=' + this.shopId,
  138. success: res => {
  139. uni.showToast({
  140. title: '复制成功',
  141. icon: 'none',
  142. duration: 2000 //时间
  143. });
  144. }
  145. })
  146. },
  147. // 分享到朋友圈
  148. onShareTimeline(options) {
  149. let that = this
  150. let data = {
  151. title: '', // 默认是小程序的名称
  152. path: '/pages_category_page1/store/index?storeId=' + this.shopId,
  153. imageUrl: '', // 图片封面,本地文件路径、网络图片路,支持PNG及JPG,默认当前页面截图,显示图片长宽比是 5:4。
  154. success: res => {
  155. // 分享成功
  156. if (res.errMsg == 'shareAppMessage:ok') {}
  157. },
  158. fail: res => {
  159. // 用户取消
  160. if (res.errMsg == 'shareAppMessage:fail cancel') {}
  161. // 分享失败
  162. if (res.errMsg == 'shareAppMessage:fail') {}
  163. },
  164. complete: res => {}
  165. }
  166. return data
  167. },
  168. // 分享给好友
  169. onShareAppMessage(options) {
  170. var that = this;
  171. // 设置菜单中的转发按钮触发转发事件时的转发内容
  172. var shareObj = {
  173. title: '', // 默认是小程序的名称(可以写slogan等)
  174. desc: '', // 小程序的描述
  175. path: '/pages_category_page1/store/index?storeId=' + this.shopId, // 默认是当前页面,必须是以‘/’开头的完整路径
  176. imageUrl: '', // 图片封面,本地文件路径、网络图片路,支持PNG及JPG,默认当前页面截图,显示图片长宽比是 5:4。
  177. success: function(res) {
  178. // 转发成功之后的回调
  179. if (res.errMsg == 'shareAppMessage:ok') {
  180. }
  181. },
  182. fail: function() {
  183. // 转发失败之后的回调
  184. if (res.errMsg == 'shareAppMessage:fail cancel') {
  185. // 用户取消转发
  186. } else if (res.errMsg == 'shareAppMessage:fail') {
  187. // 转发失败,其中 detail message 为详细失败信息
  188. }
  189. },
  190. complete: function() {
  191. // 转发结束之后的回调(转发成不成功都会执行)
  192. }
  193. }
  194. // 来自页面内的按钮的转发
  195. if (options.from == 'button') {
  196. var eData = options.target.dataset;
  197. // 此处可以修改 shareObj 中的内容
  198. shareObj.path = '/pages_category_page1/store/index?storeId=' + this.shopId
  199. }
  200. // 返回shareObj
  201. return shareObj;
  202. },
  203. saveQrcode() {
  204. this.$refs.qrcode._saveCode()
  205. }
  206. }
  207. }
  208. </script>
  209. <style lang="scss" scoped>
  210. .warp {
  211. display: flex;
  212. align-items: center;
  213. justify-content: center;
  214. height: 100%;
  215. }
  216. .qrimg-i {
  217. margin-right: 10px;
  218. }
  219. .rect {
  220. width: 75%;
  221. height: 65%;
  222. background-color: #fff;
  223. position: relative;
  224. .guanbi {
  225. width: 46rpx;
  226. height: 46rpx;
  227. position: absolute;
  228. top: -100rpx;
  229. left: 50%;
  230. margin-left: -23rpx;
  231. }
  232. .user {
  233. display: flex;
  234. }
  235. }
  236. .fenx {
  237. position: fixed;
  238. bottom: 118rpx;
  239. z-index: 10001;
  240. background-color: #F7F7F7;
  241. width: 100%;
  242. height: 98rpx;
  243. display: flex;
  244. color: #343434;
  245. view {
  246. line-height: 98rpx;
  247. }
  248. image {
  249. width: 50rpx;
  250. height: 50rpx;
  251. display: inline-block;
  252. margin-top: 25rpx;
  253. }
  254. }
  255. .linkBtnBox {
  256. flex: 1;
  257. text-align: center;
  258. display: flex;
  259. .linkBox {
  260. margin-left: 70rpx;
  261. }
  262. }
  263. // #ifdef H5
  264. .fenx {
  265. display: none;
  266. }
  267. // #endif
  268. </style>