examact.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="examact">
  3. <view class="examact-tname">{{ tenantInfo.name }}</view>
  4. <img
  5. :src="$method.splitImgHost('oss/images/file/20230320/1679298401443.png')"
  6. alt=""
  7. srcset=""
  8. />
  9. <view class="examact-btn" @click="collectMerch"> 点击领取真题题库 </view>
  10. <view class="examact-phone" v-if="tenantInfo.phone">
  11. 报名热线:
  12. <view>{{ tenantInfo.phone1 }}</view>
  13. <view>{{ tenantInfo.phone2 }}</view>
  14. </view>
  15. <view class="examact-qrcode">
  16. <tki-qrcode
  17. :show="true"
  18. :size="160"
  19. cid="qrcode1"
  20. ref="qrcode"
  21. :val="val"
  22. :showLoading="false"
  23. :loadMake="true"
  24. :usingComponents="true"
  25. />
  26. <img
  27. class="examact-qrcode111"
  28. :src="'../../static/qrcode/' + tenantInfo.qrcodeUrl"
  29. alt=""
  30. srcset=""
  31. />
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. const map = {
  37. "test.jqbao.net": {
  38. name: "测试云学堂",
  39. qrcodeUrl: "hnjsxt_act.png",
  40. goodsId: "7722",
  41. },
  42. "120.79.166.78:19006": {
  43. name: "广东省祥粤建设职业培训学校",
  44. qrcodeUrl: "h_act.png",
  45. phone: true,
  46. phone1: "020-87085982",
  47. phone2: "020-87085983",
  48. goodsId: "16370",
  49. },
  50. "h.xyyxt.net": {
  51. name: "广东省祥粤建设职业培训学校",
  52. qrcodeUrl: "h_act.png",
  53. phone: true,
  54. phone1: "020-87085982",
  55. phone2: "020-87085983",
  56. goodsId: "7798",
  57. },
  58. "www.hnjsxt.cn": {
  59. name: "企帮(广州)工程建设咨询服务有限公司",
  60. qrcodeUrl: "hnjsxt_act.png",
  61. scheme: "http://",
  62. learnUrl: "",
  63. goodsId: "8673",
  64. },
  65. "zsh5.zzyxt.net": {
  66. name: "中山市勘设工程咨询有限公司",
  67. qrcodeUrl: "zsh5_act.png",
  68. goodsId: "8678",
  69. },
  70. "zh5.zzyxt.net": {
  71. name: "肇庆市建筑业协会",
  72. qrcodeUrl: "zh5_act.png",
  73. goodsId: "8677",
  74. phone: true,
  75. phone1: "0758—2285500",
  76. phone2: "13600220253",
  77. },
  78. "sdyxt.gdzzkj.net": {
  79. name: "佛山市顺德区市政建设工程协会",
  80. qrcodeUrl: "sdyxt_act.png",
  81. goodsId: "8673",
  82. },
  83. "mh5.zzyxt.net": {
  84. name: "茂名市建设培训学校",
  85. qrcodeUrl: "mh5_act.png",
  86. goodsId: "8679",
  87. },
  88. "sxh5.zzyxt.net": {
  89. name: "山西晋锦建族教育咨询有限公司",
  90. qrcodeUrl: "sxh5_act.png",
  91. goodsId: "8676",
  92. },
  93. "yfh5.zzyxt.net": {
  94. name: "云浮市建筑业协会",
  95. qrcodeUrl: "yf_act.png",
  96. goodsId: "8672",
  97. },
  98. "h.kw-xy.com": {
  99. name: "深圳市凯文云学堂",
  100. qrcodeUrl: "kw-xy.png",
  101. goodsId: "8680",
  102. },
  103. };
  104. import { actCheck } from "../../common/httpList/act";
  105. import tkiQrcode from "tki-qrcode";
  106. import { tenantId, BASE_URL } from "@/common/request.js";
  107. export default {
  108. name: "SaasMiniprogramExamact",
  109. data() {
  110. return {
  111. goodsId: "",
  112. goodsType: "2",
  113. example:
  114. "http://localhost:8080/pages5/scan/examact?jump=www.hnjsxt.cn/detail/6",
  115. jump: undefined,
  116. sale: "",
  117. tenantInfo: {},
  118. t: "",
  119. };
  120. },
  121. onLoad(option) {
  122. this.jump = option.jump;
  123. this.sale = option.sale;
  124. this.tenantInfo = this.backInfo();
  125. this.goodsId = this.tenantInfo.goodsId;
  126. this.t = option.t;
  127. this.t && this.statistics();
  128. },
  129. methods: {
  130. collectMerch() {
  131. actCheck().then((res) => {
  132. if (res.data.code === 200) {
  133. //跳转去对应域名
  134. this.toDatail();
  135. } else {
  136. this.$u.toast(res.data.msg);
  137. }
  138. });
  139. },
  140. toDatail() {
  141. if (this.jump) {
  142. window.location.href =
  143. this.scheme + this.jump + "?sale=" + (this.sale || "");
  144. return;
  145. }
  146. uni.navigateTo({
  147. url:
  148. "/pages3/course/detail?id=" +
  149. this.goodsId +
  150. "&goodsType=" +
  151. this.goodsType +
  152. "&sale=" +
  153. (this.sale || "") +
  154. "&isAct=" +
  155. 1,
  156. });
  157. },
  158. backInfo() {
  159. let domain = this.jump ? this.jump.split("/")[0] : window.location.host;
  160. domain = this.$method.checkDomain(domain)
  161. ? domain
  162. : "120.79.166.78:19006";
  163. return map[domain];
  164. },
  165. statistics() {
  166. uni.request({
  167. url: BASE_URL + "/app/common/save/activity/record/" + this.t,
  168. method: "get",
  169. header: {
  170. TenantId: tenantId,
  171. },
  172. success: (res) => {},
  173. fail: (err) => {},
  174. });
  175. },
  176. },
  177. components: {
  178. tkiQrcode,
  179. },
  180. computed: {
  181. scheme() {
  182. return this.tenantInfo.scheme || "https://";
  183. },
  184. val() {
  185. return (
  186. this.scheme +
  187. (this.jump ||
  188. window.location.host + "/pages/questionBank/index?isAct=1")
  189. );
  190. },
  191. },
  192. };
  193. </script>
  194. <style lang="scss" scoped>
  195. .examact {
  196. position: relative;
  197. img {
  198. width: 100vw;
  199. }
  200. .examact-tname {
  201. position: absolute;
  202. top: 41rpx;
  203. left: 48rpx;
  204. font-size: 36rpx;
  205. color: #2e3174;
  206. font-weight: 500;
  207. }
  208. .examact-btn {
  209. width: 620rpx;
  210. height: 102rpx;
  211. position: absolute;
  212. top: 786rpx;
  213. left: 50%;
  214. margin-left: -310rpx;
  215. background: linear-gradient(90deg, #1762ff 0%, #4af7da 100%);
  216. box-shadow: 0px 9px 12px 0px rgba(50, 84, 130, 0.18);
  217. border-radius: 200rpx;
  218. line-height: 104rpx;
  219. text-align: center;
  220. font-weight: bold;
  221. color: #ffffff;
  222. font-size: 36rpx;
  223. }
  224. .examact-qrcode {
  225. width: 396rpx;
  226. display: flex;
  227. position: absolute;
  228. justify-content: space-between;
  229. right: 32rpx;
  230. bottom: 122rpx;
  231. img {
  232. width: 180rpx;
  233. height: 180rpx;
  234. }
  235. view {
  236. background: #ffffff;
  237. width: 180rpx;
  238. height: 180rpx;
  239. padding: 10rpx;
  240. }
  241. }
  242. .examact-phone {
  243. position: absolute;
  244. bottom: 46rpx;
  245. left: 33rpx;
  246. color: #222222;
  247. font-size: 30rpx;
  248. line-height: 40rpx;
  249. }
  250. }
  251. </style>