index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <style>
  2. .list-title {
  3. font-weight: 400;
  4. font-size: 18px;
  5. }
  6. .channel-list {
  7. margin: 0 0 0 -20px;
  8. }
  9. .channel-item {
  10. position: relative;
  11. border: 1px solid #ebebeb;
  12. background: #fff;
  13. padding: 20px;
  14. margin: 0 0 20px 20px;
  15. transition: 250ms;
  16. height: 150px;
  17. border-radius: 5px;
  18. }
  19. .channel-item .display-name {
  20. margin-bottom: 10px;
  21. transition: 250ms;
  22. font-weight: bold;
  23. font-size: 16px;
  24. }
  25. .channel-item .name {
  26. color: #909399;
  27. }
  28. .channel-item:hover {
  29. cursor: pointer;
  30. border-color: #bfddff;
  31. }
  32. /*.channel-item:hover .display-name {*/
  33. /* color: #409EFF;*/
  34. /* font-weight: bold;*/
  35. /*}*/
  36. .channel-item .channel-option-btn {
  37. height: 25px;
  38. width: 25px;
  39. font-size: 12px;
  40. padding: 0;
  41. }
  42. .channel-item .detail-option.detail-option {
  43. color: #909399;
  44. background: #F2F6FC;
  45. }
  46. .channel-item .detail-option:hover {
  47. color: #fff;
  48. background: #909399;
  49. }
  50. .channel-item .name {
  51. white-space: nowrap;
  52. overflow: hidden;
  53. text-overflow: ellipsis;
  54. font-size: 12px;
  55. }
  56. .channel-item .item-status {
  57. position: absolute;
  58. z-index: 10;
  59. top: 0;
  60. right: 0;
  61. width: 64px;
  62. height: 20px;
  63. background: #E8EAEC;
  64. opacity: 1;
  65. border-radius: 0px 5px 0px 5px;
  66. font-size: 11px;
  67. line-height: 20px;
  68. font-family: Microsoft YaHei;
  69. font-weight: 400;
  70. color: #9398A4;
  71. text-align: center;
  72. }
  73. .gray {
  74. -webkit-filter: grayscale(100%);
  75. -moz-filter: grayscale(100%);
  76. -ms-filter: grayscale(100%);
  77. -o-filter: grayscale(100%);
  78. filter: grayscale(100%);
  79. filter: gray;
  80. }
  81. .child-btn .el-button {
  82. height: 20px;
  83. line-height: 0px;
  84. width: auto;
  85. margin-top: 15px;
  86. }
  87. .juxing {
  88. width: 110px;
  89. height: 24px;
  90. background: url("/resources/img/mall/channel/juxing.png") no-repeat left top;
  91. background-size: cover;
  92. position: relative;
  93. left: -21px;
  94. top: -21px;
  95. text-align: center;
  96. line-height: 24px;
  97. color: #fff;
  98. }
  99. .list-title span {
  100. font-weight: bold;
  101. color: #0A54EA;
  102. display: inline-block;
  103. height: 15px;
  104. width: 5px;
  105. background-color: #0A54EA;
  106. }
  107. .question_icon {
  108. position: absolute;
  109. top: 6px;
  110. right: 6px;
  111. width: 20px;
  112. height: 20px;
  113. z-index: 10;
  114. }
  115. .question_icon i {
  116. font-size: 17px;
  117. color: #BFBFBF;
  118. }
  119. </style>
  120. <div id="app" v-cloak>
  121. <template>
  122. <div>
  123. <h3 class="list-title">
  124. <span></span> &nbsp;&nbsp;&nbsp;&nbsp;渠道管理
  125. </h3>
  126. <el-row class="channel-list" v-loading="loading">
  127. <!-- 微信小程序开始 -->
  128. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
  129. <div flex="dir:left box:first" class="channel-item">
  130. <div style="padding-right: 12px;">
  131. <img style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/xiaochengxu.png">
  132. </div>
  133. <div>
  134. <div class="display-name">微信小程序</div>
  135. <div flex="box:last">
  136. <div class="name">一键生成,连接微信触手可及</div>
  137. </div>
  138. <div class="child-btn">
  139. <!-- <el-button type="primary" round @click="developing" style="color: #6577B9; background-color: #6577B9; color: #FFFFFF;">配置微信小程序</el-button>-->
  140. <el-button type="primary" round @click="jump(form.mini.backend_url)" style="color: #6577B9; background-color: #6577B9; color: #FFFFFF;">配置微信小程序</el-button>
  141. <el-button round @click="developing" style="color: #6577B9; border-color: #6577B9;">发布审核</el-button>
  142. </div>
  143. </div>
  144. <div class="question_icon" @click.stop="courseurl(form.mini_app)">
  145. <el-tooltip class="" effect="dark" :content="prompt" placement="bottom">
  146. <i class="el-icon-question"></i>
  147. </el-tooltip>
  148. </div>
  149. </div>
  150. </el-col>
  151. <!-- 微信小程序结束 -->
  152. <!-- 公众号开始 -->
  153. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
  154. <div flex="dir:left box:first" class="channel-item">
  155. <div style="padding-right: 12px;">
  156. <img style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/wechat.png">
  157. </div>
  158. <div>
  159. <div class="display-name">微信公众号</div>
  160. <div flex="box:last">
  161. <div class="name">借助海量流量,玩转微信生态</div>
  162. </div>
  163. <div class="child-btn">
  164. <el-button type="primary" round @click="jump(form.wechat.backend_url)" style="color: #2BAD37; background-color: #2BAD37; color: #FFFFFF;">配置微信公众号</el-button>
  165. </div>
  166. </div>
  167. <div class="question_icon" @click.stop="courseurl(form.wx_url)">
  168. <el-tooltip class="" effect="dark" :content="prompt" placement="bottom">
  169. <i class="el-icon-question"></i>
  170. </el-tooltip>
  171. </div>
  172. </div>
  173. </el-col>
  174. <!-- 公众号结束 -->
  175. <!-- 网页H5开始 -->
  176. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
  177. <div flex="dir:left box:first" class="channel-item">
  178. <div style="padding-right: 12px;">
  179. <img style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/h5.png">
  180. </div>
  181. <div>
  182. <div class="display-name">手机浏览器H5</div>
  183. <div flex="box:last">
  184. <div class="name">WAP网页商城,广泛覆盖移动市场</div>
  185. </div>
  186. <div class="child-btn">
  187. <el-button type="primary" round @click="jumpOutside(form.h5.url)" style="color: #5BAEDA; background-color: #5BAEDA; color: #FFFFFF;">立即访问</el-button>
  188. <el-button round class="copy_btn" @click="copyLink(form.h5.url)" style="color: #5BAEDA; border-color: #5BAEDA;">复制链接</el-button>
  189. </div>
  190. </div>
  191. </div>
  192. </el-col>
  193. <!-- 网页H5结束 -->
  194. <!-- 手机APP开始 -->
  195. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
  196. <div flex="dir:left box:first" class="channel-item">
  197. <div style="padding-right: 12px;">
  198. <img style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/app.png">
  199. </div>
  200. <div>
  201. <div class="display-name">手机APP</div>
  202. <div flex="box:last">
  203. <div class="name">原生混合开发安卓IOSAPP,防止微信封号</div>
  204. </div>
  205. <div class="child-btn">
  206. <el-button type="primary" round @click="jump(form.app_url.backend_url)" style="color: #17489C; background-color: #17489C; color: #FFFFFF;">上传app安装包</el-button>
  207. <!-- <el-button round @click="showDialog" style="color: #17489C; border-color: #17489C;">复制链接</el-button> -->
  208. </div>
  209. </div>
  210. <!-- <div class="question_icon" @click.stop="courseurl(form.app_url)">
  211. <el-tooltip class="" effect="dark" :content="prompt" placement="bottom">
  212. <i class="el-icon-question"></i>
  213. </el-tooltip>
  214. </div> -->
  215. </div>
  216. </el-col>
  217. <!-- 手机APP结束 -->
  218. <!-- 支付宝小程序开始 -->
  219. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
  220. <div flex="dir:left box:first" class="channel-item">
  221. <div>
  222. <div>
  223. <img class="" style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/alipay.png">
  224. </div>
  225. </div>
  226. <div style="padding-left:16px;">
  227. <div class="display-name">支付宝小程序</div>
  228. <div flex="box:last">
  229. <div class="name">借助海量流量,玩转阿里生态</div>
  230. </div>
  231. <div class="child-btn">
  232. <el-button type="primary" round @click="jump(form.alipay_mini.backend_url)" style="color: #5BAEDA; background-color: #5BAEDA; color: #FFFFFF;">配置支付宝小程序</el-button>
  233. </div>
  234. </div>
  235. </div>
  236. </el-col>
  237. <!-- 支付宝结束 -->
  238. </el-row>
  239. </div>
  240. <div>
  241. <h3 class="list-title">
  242. <span></span> &nbsp;&nbsp;&nbsp;&nbsp;即将上线 敬请期待
  243. </h3>
  244. <el-row class="channel-list" v-loading="loading">
  245. <!-- 支付宝开始 -->
  246. <!-- <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">-->
  247. <!-- <div flex="dir:left box:first" class="channel-item">-->
  248. <!-- <div>-->
  249. <!-- <div class="juxing">即将上线</div>-->
  250. <!-- <img class="gray" style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/alipay.png">-->
  251. <!-- </div>-->
  252. <!---->
  253. <!-- <div>-->
  254. <!-- <div style="margin-top: 45px;color: #D1D1D1;font-size: 26px;" class="display-name">支付宝小程序</div>-->
  255. <!-- </div>-->
  256. <!-- </div>-->
  257. <!-- </el-col>-->
  258. <!-- 支付宝结束 -->
  259. <!-- 百度小程序开始 -->
  260. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
  261. <div flex="dir:left box:first" class="channel-item">
  262. <div>
  263. <div class="juxing">即将上线</div>
  264. <img class="gray" style="width: 80px;height: 80px;display: block;" src="/resources/img/mall/channel/baidu.png">
  265. </div>
  266. <div>
  267. <div style="margin-top: 45px;color: #D1D1D1;font-size: 26px;" class="display-name">百度小程序</div>
  268. </div>
  269. </div>
  270. </el-col>
  271. <!-- 百度小程序结束 -->
  272. </el-row>
  273. </div>
  274. </template>
  275. <!-- 手机APP配置弹窗 -->
  276. <el-dialog class="app-dialog" title="配置APP" :visible.sync="dialogVisible" width="40%" top="30vh" center :close-on-click-modal="false">
  277. <el-form class="app-form" v-model="form.app_url" label-width="130px">
  278. <el-form-item label="苹果APP下载链接" prop="ios_download_url">
  279. <el-input size="small" v-model="form.app.ios_download_url" placeholder="配置IOS APP" style="width: 75%;"></el-input>
  280. <el-button round class="copy_btn" @click="copyLink(form.app.ios_download_url)" style="height: 32px; line-height: 6px; margin-left: 10px">复制链接</el-button>
  281. </el-form-item>
  282. <el-form-item label="安卓APP下载链接" prop="android_download_url">
  283. <el-input size="small" v-model="form.app.android_download_url" placeholder="配置Android APP" style="width: 75%;"></el-input>
  284. <el-button round class="copy_btn" @click="copyLink(form.app.android_download_url)" style="height: 32px; line-height: 6px; margin-left: 10px">复制链接</el-button>
  285. </el-form-item>
  286. </el-form>
  287. <span slot="footer" class="dialog-footer">
  288. <el-button @click="cancelSelect">取 消</el-button>
  289. <el-button type="primary" @click="saveConfig">提 交</el-button>
  290. </span>
  291. </el-dialog>
  292. <!-- 手机APP配置弹窗 -->
  293. </div>
  294. <script>
  295. new Vue({
  296. el: '#app',
  297. data() {
  298. return {
  299. loading: false,
  300. prompt: '对接教程',
  301. form: {
  302. wechat: null,
  303. h5: null,
  304. wx_url: null,
  305. app_url: null,
  306. mini_app: null,
  307. app: {
  308. ios_download_url: null,
  309. android_download_url: null,
  310. },
  311. alipay_mini: {
  312. backend_url: ''
  313. },
  314. },
  315. dialogVisible: false,
  316. };
  317. },
  318. created() {
  319. this.loadData(1);
  320. },
  321. methods: {
  322. saveConfig() {
  323. this.dialogVisible = false;
  324. let para = Object.assign({}, this.form);
  325. console.log(para);
  326. request({
  327. params: {
  328. r: 'mall/channel/index',
  329. },
  330. method: 'post',
  331. data: para,
  332. }).then(e => {
  333. if (e.data.code === 0) {
  334. this.$message.success(e.data.msg);
  335. } else {
  336. this.$message.error(e.data.msg);
  337. this.dialogVisible = true;
  338. }
  339. }).catch(e => {
  340. this.listLoading = true;
  341. });
  342. },
  343. courseurl(url) {
  344. if (url) {
  345. window.open(url, '_blank')
  346. } else {
  347. this.$message.warning('未设置教程链接');
  348. }
  349. },
  350. cancelSelect() {
  351. this.dialogVisible = false;
  352. },
  353. showDialog() {
  354. this.dialogVisible = true;
  355. },
  356. jump(url, target = false) {
  357. navigateTo({
  358. r: url
  359. }, target);
  360. },
  361. jumpOutside(url, target = "_blank") {
  362. window.open(url, target);
  363. },
  364. copyLink(url) { //复制链接
  365. var clipboard = new ClipboardJS('.copy_btn', {
  366. text: function() {
  367. return url;
  368. }
  369. });
  370. clipboard.on('success', (e) => {
  371. this.$message.success('复制成功!');
  372. clipboard.destroy()
  373. });
  374. clipboard.on('error', (e) => {
  375. this.$message.error('复制失败!');
  376. this.clipboard.destroy()
  377. });
  378. },
  379. developing() {
  380. this.$alert('此功能正在开发中', '提示', {
  381. confirmButtonText: '确定'
  382. });
  383. },
  384. loadData(page) {
  385. this.loading = true;
  386. request({
  387. params: {
  388. r: 'mall/channel/index',
  389. },
  390. }).then(e => {
  391. this.loading = false;
  392. if (e.data.code === 0) {
  393. if (!isEmpty(e.data.data)) this.form = e.data.data;
  394. } else {
  395. this.$message.error(e.data.msg);
  396. }
  397. });
  398. }
  399. }
  400. });
  401. </script>