examact.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="examact">
  3. <view class="examact-tname">{{ tenantInfo.name }}</view>
  4. <img
  5. :src="$method.splitImgHost('oss/images/file/20230318/1679109165004.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. };
  92. import { actCheck } from "../../common/httpList/act";
  93. import tkiQrcode from "tki-qrcode";
  94. export default {
  95. name: "SaasMiniprogramExamact",
  96. data() {
  97. return {
  98. goodsId: "",
  99. goodsType: "2",
  100. example:
  101. "http://localhost:8080/pages5/scan/examact?jump=www.hnjsxt.cn/detail/6",
  102. jump: undefined,
  103. tenantInfo: {},
  104. };
  105. },
  106. onLoad(option) {
  107. this.jump = option.jump;
  108. this.tenantInfo = this.backInfo();
  109. this.goodsId = this.tenantInfo.goodsId;
  110. },
  111. methods: {
  112. collectMerch() {
  113. actCheck().then((res) => {
  114. if (res.data.code === 200) {
  115. //跳转去对应域名
  116. this.toDatail();
  117. } else {
  118. this.$u.toast(res.data.msg);
  119. }
  120. });
  121. },
  122. toDatail() {
  123. if (this.jump) {
  124. window.location.href = this.scheme + this.jump;
  125. return;
  126. }
  127. uni.navigateTo({
  128. url:
  129. "/pages3/course/detail?id=" +
  130. this.goodsId +
  131. "&goodsType=" +
  132. this.goodsType +
  133. "&isAct=" +
  134. 1,
  135. });
  136. },
  137. backInfo() {
  138. let domain = this.jump ? this.jump.split("/")[0] : window.location.host;
  139. domain = this.$method.checkDomain(domain)
  140. ? domain
  141. : "120.79.166.78:19006";
  142. return map[domain];
  143. },
  144. },
  145. components: {
  146. tkiQrcode,
  147. },
  148. computed: {
  149. scheme() {
  150. return this.tenantInfo.scheme || "https://";
  151. },
  152. val() {
  153. return (
  154. this.scheme +
  155. (this.jump ||
  156. window.location.host + "/pages/questionBank/index?isAct=1")
  157. );
  158. },
  159. },
  160. };
  161. </script>
  162. <style lang="scss" scoped>
  163. .examact {
  164. position: relative;
  165. img {
  166. width: 100vw;
  167. }
  168. .examact-tname {
  169. position: absolute;
  170. top: 41rpx;
  171. left: 48rpx;
  172. font-size: 36rpx;
  173. color: #2e3174;
  174. font-weight: 500;
  175. }
  176. .examact-btn {
  177. width: 620rpx;
  178. height: 102rpx;
  179. position: absolute;
  180. top: 786rpx;
  181. left: 50%;
  182. margin-left: -310rpx;
  183. background: linear-gradient(90deg, #1762ff 0%, #4af7da 100%);
  184. box-shadow: 0px 9px 12px 0px rgba(50, 84, 130, 0.18);
  185. border-radius: 200rpx;
  186. line-height: 104rpx;
  187. text-align: center;
  188. font-weight: bold;
  189. color: #ffffff;
  190. font-size: 36rpx;
  191. }
  192. .examact-qrcode {
  193. width: 396rpx;
  194. display: flex;
  195. position: absolute;
  196. justify-content: space-between;
  197. right: 32rpx;
  198. bottom: 122rpx;
  199. img {
  200. width: 180rpx;
  201. height: 180rpx;
  202. }
  203. view {
  204. background: #ffffff;
  205. width: 180rpx;
  206. height: 180rpx;
  207. padding: 10rpx;
  208. }
  209. }
  210. .examact-phone {
  211. position: absolute;
  212. bottom: 46rpx;
  213. left: 33rpx;
  214. color: #222222;
  215. font-size: 30rpx;
  216. line-height: 40rpx;
  217. }
  218. }
  219. </style>