buy.blade.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. @include('home.soft.common.head')
  5. <link rel="stylesheet" href="/static/css/member.css">
  6. <style>
  7. .vip-list .vip-item{
  8. width: 200px;
  9. }
  10. .vip-banner{
  11. margin-bottom: 15px;
  12. }
  13. .vip-model{
  14. margin-top: 0;
  15. padding-top: 10px;
  16. }
  17. .il-interest{
  18. font-weight: 500;
  19. line-height: 3.8;
  20. }
  21. .pay-cont .pay-img {
  22. width: 120px;
  23. height: 120px;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div class="vip-top">
  29. <img src="{{ $userInfo->avatar ?: "/static/logo.png"}}" class="vt-logo" />
  30. <div class="font-12">
  31. <p class="vt-name">{{ $userInfo->username }}</p>
  32. <span>会员有效期:</span>
  33. @if($billInfo['validity_type'] == 2)
  34. <span>永久有效</span>
  35. @elseif($billInfo['validity_type'] == 1)
  36. <span>{{ $billInfo['validity_end_time'] }}</span>
  37. @else
  38. <span>非VIP会员</span>
  39. @endif
  40. </div>
  41. <div class="v-title">VIP套餐</div>
  42. </div>
  43. <div class="v-right">
  44. @if(isset($ad) && $ad->logo)
  45. <div class="vip-banner">
  46. <img src="{{$ad->logo}}" style="width: 100%; height: 100%;border-radius:30px;"/>
  47. </div>
  48. @endif
  49. <div class="vip-list">
  50. @if($productInfo && $productInfo->price4)
  51. <div id="vip_item4" class="vip-item active" onclick="selectTerm(4,{{ $productInfo->price4 }})">
  52. <img src="/static/logo/i-costs.png" class="i-cost" />
  53. <div class="vip-name">永久VIP</div>
  54. <div>
  55. <p class="vip-price">
  56. ¥<span class="price-value" id="permanentPrice">{{ floatval($productInfo->price4)}}</span>
  57. @if($productInfo->market_price4 > 0)
  58. <span class="vip-market-price">¥{{ floatval($productInfo->market_price4) }}</span>
  59. @endif
  60. </p>
  61. <p class="vip-desc vip-red">
  62. {{ $productInfo->desc_price4 ?: "限时热销中" }}
  63. </p>
  64. </div>
  65. </div>
  66. @endif
  67. <!-- @if($productInfo->price1)
  68. <div id="vip_item1" class="vip-item" onclick="selectTerm(1,{{ $productInfo->price1 }})">
  69. <div class="vip-name">三个月VIP</div>
  70. <div>
  71. <p class="vip-price">
  72. ¥<span class="price-value">{{ floatval($productInfo->price1) }}</span>
  73. @if($productInfo->market_price1 > 0)
  74. <span class="vip-market-price">¥{{ floatval($productInfo->market_price1) }}</span>
  75. @endif
  76. </p>
  77. <p class="vip-desc vip-red">
  78. {{ $productInfo->desc_price1 ?: "有效期三个月" }}
  79. </p>
  80. </div>
  81. </div>
  82. @endif -->
  83. @if($productInfo->price2)
  84. <div id="vip_item2" class="vip-item" onclick="selectTerm(2,{{ $productInfo->price2 }})">
  85. <div class="vip-name">半年VIP</div>
  86. <div>
  87. <p class="vip-price">
  88. ¥<span class="price-value">{{ floatval($productInfo->price2) }}</span>
  89. @if($productInfo->market_price2 > 0)
  90. <span class="vip-market-price">¥{{ floatval($productInfo->market_price2) }}</span>
  91. @endif
  92. </p>
  93. <p class="vip-desc">
  94. {{ $productInfo->desc_price2 ?: "有效期半年" }}
  95. </p>
  96. </div>
  97. </div>
  98. @endif
  99. @if($productInfo->price3)
  100. <div id="vip_item3" class="vip-item" onclick="selectTerm(3,{{ $productInfo->price3 }})">
  101. <div class="vip-name">一年VIP</div>
  102. <div>
  103. <p class="vip-price">
  104. ¥<span class="price-value">{{ floatval($productInfo->price3) }}</span>
  105. @if($productInfo->market_price3 > 0)
  106. <span class="vip-market-price">¥{{ floatval($productInfo->market_price3) }}</span>
  107. @endif
  108. </p>
  109. <p class="vip-desc">
  110. {{ $productInfo->desc_price3 ?: "有效期一年" }}
  111. </p>
  112. </div>
  113. </div>
  114. @endif
  115. <!-- @if($productInfo->price5)
  116. <div id="vip_item5" class="vip-item" onclick="selectTerm(5,{{ $productInfo->price5 }})">
  117. <div class="vip-name">7天会员</div>
  118. <div>
  119. <p class="vip-price">
  120. ¥<span class="price-value">{{ $productInfo->price5 }}</span>
  121. </p>
  122. <p class="vip-desc">
  123. {{ $productInfo->desc_price5 ?: "限时特价" }}
  124. </p>
  125. </div>
  126. </div>
  127. @endif -->
  128. </div>
  129. </div>
  130. <p class="vip-tips">温馨提示:会员到期后将直接转为非VIP会员</p>
  131. <div class="vip-model">
  132. <div class="v-right" style="padding: 0 30px;">
  133. <p class="pay-line" style="font-size: 16px;font-weight: 600;">
  134. 支付金额:<span style="color: #ed4014;">¥</span><span id="payMoney" class="money-color">88</span>
  135. </p>
  136. <div id="dis-agreement1" class="pay-cont">
  137. <div class="spinner-border m-5" role="status" id="spinnerShow">
  138. <span class="visually-hidden">Loading...</span>
  139. </div>
  140. <div id="qrcode" class="pay-img" style="display: none"></div>
  141. <div class="pay-desc">
  142. <p class="pay-line">
  143. 支付渠道:
  144. <img src="/static/logo/p-weixin.png" class="pay-icon"/>
  145. <img src="/static/logo/p-alipay.png" class="pay-icon"/>
  146. </p>
  147. <p class="pay-line" style="margin-top: 8px;">
  148. 支付方式:扫码支付
  149. </p>
  150. <p class="pay-tips" style="margin-top: 8px;">不支持无理由退款</p>
  151. </div>
  152. </div>
  153. <div id="dis-agreement2" class="dis-agreement">请同意服务协议后方可购买产品</div>
  154. <div class="pay-agreement">
  155. <label>
  156. <input type="checkbox" checked="" id="payCheck" onclick="checkPayBox(this)">
  157. </label>
  158. <span>同意并接受</span>
  159. <span class="agreement-txt" onclick="agreementModel(true)">《软件会员增值服务协议》</span>
  160. </div>
  161. </div>
  162. <div class="v-left">
  163. <div class="il-vip">
  164. <img src="/static/logo/i-vip.png">
  165. <span class="v-name">会员尊享</span>
  166. </div>
  167. <div class="il-interest">
  168. <div class="il-item">
  169. <img src="/static/logo/a-equity1.png">
  170. <span>不限文件大小</span>
  171. </div>
  172. <div class="il-item">
  173. <img src="/static/logo/a-equity2.png">
  174. <span>不限电脑设备</span>
  175. </div>
  176. <div class="il-item">
  177. <img src="/static/logo/a-equity3.png">
  178. <span>一键批量转换</span>
  179. </div>
  180. <div class="il-item">
  181. <img src="/static/logo/a-equity4.png">
  182. <span>本地安全处理</span>
  183. </div>
  184. <div class="il-item">
  185. <img src="/static/logo/a-equity5.png">
  186. <span>软件免费升级</span>
  187. </div>
  188. <div class="il-item">
  189. <img src="/static/logo/a-equity6.png">
  190. <span>专业技术支持</span>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <div class="member-model" id="member-model">
  196. <div class="agreement-content">
  197. <p>尊敬的用户您好:</p>
  198. <p>欢迎使用星优办公软件会员增值服务协议,为使用星优办公软件会员增值服务(简称为:本服务),您应当阅读《星优办公软件会员增值服务协议》(简称为:本协议)。请您务必审慎阅读、充分理解各条款内容,特别是免除或限制责任的相应条款。</p>
  199. <p>除非您已阅读并接受本协议所有条款,否则您无权使用本服务。您对本服务的任何购买使用行为即视为您已阅读并同意本协议的约束。如果您未满18周岁,请在法定监护人的陪同下阅读本协议。</p>
  200. <p>本协议是用户与苏州星优办公软件有限公司(简称为:星优办公)之间关于用户加入成为星优办公软件会员且使用星优办公相关软件以及服务所订立的协议。本协议描述星优办公与会员之间关于软件许可以及服务使用及相关方面的权利义务。星优办公软件服务涉及到的星优办公产品的所有权以及相关软件的知识产权归星优办公所有。</p>
  201. <p class="font-600">一、关于本服务</p>
  202. <p>1.会员增值服务费,指用户按照星优办公指定方式支付一定费用后,用户可以享有由星优办公软件提供的应用软件。星优办公可能会根据本服务的整体规划,对本服务的收费标准、增值服务内容进行修改和变更。</p>
  203. <p>2.本服务可通过会员账号在任意一台电脑上使用软件,但一个账号同一时间只能在一台电脑上使用。</p>
  204. <p class="font-600">二、用户禁止行为</p>
  205. <p>1.用户使用本服务的权利是个人的,不允许对账户进行出租、出售等,或其他利用账户进行牟利的行为,若有相关滥用行为,我方有权单方面暂停、禁止账户相关功能。</p>
  206. <p class="font-600">三、退款声明</p>
  207. <p>为了避免购买本产品后引起纠纷,用户可在购买本服务前,对产品进行下载试用,看软件具体的使用效果,软件已提供免费试用,购买本服务则同意了星优办公会员增值服务协议/已试用软件/认可软件,故本公司不接受用户退款申请。</p>
  208. <p class="font-600">四、争议解决</p>
  209. <p>若您和星优办公之间发生任何纠纷或争议,首先应友好协商解决;协商不成的,您同意将纠纷或争议提交星优办公所在地法院管辖。</p>
  210. <p>本协议的一切解释权与修改权归星优办公。</p>
  211. </div>
  212. <div class="member-btn">
  213. <Button style="margin:0 10px;" onclick="agreementModel(false);">返回购买</Button>
  214. </div>
  215. </div>
  216. <script type="text/javascript" src="/static/js/qrcode.js"></script>
  217. <script>
  218. let buyContext;
  219. let target = '{{ $target }}';
  220. let agentMid = '{{$agentMid}}';
  221. let token = '{{$token}}';
  222. let pay_type = "wechat";
  223. let sku_type = 4;
  224. let pmid = "{{ $productInfo->mid }}";
  225. let permanentPrice = "{{floatval($productInfo->price4)}}";
  226. // 设置允许跨域
  227. axios.defaults.withCredentials = false;
  228. // 默认金额
  229. document.getElementById("payMoney").innerText = "{{ floatval($productInfo->price4) }}"
  230. function selectTerm(type, price) {
  231. sku_type = type;
  232. document.getElementById("payMoney").innerText = price
  233. // 其他的去除
  234. // let vipItem1 = document.getElementById("vip_item1").getAttribute("class").replace("active", " ");
  235. // document.getElementById("vip_item1").setAttribute("class", vipItem1);
  236. let vipItem2 = document.getElementById("vip_item2").getAttribute("class").replace("active", " ");
  237. document.getElementById("vip_item2").setAttribute("class", vipItem2);
  238. let vipItem3 = document.getElementById("vip_item3").getAttribute("class").replace("active", " ");
  239. document.getElementById("vip_item3").setAttribute("class", vipItem3);
  240. let vipItem4 = document.getElementById("vip_item4").getAttribute("class").replace("active", " ");
  241. document.getElementById("vip_item4").setAttribute("class", vipItem4);
  242. let classVal = document.getElementById("vip_item" + type).getAttribute("class");
  243. document.getElementById("vip_item" + type).setAttribute("class", classVal.concat(" active"))
  244. //创建支付二维码
  245. createPayCode();
  246. }
  247. // 创建支付二维码
  248. createPayCode();
  249. // 账户登录信息
  250. // getUserInfo();
  251. function createPayCode() {
  252. document.getElementById('spinnerShow').style.display = ""
  253. document.getElementById("qrcode").innerHTML = ""
  254. document.getElementById('qrcode').style.display = "none"
  255. let data = {
  256. agent_mid: agentMid,
  257. type: sku_type,
  258. pay_type: pay_type
  259. }
  260. axios.post(target + '/api/pay/getPayCode/' + pmid, data, {headers: {Authorization: token}}).then(function (response) {
  261. if (!response.data.error) {
  262. let code = response.data.result;
  263. createQrcode(code);
  264. }
  265. }).catch(function (error) {
  266. console.log(error);
  267. });
  268. }
  269. // 设置支付类型
  270. function selectPaytype(type) {
  271. pay_type = type
  272. if (type === 'wechat') {
  273. let str = document.getElementById("payAlipay").getAttribute("class").replace("active", " ")
  274. document.getElementById("payAlipay").setAttribute("class", str);
  275. let classVal = document.getElementById("payWechat").getAttribute("class");
  276. document.getElementById("payWechat").setAttribute("class", classVal.concat(" active"))
  277. } else {
  278. let str = document.getElementById("payWechat").getAttribute("class").replace("active", " ");
  279. document.getElementById("payWechat").setAttribute("class", str);
  280. let classVal = document.getElementById("payAlipay").getAttribute("class");
  281. document.getElementById("payAlipay").setAttribute("class", classVal.concat(" active"))
  282. }
  283. //创建支付二维码
  284. createPayCode();
  285. }
  286. // 创建二维码
  287. function createQrcode(code) {
  288. var qrcode = new QRCode("qrcode", {
  289. text: "https://www.xingyousoft.com/soft/pay/" + code,
  290. width: 120,
  291. height: 120
  292. });
  293. document.getElementById('qrcode').style.display = ""
  294. document.getElementById('spinnerShow').style.display = "none"
  295. // 开始检测支付扫描
  296. startScan(code);
  297. }
  298. let payScanInterval;
  299. let payEndInterval;
  300. function startScan(code) {
  301. if (payScanInterval) {
  302. clearInterval(payScanInterval);
  303. }
  304. if (payEndInterval) {
  305. clearInterval(payEndInterval);
  306. }
  307. payScanInterval = setInterval(() => {
  308. axios.post(target + '/api/pay/checkPayScan/' + code, {}, {headers: {Authorization: token}}).then((response) => {
  309. if (!response.data.error) {
  310. // 提示消息,扫描成功
  311. // 开始检测支付
  312. clearInterval(payScanInterval);
  313. startCheckPayEnd(code);
  314. }
  315. }).catch(function (error) {
  316. console.log(error);
  317. });
  318. }, 1000);
  319. }
  320. // 开始检测支付
  321. function startCheckPayEnd(code) {
  322. if (payEndInterval) {
  323. clearInterval(payEndInterval);
  324. }
  325. payEndInterval = setInterval(() => {
  326. axios.post(target + '/api/pay/checkPayEnd/' + code, {product_type: 1}, {headers: {Authorization: token}}).then((response) => {
  327. if (!response.data.code === 0 || !response.data.error) {
  328. // 关闭定时器
  329. clearInterval(payEndInterval);
  330. // 支付完成
  331. window.top.postMessage('paySuccess', '*');
  332. }
  333. }).catch(function (error) {
  334. console.log(error);
  335. });
  336. }, 1000);
  337. }
  338. // 获取用户信息
  339. function getUserInfo() {
  340. axios.post(target + '/api/login/getUserInfo', {}, {headers: {Authorization: token}}).then(function (response) {
  341. if (!response.data.error) {
  342. let userInfo = response.data.result;
  343. }
  344. }).catch(function (error) {
  345. });
  346. }
  347. function checkPayBox(e){
  348. document.getElementById('dis-agreement1').style.display = "none";
  349. document.getElementById('dis-agreement2').style.display = "none";
  350. if(!e.checked){
  351. document.getElementById('dis-agreement2').style.display = "block"
  352. }else{
  353. document.getElementById('dis-agreement1').style.display = "flex";
  354. }
  355. }
  356. function agreementModel(e){
  357. if(e){
  358. document.getElementById('member-model').style.display = "block";
  359. }else{
  360. document.getElementById('member-model').style.display = "none";
  361. }
  362. }
  363. function formatTime(str){
  364. let date = new Date(str*1000);
  365. const year = date.getFullYear();
  366. const month = date.getMonth() + 1;
  367. const day = date.getDate();
  368. const hour = date.getHours();
  369. const minute = date.getMinutes();
  370. const second = date.getSeconds();
  371. return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':');
  372. }
  373. function formatNumber(n) {
  374. n = n.toString();
  375. return n[1] ? n : '0' + n;
  376. }
  377. </script>
  378. </body>
  379. </html>