form.blade.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. @extends('layouts.base')
  2. @section('会员等级设置')
  3. @section('content')
  4. <link href="{{static_url('yunshop/css/total.css')}}" media="all" rel="stylesheet" type="text/css" />
  5. <style>
  6. .vue-title {
  7. display: flex;
  8. margin: 5px 0;
  9. line-height: 32px;
  10. /* font-size: 16px; */
  11. color: #333;
  12. font-weight: 600;
  13. }
  14. .vue-title-left {
  15. width: 4px;
  16. height: 18px;
  17. margin-top: 6px;
  18. background: #29ba9c;
  19. display: inline-block;
  20. margin-right: 10px;
  21. }
  22. .vue-title-content {
  23. font-size: 14px;
  24. font-family: "黑体";
  25. flex: 1;
  26. }
  27. .select-price {
  28. font-size: 13px;
  29. margin-top: 15px;
  30. }
  31. .el-form-item__label {
  32. font-size: 13px;
  33. font-family: "黑体";
  34. color: black;
  35. font-weight: 400;
  36. }
  37. /* 文本字体 */
  38. .el-form-item__content {
  39. font-size: 13px;
  40. color: #999;
  41. font-family: inherit;
  42. font-weight: 400;
  43. }
  44. /* 重点红色 */
  45. .sign-red {
  46. color: red;
  47. }
  48. /* 文本框 */
  49. .el-input {
  50. font-size: 13px;
  51. }
  52. /*上传图片 */
  53. .addImg-box {
  54. width: 700px;
  55. display: flex;
  56. flex-wrap: wrap;
  57. cursor: pointer;
  58. }
  59. /* 点击事件添加 */
  60. .addLevel {
  61. margin-left: 65px;
  62. }
  63. .el-icon-plus {
  64. font-size: 40px;
  65. margin-top: 45px;
  66. }
  67. .itemImg_box {}
  68. .addImg-list {
  69. height: 150px;
  70. width: 150px;
  71. margin-right: 20px;
  72. margin-bottom: 60px;
  73. position: relative;
  74. }
  75. /* 商品图片添加 */
  76. .add-price-img {
  77. height: 150px;
  78. width: 150px;
  79. text-align: center;
  80. line-height: 20px;
  81. cursor: pointer;
  82. position: relative;
  83. border: 1px solid #ccc;
  84. }
  85. .anew {
  86. width: 100%;
  87. color: whitesmoke;
  88. text-align: center;
  89. background: rgba(0, 0, 0, .5) !important;
  90. padding: 5px 0 5px 0;
  91. position: absolute;
  92. bottom: 0;
  93. }
  94. .cancel-box {
  95. width: 16px;
  96. height: 16px;
  97. user-select: none;
  98. background: black;
  99. position: absolute;
  100. top: -9px;
  101. right: -9px;
  102. border-radius: 50%;
  103. }
  104. .cancel {
  105. color: white;
  106. font-size: 18px;
  107. line-height: 19px;
  108. text-indent: 0px;
  109. position: relative;
  110. left: 2px;
  111. top: -10px;
  112. }
  113. .cell {
  114. /* text-align: center; */
  115. }
  116. [v-cloak] {
  117. display: none;
  118. }
  119. /* 文字溢出隐藏 */
  120. .middenTitle {
  121. width: 100%;
  122. font-size: 12px;
  123. white-space: normal;
  124. text-overflow: -o-ellipsis-lastline;
  125. overflow: hidden;
  126. text-overflow:
  127. ellipsis;
  128. display: -webkit-box;
  129. -webkit-line-clamp: 2;
  130. line-clamp: 2;
  131. -webkit-box-orient: vertical;
  132. line-height: 20px;
  133. text-indent: -6px;
  134. margin-top: 6px;
  135. }
  136. /* 表格居中 */
  137. .el-table tr .cell {
  138. text-align: center;
  139. }
  140. </style>
  141. <div class="all">
  142. <div id="app" v-cloak>
  143. <div class="total-head">
  144. <div class="vue-title">
  145. <div class="vue-title-left"></div>
  146. <div class="vue-title-content">会员等级设置</div>
  147. </div>
  148. <el-form>
  149. <el-form-item class="asterisk" label="等级权重" label-width="200px;" style="margin:10px 0 0 150px;">
  150. <el-input clearable v-model.trim="form.weight" style="width:600px;" v-focus></el-input>
  151. <div>等级权重,数字越大越高级</div>
  152. </el-form-item>
  153. <el-form-item class="asterisk" label="等级名称" label-width="200px;" style="margin:10px 0 0 150px;">
  154. <el-input clearable v-model.trim="form.name" style="width:600px;"></el-input>
  155. </el-form-item>
  156. <el-form-item label="升级条件" label-width="200px;" style="margin:10px 0 0 150px;">
  157. <div :class="[isUpLevel ? 'addLevel' : '' ]">
  158. <div v-show="isUpLevel">
  159. <!-- 上传商品 -->
  160. <div class="addImg-box">
  161. <div class="addImg-list" v-for="(itemImg,i) in image" :key="i" @click="uploadingGoods(0,i)">
  162. <div class="itemImg_box">
  163. <img style="width:150px;height:150px" :src="itemImg" alt="">
  164. <div class="middenTitle">【ID:[[ goodsIdList[i] ]]】[[ commodity_title[i] ]]</div>
  165. </div>
  166. <div class="cancel-box" @click.stop="cancel(i)"><i class="cancel">×</i></div>
  167. <div class="anew">点击重新上传</div>
  168. </div>
  169. <div @click.stop="uploadingGoods(1)" class="add-price-img">
  170. <i class="el-icon-plus"></i>
  171. <div class="select-price">选择商品</div>
  172. </div>
  173. </div>
  174. <el-dialog width="55%" center title="选择商品" :visible.sync="isUploadingGoos">
  175. <el-input clearable v-model.trim="seekInput" placeholder="搜索id和商品名称" style="width:80%;margin-right:25px"></el-input>
  176. <el-button @click="seekBtn" @keyup.enter="seekBtn" type="primary">搜索</el-button>
  177. <el-table ref="singleTable" v-loading="loading" height="250" style=" width: 100%;" :data="gridData">
  178. <el-table-column header-align="center" property="id" label="ID"></el-table-column>
  179. <el-table-column header-align="center" label="商品信息">
  180. <template slot-scope="scope">
  181. <img v-if="scope.row.thumb!==null && scope.row.thumb" style="width:30px;height:30px;margin-right:5px" :src="scope.row.thumb" alt=""><span>[[scope.row.title]]</span>
  182. </template>
  183. </el-table-column>table
  184. <el-table-column label="操作" align="center">
  185. <template slot-scope="scope">
  186. <el-button @click="addGoods(scope.row,scope.$index)">操作</el-button>
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. <div style="margin-top:50px">
  191. <el-pagination layout="prev, pager, next,jumper" background style="text-align:center" :page-size="pagesize" :current-page="currentPage" :total="total" @current-change="handleCurrentChange">
  192. </el-pagination>
  193. </div>
  194. </el-dialog>
  195. <div style="margin:10px 0 0 0">可指定多件商品,只需购买其中一件</div>
  196. </div>
  197. <el-input clearable v-if="level_type==1" v-model.trim.number="form.count" style="width:600px;">
  198. <div slot="prepend">订单数量满</div>
  199. <div slot="append">个</div>
  200. </el-input>
  201. <el-input clearable v-else-if="level_type==2" v-model.trim="form.day" style="width:600px;">
  202. <div slot="prepend">等级有效天数</div>
  203. <div slot="append">天</div>
  204. </el-input>
  205. <el-input clearable v-else-if="level_type==3" v-model.trim="form.performance" style="width:600px;">
  206. <div slot="prepend">团队业绩满(自购+一级+二级)</div>
  207. <div slot="append">元</div>
  208. </el-input>
  209. <el-input clearable v-else-if="level_type==4" v-model.trim="form.recharge" style="width:600px;">
  210. <div slot="prepend">一次性充满</div>
  211. <div slot="append">元</div>
  212. </el-input>
  213. <el-input clearable v-else v-model.trim="form.money" style="width:600px;">
  214. <div slot="prepend">订单金额满</div>
  215. <div slot="append">元</div>
  216. </el-input>
  217. <div style="cursor: pointer;">会员升级条件,不填写默认为不自动升级, 设置
  218. <a class="sign-red" href="{{ yzWebUrl('member.member-set.level') }}">【会员升级依据】</a>
  219. </div>
  220. </div>
  221. </el-form-item>
  222. <el-form-item v-if="level_discount_calculation == 0 || level_discount_calculation==null" label="折扣" label-width="200px;" style="margin:10px 0 0 150px;">
  223. <el-input clearable v-model.trim="form.discount" style="width:600px;margin: 0 0 0 25px;">
  224. <div slot="append">折</div>
  225. </el-input>
  226. <div style="margin: 0 0 0 65px;">请输入0~999之间的数字,计算方式以
  227. <a class="sign-red" href="{!! yzWebUrl('member.member-set.level') !!}">【会员--会员设置--会员等级优惠计算方式】</a>
  228. 设置为准
  229. </div>
  230. </el-form-item>
  231. <el-form-item v-else label="比例" label-width="200px;" style="margin:10px 0 0 150px;">
  232. <el-input clearable v-model.trim="form.discount" style="width:600px;margin: 0 0 0 25px;">
  233. <div slot="append">%</div>
  234. </el-input>
  235. <div style="margin: 0 0 0 65px;">请输入0~999之间的数字,计算方式以
  236. <a class="sign-red" href="{!! yzWebUrl('member.member-set.level') !!}">【会员--会员设置--会员等级优惠计算方式】</a>
  237. 设置为准
  238. </div>
  239. </el-form-item>
  240. <el-form-item label="运费减免" label-width="200px;" style="margin:10px 0 0 150px;">
  241. <el-input clearable v-model.trim="form.freight" style="width:600px;">
  242. <div slot="append">%</div>
  243. </el-input>
  244. <div>快递运费减免优惠%</div>
  245. </el-form-item>
  246. <el-form-item label="购买商品赠送消费积分比例" style="margin:10px 0 0 50px;" v-if="integral==1">
  247. <el-input clearable v-model.trim="form.give_integral" style="width:600px;">
  248. <div slot="append">%</div>
  249. </el-input>
  250. <div>例:购买2件,设置10%消费积分,赠送消费积分=商品实付金额 * 2 * 10%</div>
  251. </el-form-item>
  252. <el-form-item label="每天最高可获积分数量" style="margin:10px 0 0 75px;">
  253. <el-input clearable v-model.trim="form.give_point_today" style="width:600px;">
  254. </el-input>
  255. <div class="tip">填0或者不填即不限制,(商品赠送、订单赠送、后台充值、充值码充值、批量充值、转让-转入、返还、分销佣金转入)积分赠送类型不限制</div>
  256. </el-form-item>
  257. <el-form-item label="权益说明" label-width="200px;" style="margin:10px 0 0 150px;">
  258. <!-- 富文本 -->
  259. <tinymceee v-model.trim="form.instructions" style="width:70%" v-if="info"></tinymceee>
  260. <div style="margin-left:63px;">权益说明在前端会员等级权益页面显示%</div>
  261. </el-form-item>
  262. </el-form>
  263. </div>
  264. <div class="fixed total-floo">
  265. <div class="fixed_box">
  266. <el-form>
  267. <el-form-item>
  268. <el-button type="primary" @click="submit">提交</el-button>
  269. <el-button @click="returnList">返回列表</el-button>
  270. </el-form-item>
  271. </el-form>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
  277. @include('public.admin.tinymceee')
  278. @include('public.admin.uploadMultimediaImg')
  279. <script>
  280. var vm = new Vue({
  281. el: "#app",
  282. delimiters: ['[[', ']]'],
  283. data() {
  284. let integral = '{!! $integral !!}';
  285. return {
  286. isUpLevel: false,
  287. integral:integral,
  288. form: {
  289. weight: '',
  290. name: '',
  291. day: '',
  292. discount: 0,
  293. freight: 0,
  294. instructions: '',
  295. money: "",
  296. count: "",
  297. performance: "",
  298. recharge: "",
  299. give_integral:"",
  300. give_point_today:"",
  301. },
  302. //上传商品
  303. isUploadingGoos: false,
  304. //商品
  305. //当前图片状态
  306. image: [],
  307. commodity_title: [],
  308. //商品的id
  309. goodsIdList: [],
  310. showimg: true,
  311. //判断富文本
  312. info: false,
  313. //判断购买的优惠
  314. level_type: "2",
  315. //判断折扣
  316. level_discount_calculation: "",
  317. //接收的id
  318. id: "",
  319. //判断点击的东西
  320. isIndex: 1,
  321. //点击当前的图片index
  322. indexImg: 0,
  323. //判断是否有isCreated
  324. isCreated: false,
  325. //商品列表
  326. gridData: [],
  327. //页码数
  328. currentPage: 1,
  329. //一页显示数据
  330. pagesize: 1,
  331. //总页数
  332. total: 1,
  333. //当前响应的图标
  334. loading: true,
  335. isi: false,
  336. //搜索
  337. seekInput: "",
  338. //记录第几次请求
  339. isCount: 1,
  340. }
  341. },
  342. // 自定义组件
  343. directives: {
  344. // 注册一个局部的自定义指令 v-focus
  345. focus: {
  346. // 指令的定义
  347. inserted: function(el) {
  348. // 聚焦元素
  349. el.querySelector('input').focus()
  350. }
  351. }
  352. },
  353. watch: {
  354. "gridData": {
  355. handler() {
  356. // console.log(this.$refs);
  357. if (this.$refs.singleTable) {
  358. this.$nextTick(() => {
  359. this.$refs.singleTable.doLayout(); // 解决表格错位
  360. })
  361. }
  362. },
  363. deep: true
  364. }
  365. },
  366. created() {
  367. g = this
  368. //优化在不同设备固定定位挡住的现象设置父元素的内边距
  369. window.onload = function() {
  370. let all = document.querySelector(".all");
  371. let h = window.innerHeight * 0.03;
  372. all.style.paddingBottom = h + "px";
  373. }
  374. let i = window.location.href.indexOf('id=');
  375. if (i !== -1) {
  376. let id = Number(window.location.href.slice(i + 3))
  377. this.id = id;
  378. //添加和更新数据控制器
  379. this.isi = true;
  380. this.postUpdateLevel(id);
  381. } else {
  382. //控制富文本显示隐藏
  383. this.info = true;
  384. this.postAddLevel();
  385. }
  386. //全局监听searchBtnt enter事件
  387. document.onkeydown = (e) => {
  388. let key = window.event.keyCode;
  389. if (key == 13) {
  390. g.seekBtn(1);
  391. }
  392. }
  393. },
  394. methods: {
  395. //回退
  396. hisGo(i) {
  397. // console.log(i);
  398. history.go(i)
  399. },
  400. //添加会员等级
  401. postAddLevel() {
  402. this.$http.post("{!!yzWebFullUrl('member.member-level.store')!!}", {
  403. level: this.isCount > 1 ? {
  404. level: this.form.weight,
  405. level_name: this.form.name,
  406. order_money: this.form.money,
  407. order_count: this.form.count,
  408. goods_id: this.goodsIdList,
  409. discount: this.form.discount,
  410. freight_reduction: this.form.freight,
  411. validity: this.form.day,
  412. description: this.form.instructions,
  413. team_performance: this.form.performance,
  414. balance_recharge: this.form.recharge,
  415. give_integral:this.form.give_integral,
  416. give_point_today:this.form.give_point_today,
  417. } : ""
  418. }).then(res => {
  419. console.log(res);
  420. if (this.isCount > 1) {
  421. if (res.data.result == 1) {
  422. this.$message.success(res.data.msg)
  423. setTimeout(() => {
  424. window.history.back(-1);
  425. }, 500)
  426. } else {
  427. this.$message.error(res.data.msg)
  428. }
  429. } else {
  430. let {
  431. level_type,
  432. level_discount_calculation
  433. } = res.body.data.shopSet;
  434. this.level_type = level_type;
  435. //折扣
  436. this.level_discount_calculation = Number(level_discount_calculation);
  437. if (this.level_type == 2) {
  438. this.isUpLevel = true;
  439. this.showimg = true;
  440. }
  441. }
  442. })
  443. },
  444. //会员等级数据
  445. postUpdateLevel(id) {
  446. console.log(id, 56622621);
  447. this.$http.post("{!!yzWebFullUrl('member.member-level.update')!!}", {
  448. id: id,
  449. level: this.isCount > 1 ? {
  450. level: this.form.weight,
  451. level_name: this.form.name,
  452. order_money: this.form.money,
  453. order_count: this.form.count,
  454. goods_id: this.goodsIdList,
  455. discount: this.form.discount,
  456. freight_reduction: this.form.freight,
  457. validity: this.form.day,
  458. description: this.form.instructions,
  459. team_performance: this.form.performance,
  460. balance_recharge: this.form.recharge,
  461. give_integral:this.form.give_integral,
  462. give_point_today:this.form.give_point_today,
  463. } : ""
  464. }).then(res => {
  465. console.log(res);
  466. // console.log(545454);
  467. if (this.isCount == 1) {
  468. const {
  469. levelModel: model,
  470. shopSet: shopSet
  471. } = res.body.data;
  472. //等级权重
  473. let {
  474. goods
  475. } = model;
  476. this.form.weight = model.level;
  477. //等级名称
  478. this.form.name = model.level_name;
  479. //等级有效天数
  480. this.form.day = model.validity;
  481. //折扣
  482. if (model.discount == "") {
  483. this.form.discount = 0;
  484. } else {
  485. this.form.discount = model.discount;
  486. }
  487. //运费免检
  488. if (model.freight_reduction == "") {
  489. this.form.freight = 0;
  490. } else {
  491. this.form.freight = model.freight_reduction;
  492. }
  493. //权益说明
  494. this.form.give_integral = model.give_integral;
  495. this.form.give_point_today = model.give_point_today;
  496. this.form.instructions = model.description;
  497. this.info = true;
  498. // console.log(11111);
  499. //升级商品图片
  500. this.level_type = Number(shopSet.level_type);
  501. // console.log(this.level_type,4465465);
  502. if (this.level_type == 2) {
  503. this.isUpLevel = true;
  504. //控制显示状态
  505. if (goods.length !== 0) {
  506. // this.isUpLevel = true;
  507. this.showimg = true;
  508. for (item of goods) {
  509. this.image.push(item.thumb);
  510. this.goodsIdList.push(item.id);
  511. this.commodity_title.push(item.title);
  512. }
  513. }
  514. }
  515. //金额
  516. this.form.money = model.order_money;
  517. //订单
  518. this.form.count = model.order_count;
  519. //团队业绩自选
  520. this.form.performance = model.team_performance;
  521. //一次性充值
  522. this.form.recharge = model.balance_recharge;
  523. //折扣
  524. this.level_discount_calculation = Number(shopSet.level_discount_calculation);
  525. } else {
  526. if (res.data.result == 1) {
  527. this.$message.success(res.data.msg);
  528. setTimeout(() => {
  529. window.history.back(-1);
  530. }, 300)
  531. } else {
  532. this.$message.error(res.data.msg)
  533. }
  534. }
  535. })
  536. },
  537. //更新会员等级
  538. postSetUpdateLevel(id) {
  539. this.$http.post("{!!yzWebFullUrl('member.member-level.update-datas')!!}", {
  540. id: id,
  541. level: {
  542. level: this.form.weight,
  543. level_name: this.form.name,
  544. order_money: this.form.money,
  545. order_count: this.form.count,
  546. goods_id: this.goodsIdList,
  547. discount: this.form.discount,
  548. freight_reduction: this.form.freight,
  549. validity: this.form.day,
  550. description: this.form.instructions,
  551. team_performance: this.form.performance,
  552. balance_recharge: this.form.recharge,
  553. give_integral:this.form.give_integral,
  554. give_point_today:this.form.give_point_today,
  555. }
  556. }).then(res => {
  557. if (res.data.result == 1) {
  558. this.$message.success(res.data.msg)
  559. setTimeout(() => {
  560. window.history.back(-1);
  561. }, 500)
  562. } else {
  563. this.$message.error(res.data.msg)
  564. }
  565. })
  566. },
  567. //点击显示
  568. upLevel() {},
  569. uploadingGoods(i, index) {
  570. //当前点击的东西
  571. this.isIndex = i;
  572. if (index !== undefined) {
  573. //当前点击图片的下标
  574. this.indexImg = index;
  575. }
  576. //点击打开搜索框
  577. this.isUploadingGoos = true;
  578. //打开加载图标
  579. this.loading = true;
  580. setTimeout(() => {
  581. this.loading = false;
  582. }, 500)
  583. this.postSearch(1);
  584. },
  585. //请求商品信息
  586. postSearch(page) {
  587. this.$http.post("{!!yzWebFullUrl('member.member-level.search-goods')!!}", {
  588. page
  589. }).then(res => {
  590. console.log(res);
  591. this.loading = true;
  592. if (res.data.result == 1) {
  593. setTimeout(() => {
  594. this.loading = false;
  595. }, 500)
  596. let {
  597. data: data,
  598. total,
  599. current_page: page,
  600. per_page: size,
  601. } = res.body.data.goods;
  602. //商品列表
  603. this.gridData = data;
  604. // console.log(total, 222126464);
  605. //总数
  606. this.total = total;
  607. //一页显示的数据
  608. this.pagesize = size;
  609. //页码数
  610. this.currentPage = page;
  611. } else {
  612. this.$message.error(res.data.msg)
  613. }
  614. })
  615. },
  616. cancel(i) {
  617. //删除当前图片
  618. this.image.splice(i, 1);
  619. //删除图片文字
  620. this.commodity_title.splice(i, 1);
  621. //删除图片id
  622. this.goodsIdList.splice(i, 1);
  623. },
  624. //提交商品信息
  625. addGoods(val, i) {
  626. if (this.isIndex == 1) {
  627. //商品的图片
  628. this.image.push(val.thumb);
  629. //商品id
  630. this.goodsIdList.push(val.id)
  631. //商品名称
  632. this.commodity_title.push(val.title)
  633. } else {
  634. //替换当前图片
  635. //商品的图片
  636. this.image[this.indexImg] = val.thumb;
  637. //商品id
  638. this.goodsIdList[this.indexImg] = val.id;
  639. //商品名称
  640. this.commodity_title[this.indexImg] = val.title;
  641. //替换商品关闭搜索
  642. this.isUploadingGoos = false;
  643. }
  644. },
  645. //点击提交
  646. submit() {
  647. this.isCount++;
  648. //更新数据
  649. if (this.isi) {
  650. //更新会员等级
  651. console.log(this.id);
  652. this.postUpdateLevel(this.id)
  653. } else {
  654. //添加会员等级
  655. this.postAddLevel();
  656. }
  657. },
  658. //返回列表
  659. returnList() {
  660. window.history.back(-1);
  661. },
  662. //点击切换分页
  663. handleCurrentChange(page) {
  664. if (this.seekInput) {
  665. this.seekBtn(page)
  666. } else {
  667. this.postSearch(page)
  668. }
  669. },
  670. //搜索商品
  671. seekBtn(page) {
  672. this.$http.post("{!!yzWebFullUrl('member.member-level.search-goods')!!}", {
  673. page,
  674. keyword: this.seekInput
  675. }).then(res => {
  676. let {
  677. data: data,
  678. current_page,
  679. per_page,
  680. total
  681. } = res.body.data.goods;
  682. console.log(res);
  683. this.loading = true;
  684. if (res.data.result === 1) {
  685. setTimeout(() => {
  686. this.loading = false;
  687. }, 300)
  688. //总数
  689. this.total = total;
  690. //一页显示的数据
  691. this.pagesize = per_page;
  692. //页码数
  693. this.currentPage = current_page;
  694. //商品列表
  695. this.gridData = data;
  696. }
  697. })
  698. }
  699. }
  700. })
  701. </script>
  702. @endsection