多租户商城-商户小程序端
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.

274 lines
8.2 KiB

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