activity-contact.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="cm-contact" v-if="activityEntryVisiable || contactVisiable">
  3. <!-- 未展开状态 -->
  4. <view class="cm-close-box" v-show="!isActive">
  5. <view class="cm-icon cm-entry" @click="handleToggleEntry(true)" v-if="activityEntryVisiable"></view>
  6. <view class="cm-icon cm-bround cm-open-btn" @click="handleToggleAcitve(true)" v-if="contactVisiable"></view>
  7. </view>
  8. <!-- 展开状态 -->
  9. <view class="cm-close-box" v-show="contactVisiable && isActive">
  10. <view class="cm-icon cm-entry" @click="handleToggleEntry(true)" v-if="activityEntryVisiable"></view>
  11. <view class="cm-icon regexp" @click="handleToCouponExp">优惠券\n规则</view>
  12. <view class="cm-icon cm-bround cm-mobile" @click="handelShowMobile">
  13. <view class="cm-dialog" v-show="mobileVisiable">
  14. <view class="cm-dialog-content content1">
  15. <view class="cm-item" @click="phoneCall('15338897365')">
  16. <text>展会咨询电话:15338897365</text>
  17. </view>
  18. <view class="cm-line line1"></view>
  19. <view class="cm-item" @click="phoneCall('15338851365')">
  20. <text>客服咨询电话:15338851365</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="cm-icon cm-bround cm-ewm" @click="handelShowWechat">
  26. <view class="cm-dialog" v-show="wechatVisiable">
  27. <view class="cm-dialog-content content2">
  28. <view class="cm-item">
  29. <image
  30. show-menu-by-longpress
  31. src="https://static.caimei365.com/app/img/icon2/cm_wechat_02.png"
  32. mode="widthFix"
  33. ></image>
  34. <text>展会咨询微信</text>
  35. </view>
  36. <view class="cm-line line2"></view>
  37. <view class="cm-item">
  38. <image
  39. show-menu-by-longpress
  40. src="https://static.caimei365.com/app/img/icon2/cm_wechat_01.png"
  41. mode="widthFix"
  42. ></image>
  43. <text>客服咨询微信</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="cm-icon cm-bround cm-close-btn" @click="handleToggleAcitve(false)"></view>
  49. </view>
  50. <view class="mask cover" v-if="activityEntryVisiable && entryVisiable">
  51. <view class="content">
  52. <!-- <image
  53. src="https://static.caimei365.com/app/img/icon2/cm_entry_bg.png"
  54. mode="widthFix"
  55. @click="handleToggleCoupon(true)"
  56. ></image> -->
  57. <image
  58. src="https://static.caimei365.com/app/img/icon2/coupon-entry-app.png"
  59. @click="handleNaviagtorToCoupon"
  60. mode="widthFix"
  61. ></image>
  62. <view class="mask-close" @click="handleToggleEntry(false)"></view>
  63. </view>
  64. </view>
  65. <!-- <view class="mask cover" v-if="showCouponEntry">
  66. <view class="content">
  67. <view class="btn btn1" @click="navigatorToPro(1)"></view>
  68. <view class="btn btn2" @click="navigatorToPro(2)"></view>
  69. <image src="https://static.caimei365.com/app/img/icon2/coupon-entry-app.png" mode="widthFix"></image>
  70. <view class="mask-close" @click="handleToggleCoupon(false)"></view>
  71. </view>
  72. </view>
  73. <view class="mask cover" v-if="showCouponEntryNew">
  74. <view class="content">
  75. <image
  76. src="https://static.caimei365.com/app/img/icon2/coupon-entry-app.png"
  77. mode="widthFix"
  78. @click="handleNaviagtorToCoupon"
  79. ></image>
  80. <view class="mask-close" @click="showCouponEntryNew = false"></view>
  81. </view>
  82. </view> -->
  83. <view class="mask" v-if="mobileVisiable || wechatVisiable" @click="handleClose"></view>
  84. </view>
  85. </template>
  86. <script>
  87. export default {
  88. props: {
  89. pageInfo: {
  90. type: Object
  91. }
  92. },
  93. data() {
  94. return {
  95. isActive: true,
  96. mobileVisiable: false,
  97. wechatVisiable: false,
  98. entryVisiable: true,
  99. activityEntryVisiable: false,
  100. contactVisiable: false,
  101. showCouponEntry: false,
  102. showCouponEntryNew: false
  103. }
  104. },
  105. created() {
  106. this.contactVisiable = this.pageInfo.infoBarStatus === 1
  107. this.activityEntryVisiable = this.initActivityEntry(
  108. this.pageInfo.redPacketBeginTime,
  109. this.pageInfo.redPacketEndTime
  110. )
  111. this.showCouponEntryNew = true
  112. console.log(this.pageInfo)
  113. },
  114. methods: {
  115. // 拨打电话
  116. phoneCall(number) {
  117. console.log(number)
  118. uni.makePhoneCall({
  119. phoneNumber: number //仅为示例
  120. })
  121. },
  122. // 是否展开
  123. handleToggleAcitve(active) {
  124. this.isActive = active
  125. this.mobileVisiable = false
  126. this.wechatVisiable = false
  127. },
  128. // 显示微信二维码
  129. handelShowWechat() {
  130. this.wechatVisiable = !this.wechatVisiable
  131. this.mobileVisiable = false
  132. },
  133. // 显示联系电话
  134. handelShowMobile() {
  135. this.mobileVisiable = !this.mobileVisiable
  136. this.wechatVisiable = false
  137. },
  138. // 隐藏微信二维码和联系电话
  139. handleClose() {
  140. this.mobileVisiable = false
  141. this.wechatVisiable = false
  142. },
  143. // 显示活动入口
  144. handleToggleEntry(visiable) {
  145. this.entryVisiable = visiable
  146. },
  147. // 跳转到领取优惠券
  148. handleNaviagtorToCoupon() {
  149. this.$api.navigateTo('/pages/user/coupon/coupon-collection')
  150. },
  151. handleToCouponExp() {
  152. // this.$api.navigateTo('/pages/h5/activity/couponExp')
  153. this.$api.navigateTo('/pages/h5/article/path?link=https://www.caimei365.com/help/1038.html')
  154. },
  155. navigatorToPro(flag) {
  156. // 友盟自定义事件
  157. if (process.env.NODE_ENV != 'development') {
  158. if (flag === 2) {
  159. this.$uma.trackEvent('meibohui_Coupon_detail_click', {
  160. Um_Key_PageName: '云上美博会优惠券介绍',
  161. Um_Key_PageCategory: '活动专题页面',
  162. Um_Key_SourcePage: '活动专题页面'
  163. })
  164. }
  165. if (flag === 1) {
  166. this.$uma.trackEvent('meibohui_Coupon_buy_click', {
  167. Um_Key_PageName: '云上美博会优惠券购买跳转',
  168. Um_Key_PageCategory: '活动专题页面',
  169. Um_Key_SourcePage: '活动专题页面'
  170. })
  171. }
  172. }
  173. if (flag === 2) this.$api.navigateTo('/pages/h5/activity/couponExp')
  174. else this.$api.navigateTo('/pages/goods/product?id=6898')
  175. this.entryVisiable = false
  176. this.showCouponEntry = false
  177. },
  178. // 优惠券入口
  179. handleToggleCoupon(flag) {
  180. // 友盟自定义事件
  181. if (flag && process.env.NODE_ENV != 'development') {
  182. this.$uma.trackEvent('meibohui_Coupon_click', {
  183. Um_Key_PageName: '云上美博会获取弹窗点击',
  184. Um_Key_PageCategory: '活动专题页面',
  185. Um_Key_SourcePage: '活动专题页面'
  186. })
  187. }
  188. this.showCouponEntry = flag
  189. this.entryVisiable = false
  190. },
  191. // 初始化红包入口状态
  192. initActivityEntry(begin, end) {
  193. const nowTime = new Date().getTime()
  194. // 兼容 iso android 的时间处理
  195. const beginTime = new Date(begin.replace(/-/g, '/')).getTime()
  196. const endTime = new Date(end.replace(/-/g, '/')).getTime()
  197. console.log('活动是否开始: ')
  198. console.log(nowTime >= beginTime && nowTime <= endTime)
  199. return nowTime >= beginTime && nowTime <= endTime
  200. }
  201. }
  202. }
  203. </script>
  204. <style lang="scss" scoped>
  205. .cm-contact {
  206. position: fixed;
  207. right: 20rpx;
  208. bottom: 240rpx;
  209. z-index: 9999;
  210. }
  211. .cm-close-box {
  212. position: relative;
  213. z-index: 9;
  214. .cm-icon {
  215. position: relative;
  216. width: 80rpx;
  217. height: 80rpx;
  218. margin: 10rpx 0;
  219. &.regexp {
  220. border-radius: 50%;
  221. font-size: 20rpx;
  222. background: rgba(0, 0, 0, 0.4);
  223. justify-content: center;
  224. align-items: center;
  225. display: flex;
  226. color: #fff;
  227. text-align: center;
  228. }
  229. &.cm-bround {
  230. border-radius: 50%;
  231. }
  232. &.cm-entry {
  233. height: 88rpx;
  234. background: url(https://static.caimei365.com/app/img/icon2/cm_entry_icon.png) no-repeat center;
  235. background-size: 80rpx;
  236. }
  237. &.cm-open-btn {
  238. background: rgba(0, 0, 0, 0.4) url(https://static.caimei365.com/app/img/icon2/cm_open.png) no-repeat center;
  239. background-size: 39rpx;
  240. }
  241. &.cm-mobile {
  242. background: rgba(0, 0, 0, 0.4) url(https://static.caimei365.com/app/img/icon2/cm_mobile.png) no-repeat
  243. center;
  244. background-size: 39rpx;
  245. }
  246. &.cm-ewm {
  247. background: rgba(0, 0, 0, 0.4) url(https://static.caimei365.com/app/img/icon2/cm_ewm.png) no-repeat center;
  248. background-size: 39rpx;
  249. }
  250. &.cm-close-btn {
  251. background: rgba(0, 0, 0, 0.4) url(https://static.caimei365.com/app/img/icon2/cm_close.png) no-repeat center;
  252. background-size: 39rpx;
  253. }
  254. }
  255. }
  256. .cm-dialog {
  257. top: 0;
  258. right: 110rpx;
  259. position: absolute;
  260. padding: 20rpx;
  261. background: rgb(255, 92, 0);
  262. border-radius: 16rpx;
  263. z-index: 99999;
  264. &::after {
  265. position: absolute;
  266. top: 20rpx;
  267. right: -20rpx;
  268. content: '';
  269. display: block;
  270. width: 0;
  271. height: 0;
  272. border-top: 16rpx solid transparent;
  273. border-bottom: 16rpx solid transparent;
  274. border-left: 20rpx solid rgb(255, 92, 0);
  275. }
  276. .cm-line {
  277. &.line1 {
  278. width: 100%;
  279. height: 1px;
  280. background: #fff;
  281. margin: 10rpx 0;
  282. }
  283. &.line2 {
  284. width: 1px;
  285. height: 200rpx;
  286. background: #eee;
  287. margin: 0 16rpx;
  288. margin-top: -50rpx;
  289. }
  290. }
  291. .content1 {
  292. .cm-item {
  293. color: #fff;
  294. text {
  295. display: block;
  296. width: 400rpx;
  297. font-size: 28rpx;
  298. text-align: center;
  299. }
  300. }
  301. }
  302. .content2 {
  303. display: flex;
  304. justify-content: space-between;
  305. align-items: center;
  306. .cm-item {
  307. color: #fff;
  308. text {
  309. display: block;
  310. font-size: 28rpx;
  311. text-align: center;
  312. margin-top: 10rpx;
  313. }
  314. image {
  315. width: 240rpx;
  316. height: 240rpx;
  317. }
  318. }
  319. }
  320. }
  321. .mask {
  322. display: flex;
  323. justify-content: center;
  324. align-items: center;
  325. position: fixed;
  326. // z-index: 999;
  327. top: 0;
  328. left: 0;
  329. width: 100vw;
  330. height: 100vh;
  331. .content {
  332. position: relative;
  333. .mask-close {
  334. z-index: 9;
  335. position: absolute;
  336. top: -80rpx;
  337. right: 40rpx;
  338. width: 64rpx;
  339. height: 64rpx;
  340. background: url(https://static.caimei365.com/app/img/icon2/cm_float_close.png) no-repeat center;
  341. background-size: 60rpx 60rpx;
  342. }
  343. .btn {
  344. width: 80rpx;
  345. height: 80rpx;
  346. background: #666;
  347. z-index: 9999;
  348. position: absolute;
  349. right: 60rpx;
  350. opacity: 0;
  351. &.btn1 {
  352. top: 175rpx;
  353. }
  354. &.btn2 {
  355. top: 350rpx;
  356. }
  357. }
  358. image {
  359. width: 560rpx;
  360. }
  361. }
  362. &.cover {
  363. z-index: 999999;
  364. background: rgba(0, 0, 0, 0.4);
  365. }
  366. }
  367. </style>