examact.vue 5.7 KB

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