examact.vue 5.5 KB

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