access.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. {extend name="app/shop/view/base.html"/}
  2. {block name="resources"}
  3. <style type="text/css">
  4. .access{padding: 10px;}
  5. .access-title {font-size: 18px;font-family: Microsoft YaHei;font-weight: 400;color: #333333;}
  6. .access-item{background-color: #F8F8F8;display: flex;flex-direction: column;justify-content: space-between;}
  7. .item {display: flex;justify-content: space-between;margin: 20px 0 20px 10px;}
  8. .item-datail {position: relative;}
  9. .item-number {width: 30px;height: 30px;border-radius: 50%;border: 5px solid #eee;position: absolute;top: -5px;left: -45px;box-sizing: border-box;font-size: 10px;line-height: 20px;}
  10. .item-number label{width: 20px;height: 20px;background: #ddd;border-radius: 50%; text-align: center;color: #FFFFFF !important;display: inline-block;font-size: 12px;}
  11. .item-number.active {border: 5px solid rgba(255, 106, 0, 0.5);}
  12. .item-number.active label {background: #FF6A00;}
  13. .item-check{position: absolute;top: 5px; left: 20px;width: 25px;height: 25px;background: #CCCCCC;border-radius: 50%;display: flex;align-items: center;justify-content: center;}
  14. .item-check i{border-radius: 50%;border: none;font-size: 14px;color: #fff}
  15. .item-checked{background: rgba(255,106,0,0.5);border-radius: 50%;}
  16. .item-checked i {color: #ff6a00}
  17. .item-datail div {font-size: 14px;font-family: Microsoft YaHei;font-weight: 400;color: #333333;margin-bottom: 10px;}
  18. .item-datail p {display: inline-block; font-size: 12px;font-family: Microsoft YaHei;font-weight: 400;color: #999999;}
  19. .item-datail a {font-size: 12px;font-family: Microsoft YaHei;font-weight: 400;color: #FF6A00!important;}
  20. .item button {width: 88px;height: 34px;background: #FF6A00;border-radius: 2px;border: 1px solid #FFFFFF;font-weight: 400;color: #FFFFFF;cursor: pointer;}
  21. .item span,.item a,.item button {margin-right: 40px;margin-top: 10px;}
  22. .layui-timeline-item:before{top: 27px;}
  23. .order-pay-layer .wrap{display: flex;}
  24. .order-pay-layer .wrap .flex{flex: 1}
  25. .order-pay-layer .wrap .flex:last-child{border-left: 1px solid #eee}
  26. .order-pay-layer .qrcode img{width: 150px;margin: auto;display: block;}
  27. .order-pay-layer .goods-name {margin-right: 15px;font-weight: bold;}
  28. .order-pay-layer .price {margin-right: 15px;margin-top: 15px;font-weight: bold;}
  29. .order-pay-layer .tips {margin-bottom: 15px;}
  30. a:hover{text-decoration: none!important;cursor: pointer}
  31. </style>
  32. {/block}
  33. {block name="main"}
  34. <div class="access">
  35. <div class="access-title">微信视频号</div>
  36. <ul class="layui-timeline">
  37. <li class="layui-timeline-item">
  38. <div class="layui-timeline-content layui-text">
  39. <div class="item">
  40. <div class="item-datail">
  41. <div class="item-number active">
  42. <label>1</label>
  43. </div>
  44. <div>创建微信视频号</div>
  45. <p>在微信中创建视频号,如已有视频号可越过该步骤。</p>
  46. </div>
  47. <a href="https://www.kancloud.cn/niucloud/niushop_b2c_v4/2251549" target="_blank" class="layui-btn">接入指南</a>
  48. </div>
  49. </div>
  50. </li>
  51. <li class="layui-timeline-item">
  52. <div class="layui-timeline-content layui-text">
  53. <div class="item">
  54. <div class="item-datail">
  55. <div class="item-number {if $checkres['code'] == 0 && $checkres['data']['status'] == 2}active{/if}">
  56. <label>2</label>
  57. </div>
  58. <div>申请开通自定义版交易组件</div>
  59. <p>完成自定义版交易组件接入后,小程序即可在视频号中实现商品展示和带货等功能,进一步提升经营能力。若您已开通标准化交易组件,则暂不支持切换</p>
  60. </div>
  61. {if $checkres['code'] == 0}
  62. {if $checkres['data']['status'] != 2 && $checkres['data']['status'] != 3}
  63. <button type="button" onclick="apply()">立即开通</button>
  64. {/if}
  65. {else/}
  66. <button type="button" onclick="apply()">立即开通</button>
  67. {/if}
  68. </div>
  69. <div class="access-item">
  70. <div class="item">
  71. <div class="item-datail">
  72. <div class="item-check {if $checkres['code'] == 0 && $checkres['data']['status'] == 2}item-checked{/if}">
  73. <i class="iconfont iconduihao"></i>
  74. </div>
  75. <div style="margin-left: 60px;">
  76. <label>完成自定义版交易组件开通申请</label>
  77. <br>
  78. <p>官方审核团队将对接入资质进行审核,通过后可进行下一步操作。</p>
  79. </div>
  80. </div>
  81. {if $checkres['code'] == 0}
  82. {if $checkres['data']['status'] == 2}
  83. <span>已开通</span>
  84. {elseif $checkres['data']['status'] == 3}
  85. <span>封禁中</span>
  86. {else/}
  87. <span>未开通</span>
  88. {/if}
  89. {else/}
  90. <span>未开通</span>
  91. {/if}
  92. </div>
  93. </div>
  94. </div>
  95. </li>
  96. <li class="layui-timeline-item">
  97. <div class="layui-timeline-content layui-text">
  98. <div class="item">
  99. <div class="item-datail">
  100. <div class="item-number {if $checkres['code'] == 0 && $checkres['data']['status'] == 2}active{/if}">
  101. <label>3</label>
  102. </div>
  103. <div>自定义版交易组件申请通过,接口调用场景检测</div>
  104. <p>自定义交易组件开通之后,如果当前小程序版本低于4.1.5,则需下载4.1.5或更高版本小程序进行发布,<a href="{:addon_url('weapp://shop/weapp/package')}" target="_blank">前去发布</a></p>
  105. </div>
  106. </div>
  107. <div class="access-item">
  108. <div class="item">
  109. <div class="item-datail">
  110. <div class="item-check {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['spu_audit_finished'] eq 1}item-checked{/if}">
  111. <i class="iconfont iconduihao"></i>
  112. </div>
  113. <div style="margin-left: 60px;">
  114. <label>商品接口调用</label>
  115. <br>
  116. <p>请至少将一件商品同步到微信,并等待商品审核通过<a href="{:addon_url('shopcomponent://shop/goods/lists')}">前去添加</a></p>
  117. </div>
  118. </div>
  119. {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['spu_audit_finished'] eq 1}
  120. <span>已完成</span>
  121. {else/}
  122. <button type="button" onclick="finishAccess(6)">完成</button>
  123. {/if}
  124. </div>
  125. <div class="item" style="margin-top: 0;">
  126. <div class="item-datail">
  127. <div class="item-check {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['ec_order_finished'] eq 1}item-checked{/if}">
  128. <i class="iconfont iconduihao"></i>
  129. </div>
  130. <div style="margin-left: 60px;">
  131. <label>订单接口调用</label>
  132. <br>
  133. <p>需手动扫码下单,使用微信支付并付款成功</p>
  134. </div>
  135. </div>
  136. {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['ec_order_finished'] eq 1}
  137. <span>已完成</span>
  138. {else/}
  139. {if $checkres['code'] == 0 && $checkres['data']['access_info']['pay_order_success'] eq 1}
  140. <button type="button" onclick="finishAccess(7)">完成</button>
  141. {else/}
  142. <button type="button" onclick="orderPay()">扫码下单</button>
  143. {/if}
  144. {/if}
  145. </div>
  146. <div class="item" style="margin-top: 0;">
  147. <div class="item-datail">
  148. <div class="item-check {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['send_delivery_finished'] eq 1}item-checked{/if}">
  149. <i class="iconfont iconduihao"></i>
  150. </div>
  151. <div style="margin-left: 60px;">
  152. <label>物流接口调用</label>
  153. <br>
  154. <p>订单支付之后,需对该测试订单进行发货操作</p>
  155. </div>
  156. </div>
  157. {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['send_delivery_finished'] eq 1}
  158. <span>已完成</span>
  159. {else/}
  160. <button type="button" onclick="finishAccess(8)">完成</button>
  161. {/if}
  162. </div>
  163. <div class="item" style="margin-top: 0;">
  164. <div class="item-datail">
  165. <div class="item-check {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['ec_after_sale_finished'] eq 1}item-checked{/if}">
  166. <i class="iconfont iconduihao"></i>
  167. </div>
  168. <div style="margin-left: 60px;">
  169. <label>售后接口调用</label>
  170. <br>
  171. <p>订单发货之后,需下单人对该测试订单进行申请维权操作</p>
  172. </div>
  173. </div>
  174. {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['ec_after_sale_finished'] eq 1}
  175. <span>已完成</span>
  176. {else/}
  177. <button type="button" onclick="finishAccess(9)">完成</button>
  178. {/if}
  179. </div>
  180. </div>
  181. </div>
  182. </li>
  183. <li class="layui-timeline-item">
  184. <div class="layui-timeline-content layui-text">
  185. <div class="item">
  186. <div class="item-datail">
  187. <div class="item-number {if $checkres['code'] == 0 && $checkres['data']['status'] == 2 && $checkres['data']['access_info']['ec_after_sale_finished'] eq 1}active{/if}">
  188. <label>4</label>
  189. </div>
  190. <div>自定义版交易组件开通成功</div>
  191. <p>开通成功之后可在小程序中“功能>交易组件>场景接入>视频号推广”中关联视频号,关联之后视频号管理员可前往“视频号创作者中心>商品橱窗”中添加商品<a href="https://mp.weixin.qq.com" target="_blank">前去添加</a>。 </p>
  192. </div>
  193. </div>
  194. </div>
  195. </li>
  196. </ul>
  197. </div>
  198. {/block}
  199. {block name="script"}
  200. <script type="text/html" id="orderPay">
  201. <div class="order-pay-layer">
  202. <div class="tips text-color">注:需使用微信扫码下单使用微信支付,且支付成功。</div>
  203. <div class="wrap">
  204. <div class="flex">
  205. <div class="goods-name">{{ d.goods_name }}</div>
  206. <div class="price">¥{{ d.price }}</div>
  207. </div>
  208. <div class="flex">
  209. <div class="qrcode">
  210. <img src="{{ ns.img(d.qrcode_path) }}" alt="">
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. </script>
  216. <script type="text/javascript">
  217. var laytpl,repeatTag = false;
  218. layui.use(['laytpl'], function() {
  219. laytpl = layui.laytpl;
  220. });
  221. function apply(){
  222. $.ajax({
  223. url: ns.url("shopcomponent://shop/goods/access"),
  224. dataType: 'JSON',
  225. type: 'POST',
  226. success: function(res) {
  227. if (res.code == 0) {
  228. layer.msg('开通成功');
  229. setTimeout(function () {
  230. location.reload();
  231. }, 1000)
  232. } else {
  233. layer.msg(res.message);
  234. }
  235. }
  236. });
  237. }
  238. function orderPay() {
  239. $.ajax({
  240. url: ns.url("shopcomponent://shop/goods/getorderpayinfo"),
  241. dataType: 'JSON',
  242. type: 'POST',
  243. success: function(res) {
  244. if (res.code == 0) {
  245. laytpl($('#orderPay').html()).render(res.data, function(string){
  246. layer.open({
  247. type: 1,
  248. title: '订单测试',
  249. content: string,
  250. area: ['500px', '340px'],
  251. btn: ['支付成功', '取消'],
  252. yes: function () {
  253. location.reload();
  254. }
  255. })
  256. });
  257. } else {
  258. layer.msg(res.message);
  259. }
  260. }
  261. });
  262. }
  263. function finishAccess(item) {
  264. if (repeatTag) return;
  265. repeatTag = true;
  266. $.ajax({
  267. url: ns.url("shopcomponent://shop/goods/finishaccess"),
  268. dataType: 'JSON',
  269. type: 'POST',
  270. data: {item: item},
  271. success: function (res) {
  272. if (res.code == 0) {
  273. location.reload();
  274. } else {
  275. repeatTag = false;
  276. layer.msg(res.message);
  277. }
  278. }
  279. })
  280. }
  281. </script>
  282. {/block}