index - 副本.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="content">
  3. <view class="img-div">
  4. <img class="img" v-for="url in images" :src="url" />
  5. <!-- <view class="text-color">
  6. 重庆润天健康管理有限公司,主营中医养生课程,课程内容包括居家养生,食疗食补房子,穴位养生等,针对50岁以上中老年人群,0基础即可学习,每天30分钟,在家轻松学。
  7. </view> -->
  8. <!-- <view class="foot-box">
  9. <span>重庆润天健康管理有限公司</span>
  10. <span>重庆市经开区长生桥镇蔷薇路46号5-1 18523923647</span>
  11. </view> -->
  12. </view>
  13. <view class="box"></view>
  14. <view class="foot">
  15. <view class="butt">
  16. <!-- <u-button type="success" text="加微" @click="show = true"></u-button> -->
  17. <!-- <button data-agl-cvt="35">复制微信</button> -->
  18. <div class="copy">
  19. <span class='title'>免费领取养生课程</span>
  20. <!-- 点击微信号之后复制,设置转化类型为35(微信复制按钮点击) -->
  21. <span @click="clickToWx" class="clickbox shake-animation">点击加微</span>
  22. </div>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import Clipboard from 'clipboard'; // 引入Clipboard
  29. import {getTemplate,callback,youkuClickCallback} from '../../api/api.js'
  30. import {clicks} from '../../common/common.js'
  31. export default {
  32. data() {
  33. return {
  34. images: [],
  35. data: {},
  36. json: {},
  37. vid: '',
  38. click_id: '',
  39. aid: '',
  40. no: '',
  41. type: 0,
  42. show: false,
  43. name: '',
  44. tel: '',
  45. accountId: '',
  46. ip: ''
  47. }
  48. },
  49. mounted() {
  50. window.vueInstance = this; // 将 Vue 实例暴露到全局
  51. },
  52. onLoad(option) {
  53. this.vid = option.bd_vid;
  54. if(option.type){
  55. this.type = option.type;
  56. }
  57. if(option.aid){
  58. this.aid = option.aid;
  59. }
  60. if(option.click_id){
  61. this.click_id = option.click_id;
  62. }
  63. if(option.ip){
  64. this.ip = option.ip;
  65. }
  66. if(option.accountId){
  67. this.accountId = option.accountId;
  68. }
  69. this.no = option.no;
  70. if(option.no == null || option.no == "" || option.no == undefined){
  71. uni.showToast({
  72. icon:'none',
  73. title: '地址错误',
  74. });
  75. return;
  76. }
  77. getTemplate(option.no).then(e => {
  78. this.data = e.data;
  79. this.json = JSON.parse(e.data.json)
  80. })
  81. // callback({vid: this.vid}).then(e => {
  82. // console.info(e)
  83. // })
  84. },
  85. methods: {
  86. confirm() {
  87. this.show = false;
  88. },
  89. clickToWx(){
  90. // 百度
  91. if(this.type == 0){
  92. callback({url: window.location.href, no: this.no, bdVid: this.vid, t: 67}).then(e => {
  93. window.location.href = this.json.wxNo + "?customer_channel=" + this.vid;
  94. })
  95. }
  96. // 优酷
  97. if(this.type == 1){
  98. youkuClickCallback({accountId: this.accountId, deeplink_url: window.location.href, no: this.no, bd_vid: this.vid, aid: this.aid, click_id: this.click_id, ip: this.ip}).then(e => {
  99. window.location.href = this.json.wxNo + "?customer_channel=" + this.vid;
  100. })
  101. }
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .text-color{
  108. text-align: center;
  109. width: 90%;
  110. margin: 0 auto;
  111. font-size: 14px;
  112. }
  113. .foot-box{
  114. display: flex;
  115. flex-direction: column;
  116. margin: 4px 0;
  117. span{
  118. margin: 0;
  119. line-height:16px;
  120. font-size: 12px;
  121. }
  122. }
  123. .box{
  124. height: 50px;
  125. }
  126. .content {
  127. text-align: center;
  128. }
  129. .img-div{
  130. margin: 0 auto;
  131. display: flex;
  132. flex-direction: column;
  133. }
  134. .img{
  135. width: 100%;
  136. }
  137. .foot{
  138. background-color: #fff;
  139. font-size: 13px;
  140. width: 100%;
  141. margin-top: 20px;
  142. line-height: 50px;
  143. color: #848b99;
  144. text-align: center;
  145. position: fixed;
  146. bottom: 0;
  147. }
  148. .butt{
  149. /* width: 80px; */
  150. margin: 0 auto;
  151. }
  152. .copy{
  153. width: 100%;
  154. justify-content: space-around;
  155. background-color: #07c160;
  156. margin: 0 auto;
  157. color: #fff;
  158. display: flex;
  159. align-items: center;
  160. // justify-content: center;
  161. .title{
  162. font-size: 20px;
  163. font-weight: bold;
  164. letter-spacing: 5px;
  165. }
  166. }
  167. .clickbox{
  168. background-color: #fff;
  169. color: #07c160;
  170. display: inline-block;
  171. width: 100px;
  172. height: 40px;
  173. line-height: 40px;
  174. border-radius: 4px;
  175. font-size: 18px;
  176. font-weight: bold;
  177. }
  178. @keyframes shake-animation {
  179. 0% { transform: scale(1); }
  180. 25% { transform: scale(1.1); }
  181. 50% { transform: scale(1); }
  182. 75% { transform: scale(1.1); }
  183. 100% { transform: scale(1); }
  184. }
  185. .shake-animation {
  186. animation: shake-animation 1.5s;
  187. animation-iteration-count: infinite; /* 使动画无限循环 */
  188. }
  189. </style>