goods-attr-info.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. <template>
  2. <app-layout>
  3. <view class="group main-center cross-center">
  4. <view @click="choose(item,index)" v-for="(item,index) in attr_groups" :key="index" class="box-grow-1 group-item main-center cross-center">
  5. <view :class="['group-name', 't-omit', `${item.choose? 'active':''}`]">{{item.choose ? item.choose_attr : item.attr_group_name}}</view>
  6. <image v-if="showGroup && groupIndex == index" class="more" :src="item.choose ? './../image/close.png' :'/static/image/icon/icon-up.png'"></image>
  7. <image class="more" v-else :src="item.choose ? './../image/open.png' :'/static/image/icon/icon-down.png'"></image>
  8. </view>
  9. </view>
  10. <view class="attr-group-holder"></view>
  11. <view>
  12. <view class="attr-item" v-if="item.show == listLength" v-for="(item,index) in attr" :key="index">
  13. <view class="attr-name" v-if="startIndex < item.showIndex && item.showIndex < endIndex">
  14. <view class="check" @click="unSelect(item,index)">
  15. <image src="/static/image/icon/icon-uncheck.png" v-if="!item.select"></image>
  16. <image src="./../image/active.png" v-else></image>
  17. </view>
  18. <view class="dir-left-wrap cross-center">
  19. <view class="attr-group" v-for="(attr,idx) in item.attr_list" :key="idx">
  20. <text class="attr-group-name">{{attr.attr_group_name}}:</text>
  21. <text>{{attr.attr_name}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. <view v-if="startIndex < item.showIndex && item.showIndex < endIndex" style="background-color: #fff">
  26. <view class='info-item cross-center dir-left-nowrap'>
  27. <view class="form-label">售价</view>
  28. <view class='dir-left-nowrap price-input cross-center main-between'>
  29. <input :value="item.price" :focus="inputName && chooseIndex == item.id" @blur="nameBlur(item.id,$event)" v-if="inputName && chooseIndex == item.id" placeholder-style="color: #cdcdcd" placeholder="请输入售价" type='digit' class='input'></input>
  30. <view v-else :class="item.price ? 'input input-item' : 'input input-item placeholder'" @click="nameBlur(item.id)">{{item.price ? item.price :'请输入售价'}}</view>
  31. <view>元</view>
  32. </view>
  33. </view>
  34. <view class='info-item cross-center dir-left-nowrap'>
  35. <view class="form-label">库存</view>
  36. <view class='dir-left-nowrap price-input cross-center main-between'>
  37. <input :focus="inputStock && chooseIndex == item.id" @blur="stockBlur(item.id,$event)" v-if="inputStock && chooseIndex == item.id" placeholder-style="color: #cdcdcd" placeholder="请输入库存" type='number' class='input unit' :value="item.stock"></input>
  38. <view v-else :class="item.stock ? 'input unit input-item' : 'input unit input-item placeholder'" @click="stockBlur(item.id)">{{item.stock ? item.stock :'请输入库存'}}</view>
  39. <view class="unit-width">{{unit}}</view>
  40. </view>
  41. </view>
  42. <view class='info-item cross-center dir-left-nowrap'>
  43. <view class="form-label">货号</view>
  44. <view class='dir-left-nowrap price-input cross-center'>
  45. <input :focus="inputNo && chooseIndex == item.id" @blur="noBlur(item.id,$event)" v-if="inputNo && chooseIndex == item.id" placeholder-style="color: #cdcdcd" placeholder="请输入货号" class='input' :value="item.no"></input>
  46. <view v-else :class="item.no ? 'input input-item' : 'input input-item placeholder'" @click="noBlur(item.id)">{{item.no ? item.no :'请输入货号'}}</view>
  47. </view>
  48. </view>
  49. <view class='info-item cross-center dir-left-nowrap'>
  50. <view class="form-label">重量</view>
  51. <view class='dir-left-nowrap cross-center price-input'>
  52. <input :focus="inputWeight && chooseIndex == item.id" @blur="weightBlur(item.id,$event)" v-if="inputWeight && chooseIndex == item.id" placeholder-style="color: #cdcdcd" placeholder="请输入重量" type='digit' class='input' :value="item.weight"></input>
  53. <view v-else :class="item.weight ? 'input input-item' : 'input input-item placeholder'" @click="weightBlur(item.id)">{{item.weight ? item.weight :'请输入重量'}}</view>
  54. <view>g</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view :class="['placeholder', `${iphone_x? 'iphone_x':''}`]"></view>
  61. <view :class="['bottom', 'cross-center', 'dir-left-nowrap', `${iphone_x? 'iphone_x':''}`]">
  62. <view @click="allSelect" class="check">
  63. <image src="/static/image/icon/icon-uncheck.png" v-if="!selectStatus"></image>
  64. <image src="./../image/active.png" v-else></image>
  65. </view>
  66. <view>全选</view>
  67. <view @click="allSetting" class="all-setting">批量设置</view>
  68. <view @click="save" :class="['save-btn', `${iphone_x? 'iphone_x':''}`]">保存</view>
  69. </view>
  70. <view @touchmove.stop.prevent="" :class="['bg', `${showSetting? 'again':''}`]" v-if="showGroup || showSetting">
  71. <view class="dialog-group" v-if="showGroup">
  72. <view @click="confirm(-1)" class="dialog-group-name t-omit">{{ '全部' + chooseGroup.attr_group_name}}</view>
  73. <view @click="confirm(index,item)" v-for="(item,index) in chooseGroup.attr_list" :key="item.attr_id" :class="['dialog-group-name', 't-omit', `${item.choose? 'active':''}`]">{{item.attr_name}}</view>
  74. </view>
  75. <view :class="['dialog-setting', `${iphone_x? 'iphone_x':''}`]" v-if="showSetting">
  76. <view class="dialog-setting-title main-between cross-center">
  77. <view @click="close" class="dialog-setting-btn">取消</view>
  78. <view>批量设置</view>
  79. <view @click="settingSubmit" class="dialog-setting-btn">确定</view>
  80. </view>
  81. <view style="background-color: #fff">
  82. <view class='info-item cross-center dir-left-nowrap'>
  83. <view class="form-label">售价</view>
  84. <view class='dir-left-nowrap price-input cross-center main-between'>
  85. <input @input="settingValue($event,'price')" placeholder-style="color: #cdcdcd" placeholder="请输入售价" type='digit' class='input'></input>
  86. <view>元</view>
  87. </view>
  88. </view>
  89. <view class='info-item cross-center dir-left-nowrap'>
  90. <view class="form-label">库存</view>
  91. <view class='dir-left-nowrap price-input cross-center main-between'>
  92. <input @input="settingValue($event,'stock')" placeholder-style="color: #cdcdcd" placeholder="请输入库存" type='number' class='input unit'></input>
  93. <view class="unit-width">{{unit}}</view>
  94. </view>
  95. </view>
  96. <view class='info-item cross-center dir-left-nowrap'>
  97. <view class="form-label">货号</view>
  98. <view class='dir-left-nowrap price-input cross-center'>
  99. <input @input="settingValue($event,'no')" placeholder-style="color: #cdcdcd" placeholder="请输入货号" class='input'></input>
  100. </view>
  101. </view>
  102. <view class='info-item cross-center dir-left-nowrap'>
  103. <view class="form-label">重量</view>
  104. <view class='dir-left-nowrap cross-center price-input'>
  105. <input @input="settingValue($event,'weight')" placeholder-style="color: #cdcdcd" placeholder="请输入重量" type='number' class='input'></input>
  106. <view>g</view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </app-layout>
  113. </template>
  114. <script>
  115. import { mapState } from "vuex";
  116. export default {
  117. data() {
  118. return {
  119. iphone_x: false,
  120. attr_groups: [],
  121. attr_list: [],
  122. unit: '件',
  123. attr: [],
  124. select: false,
  125. chooseAttr: {},
  126. chooseGroup: {},
  127. chooseList: [],
  128. selectList: [],
  129. selectStatus: false,
  130. chooseIndex: -1,
  131. listLength: 0,
  132. showGroup: false,
  133. showSetting: false,
  134. inputName: false,
  135. inputStock: false,
  136. inputNo: false,
  137. inputWeight: false,
  138. startIndex: -10,
  139. endIndex: 90,
  140. setting: {
  141. price: '',
  142. stock: '',
  143. no: '',
  144. weight: '',
  145. },
  146. groupIndex: -1,
  147. }
  148. },
  149. computed: {
  150. ...mapState({
  151. theme: state => state.mallConfig.theme,
  152. })
  153. },
  154. methods: {
  155. settingValue(e,name) {
  156. if(name == 'price') {
  157. this.setting.price = e.detail.value
  158. }else if(name == 'stock') {
  159. this.setting.stock = e.detail.value
  160. }else if(name == 'no') {
  161. this.setting.no = e.detail.value
  162. }else if(name == 'weight') {
  163. this.setting.weight = e.detail.value
  164. }
  165. },
  166. nameBlur(id,e) {
  167. if(!e) {
  168. this.inputName = true;
  169. this.inputStock = false;
  170. this.inputNo = false;
  171. this.inputWeight = false;
  172. this.chooseIndex = id;
  173. }else {
  174. this.inputName = false;
  175. this.attr[id].price = this.money(e.detail.value)
  176. }
  177. },
  178. stockBlur(id,e) {
  179. if(!e) {
  180. this.inputStock = true;
  181. this.inputName = false;
  182. this.inputNo = false;
  183. this.inputWeight = false;
  184. this.chooseIndex = id;
  185. }else {
  186. this.inputStock = false;
  187. this.attr[id].stock = e.detail.value
  188. }
  189. },
  190. noBlur(id,e) {
  191. if(!e) {
  192. this.inputNo = true;
  193. this.inputName = false;
  194. this.inputStock = false;
  195. this.inputWeight = false;
  196. this.chooseIndex = id;
  197. }else {
  198. this.inputNo = false;
  199. this.attr[id].no = e.detail.value
  200. }
  201. },
  202. weightBlur(id,e) {
  203. if(!e) {
  204. this.inputWeight = true;
  205. this.inputName = false;
  206. this.inputStock = false;
  207. this.inputNo = false;
  208. this.chooseIndex = id;
  209. }else {
  210. this.inputWeight = false;
  211. this.attr[id].weight = e.detail.value
  212. }
  213. },
  214. money(val) {
  215. let num = val.toString(); //先转换成字符串类型
  216. if (num.indexOf('.') == 0) { //第一位就是 .
  217. num = '0' + num
  218. }
  219. num = num.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
  220. num = num.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
  221. num = num.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  222. num = num.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  223. if (num.indexOf(".") < 0 && num != "") {
  224. num = parseFloat(num);
  225. }
  226. return num
  227. },
  228. allSetting() {
  229. let select = false;
  230. for(let i in this.attr) {
  231. if(this.attr[i].select) {
  232. select = true
  233. }
  234. }
  235. if(select) {
  236. this.showSetting = true;
  237. }else {
  238. uni.showToast({
  239. title: '请选择规格',
  240. icon: 'none',
  241. duration: 1000
  242. });
  243. }
  244. },
  245. settingSubmit(e) {
  246. let that = this;
  247. for(let i in that.attr) {
  248. if(that.attr[i].select) {
  249. if(that.setting.price) {
  250. that.attr[i].price = that.money(that.setting.price)
  251. that.$forceUpdate();
  252. }
  253. if(that.setting.stock) {
  254. that.attr[i].stock = that.setting.stock
  255. that.$forceUpdate();
  256. }
  257. if(that.setting.no) {
  258. that.attr[i].no = that.setting.no
  259. that.$forceUpdate();
  260. }
  261. if(that.setting.weight) {
  262. that.attr[i].weight = that.setting.weight
  263. that.$forceUpdate();
  264. }
  265. }
  266. }
  267. that.close();
  268. },
  269. close() {
  270. this.showSetting = false;
  271. this.setting.stock = '';
  272. this.setting.price = '';
  273. this.setting.no = '';
  274. this.setting.weight = '';
  275. },
  276. unSelect(item,index) {
  277. let that = this;
  278. that.attr[index].select = !that.attr[index].select;
  279. let select = true;
  280. for(let i in this.attr) {
  281. if(!this.attr[i].select) {
  282. select = false
  283. }
  284. }
  285. that.selectStatus = select;
  286. that.$forceUpdate();
  287. },
  288. allSelect() {
  289. let that = this;
  290. that.selectStatus = !that.selectStatus;
  291. for(let i in that.attr) {
  292. that.attr[i].select = !that.selectStatus;
  293. if(that.attr[i].show == that.listLength) {
  294. that.attr[i].select = that.selectStatus;
  295. }
  296. }
  297. },
  298. save() {
  299. let that = this;
  300. let pass = true;
  301. for(let i in that.attr) {
  302. if(!that.attr[i].price || !that.attr[i].stock) {
  303. pass = false;
  304. uni.showToast({
  305. title: '请填写规格信息',
  306. icon: 'none',
  307. duration: 1000
  308. });
  309. return false;
  310. }
  311. }
  312. if(pass) {
  313. uni.showLoading({
  314. title: '保存中...'
  315. });
  316. uni.setStorage({
  317. key: "temp_attr_info",
  318. data: that.attr,
  319. success(res) {
  320. uni.hideLoading();
  321. setTimeout(function() {
  322. uni.navigateBack();
  323. }, 500)
  324. },
  325. fail(res) {
  326. uni.hideLoading();
  327. uni.showToast({
  328. title: res.errMsg,
  329. icon: 'none',
  330. duration: 1000
  331. });
  332. }
  333. })
  334. }
  335. },
  336. choose(item,index) {
  337. this.chooseGroup = item;
  338. if(this.groupIndex != index) {
  339. this.showGroup = true;
  340. this.groupIndex = index;
  341. }else {
  342. this.showGroup = !this.showGroup;
  343. }
  344. },
  345. confirm(index,item) {
  346. let that = this;
  347. that.showGroup = false;
  348. for(let i in that.attr_groups[that.groupIndex].attr_list) {
  349. that.attr_groups[that.groupIndex].attr_list[i].choose = false;
  350. }
  351. if(index > -1) {
  352. that.chooseAttr = item;
  353. item.attr_groups_id = that.attr_groups[that.groupIndex].attr_groups_id;
  354. that.attr_groups[that.groupIndex].attr_list[index].choose = true;
  355. that.attr_groups[that.groupIndex].choose = true;
  356. that.attr_groups[that.groupIndex].choose_attr = that.attr_groups[that.groupIndex].attr_list[index].attr_name;
  357. }else {
  358. that.chooseGroup = {};
  359. that.chooseAttr = {};
  360. that.attr_groups[that.groupIndex].choose = false;
  361. that.attr_groups[that.groupIndex].choose_attr = '';
  362. }
  363. that.chooseList = [];
  364. for(let i in that.attr_groups) {
  365. if(that.attr_groups[i].choose) {
  366. for(let j in that.attr_groups[i].attr_list) {
  367. if(that.attr_groups[i].attr_list[j].choose) {
  368. let obj = {
  369. attr_group_id: that.attr_groups[i].attr_group_id,
  370. attr_group_name: that.attr_groups[i].attr_group_name,
  371. attr_id: that.attr_groups[i].attr_list[j].attr_id,
  372. attr_name: that.attr_groups[i].attr_list[j].attr_name,
  373. }
  374. that.chooseList.push(obj)
  375. }
  376. }
  377. }
  378. }
  379. that.listLength = that.chooseList.length;
  380. let select = false;
  381. let showIndex = -1;
  382. for(let x in that.attr) {
  383. that.attr[x].show = 0;
  384. that.attr[x].choose = [];
  385. that.attr[x].showIndex = -200;
  386. if(that.chooseList.length > 0) {
  387. for(let y in that.attr[x].attr_list) {
  388. for(let i in that.chooseList) {
  389. if(that.attr[x].attr_list[y].attr_group_id == that.chooseList[i].attr_group_id && that.attr[x].attr_list[y].attr_id == that.chooseList[i].attr_id) {
  390. that.attr[x].choose.push(that.chooseList[i].attr_name);
  391. console.log(that.attr[x].choose)
  392. that.attr[x].choose = Array.from(new Set(that.attr[x].choose))
  393. that.attr[x].show = that.attr[x].choose.length;
  394. that.attr[x].showIndex = showIndex;
  395. select = true;
  396. that.$forceUpdate();
  397. }
  398. }
  399. }
  400. }else {
  401. that.attr[x].showIndex = x;
  402. }
  403. }
  404. if(!select) {
  405. for(let x in that.attr) {
  406. that.attr[x].choose = [];
  407. that.attr[x].show = that.attr[x].choose.length;
  408. }
  409. }else {
  410. for(let x in that.attr) {
  411. if(that.attr[x].show == that.listLength) {
  412. showIndex++;
  413. that.attr[x].showIndex = showIndex;
  414. }
  415. }
  416. }
  417. that.startIndex = -10;
  418. that.endIndex = 90;
  419. uni.pageScrollTo({
  420. scrollTop: 0,
  421. duration: 300
  422. });
  423. },
  424. saveData(obj1,obj2,obj3,obj4,obj5) {
  425. let that = this;
  426. let obj = {};
  427. obj.attr_list = []
  428. obj.stock = '';
  429. obj.price = '';
  430. obj.no = '';
  431. obj.weight = '';
  432. obj.pic_url = '';
  433. obj.shareLevelList = [];
  434. obj.member_price = {};
  435. obj.attr_list.push(obj1)
  436. if(obj2) {
  437. obj.attr_list.push(obj2)
  438. }
  439. if(obj3) {
  440. obj.attr_list.push(obj3)
  441. }
  442. if(obj4) {
  443. obj.attr_list.push(obj4)
  444. }
  445. if(obj5) {
  446. obj.attr_list.push(obj5)
  447. }
  448. that.attr.push(obj)
  449. that.$hideLoading();
  450. },
  451. },
  452. onPageScroll (e) {
  453. let that = this;
  454. console.log(e.scrollTop)
  455. that.startIndex = Math.floor((e.scrollTop-50) / 250) - 150; // 取得可见区域的起始数据索引
  456. that.endIndex = that.startIndex + 300; // 取得可见区域的结束数据索引
  457. },
  458. onLoad(options) {
  459. let that = this;
  460. that.$showLoading({
  461. type: 'global',
  462. text: '加载中...'
  463. });
  464. uni.getStorage({
  465. key: 'goods_unit',
  466. success(res) {
  467. that.unit = res.data;
  468. }
  469. })
  470. uni.getStorage({
  471. key: 'temp_attr_info',
  472. success(res) {
  473. uni.getStorage({
  474. key: 'temp_attr',
  475. success(res) {
  476. that.attr_groups = res.data;
  477. }
  478. })
  479. that.attr_list[0] = [];
  480. that.attr = res.data;
  481. for(let i in that.attr) {
  482. that.attr[i].show = 0;
  483. that.attr[i].choose = [];
  484. that.attr[i].id = i;
  485. that.attr[i].select = false;
  486. that.attr[i].showIndex = i;
  487. }
  488. that.$hideLoading();
  489. },
  490. fail(res) {
  491. uni.getStorage({
  492. key: 'temp_attr',
  493. success(res) {
  494. that.attr_groups = res.data;
  495. that.attr = [];
  496. for(let i = 0;i < that.attr_groups[0].attr_list.length;i++) {
  497. let first = {
  498. attr_group_id: that.attr_groups[0].attr_group_id,
  499. attr_group_name: that.attr_groups[0].attr_group_name,
  500. attr_id: that.attr_groups[0].attr_list[i].attr_id,
  501. attr_name: that.attr_groups[0].attr_list[i].attr_name,
  502. }
  503. if(that.attr_groups.length == 1) {
  504. that.saveData(first);
  505. }else {
  506. for(let j = 0;j < that.attr_groups[1].attr_list.length;j++) {
  507. let second = {
  508. attr_group_id: that.attr_groups[1].attr_group_id,
  509. attr_group_name: that.attr_groups[1].attr_group_name,
  510. attr_id: that.attr_groups[1].attr_list[j].attr_id,
  511. attr_name: that.attr_groups[1].attr_list[j].attr_name,
  512. }
  513. if(that.attr_groups.length == 2) {
  514. that.saveData(first,second);
  515. }else {
  516. for(let x = 0;x < that.attr_groups[2].attr_list.length;x++) {
  517. let third = {
  518. attr_group_id: that.attr_groups[2].attr_group_id,
  519. attr_group_name: that.attr_groups[2].attr_group_name,
  520. attr_id: that.attr_groups[2].attr_list[x].attr_id,
  521. attr_name: that.attr_groups[2].attr_list[x].attr_name,
  522. }
  523. if(that.attr_groups.length == 3) {
  524. that.saveData(first,second,third);
  525. }else {
  526. for(let y = 0;y < that.attr_groups[3].attr_list.length;y++) {
  527. let fourth = {
  528. attr_group_id: that.attr_groups[3].attr_group_id,
  529. attr_group_name: that.attr_groups[3].attr_group_name,
  530. attr_id: that.attr_groups[3].attr_list[y].attr_id,
  531. attr_name: that.attr_groups[3].attr_list[y].attr_name,
  532. }
  533. if(that.attr_groups.length == 4) {
  534. that.saveData(first,second,third,fourth);
  535. that.$hideLoading();
  536. }else {
  537. for(let z = 0;z < that.attr_groups[4].attr_list.length;z++) {
  538. let fifth = {
  539. attr_group_id: that.attr_groups[4].attr_group_id,
  540. attr_group_name: that.attr_groups[4].attr_group_name,
  541. attr_id: that.attr_groups[4].attr_list[z].attr_id,
  542. attr_name: that.attr_groups[4].attr_list[z].attr_name,
  543. }
  544. that.saveData(first,second,third,fourth,fifth);
  545. }
  546. }
  547. }
  548. }
  549. }
  550. }
  551. }
  552. }
  553. }
  554. for(let i in that.attr) {
  555. that.attr[i].show = 0;
  556. that.attr[i].choose = [];
  557. that.attr[i].id = i;
  558. that.attr[i].showIndex = i;
  559. }
  560. }
  561. })
  562. }
  563. })
  564. uni.getSystemInfo({
  565. success: function (res) {
  566. if(res.model.indexOf('iPhone X') > -1 || res.model.indexOf('iPhone 11') > -1 || res.model.indexOf('iPhone11') > -1 || res.model.indexOf('iPhone12') > -1 || res.model.indexOf('Unknown Device') > -1) {
  567. that.iphone_x = true;
  568. }
  569. }
  570. })
  571. }
  572. }
  573. </script>
  574. <style scoped lang="scss">
  575. .checked-icon {
  576. background-color: #446dfd;
  577. }
  578. .attr-group-holder {
  579. height: #{100rpx};
  580. }
  581. .group {
  582. position: fixed;
  583. top: 0;
  584. left: 0;
  585. width: 100%;
  586. height: #{100rpx};
  587. background-color: #fff;
  588. z-index: 100;
  589. .group-item {
  590. height: #{50rpx};
  591. border-left: #{2rpx} solid #e2e2e2;
  592. .group-name {
  593. width: #{86rpx};
  594. font-size: #{28rpx};
  595. color: #353535;
  596. text-align: right;
  597. &.active {
  598. color: #446dfd;
  599. }
  600. }
  601. .more {
  602. display: block;
  603. width: #{22rpx};
  604. height: #{12rpx};
  605. margin-left: #{12rpx};
  606. }
  607. }
  608. .group-item:first-of-type {
  609. border-left: 0;
  610. }
  611. }
  612. .attr-item {
  613. min-height: 445rpx;
  614. .attr-name {
  615. padding: #{24rpx};
  616. padding-left: #{96rpx};
  617. position: relative;
  618. font-size: #{28rpx};
  619. color: #353535;
  620. .check {
  621. width: #{84rpx};
  622. height: #{76rpx};
  623. padding: #{20rpx} #{24rpx};
  624. position: absolute;
  625. top: 0;
  626. left: 0;
  627. image {
  628. width: #{36rpx};
  629. height: #{36rpx};
  630. }
  631. }
  632. .attr-group {
  633. padding-right: #{24rpx};
  634. height: #{30rpx};
  635. line-height: #{26rpx};
  636. border-right: #{2rpx} solid #999999;
  637. margin-right: #{24rpx};
  638. margin-bottom: #{8rpx};
  639. .attr-group-name {
  640. color: #999999;
  641. }
  642. }
  643. .attr-group:last-of-type {
  644. border-right: 0;
  645. }
  646. }
  647. }
  648. .info-item {
  649. border-top: #{1rpx} solid #e2e2e2;
  650. height: #{88rpx};
  651. line-height: #{88rpx};
  652. font-size: #{28rpx};
  653. color: #353535;
  654. margin: 0 24rpx;
  655. .form-label {
  656. width: #{176rpx};
  657. }
  658. .input {
  659. width: #{476rpx};
  660. background-color: #fff;
  661. padding-left: #{25rpx};
  662. font-size: #{28rpx};
  663. &.input-item {
  664. height: #{80rpx};
  665. line-height: #{80rpx};
  666. white-space: nowrap;
  667. overflow: auto;
  668. &.placeholder {
  669. color: #cdcdcd;
  670. }
  671. }
  672. }
  673. .input.unit {
  674. width: #{396rpx};
  675. }
  676. .unit-width {
  677. width: #{112rpx};
  678. text-align: right;
  679. }
  680. }
  681. .info-item:first-of-type {
  682. border-top: 0;
  683. }
  684. .bottom {
  685. position: fixed;
  686. bottom: 0;
  687. left: 0;
  688. width: 100%;
  689. height: #{120rpx};
  690. background-color: #fff;
  691. padding: 0 #{24rpx};
  692. font-size: #{28rpx};
  693. z-index: 10;
  694. color: #353535;
  695. .check {
  696. width: #{84rpx};
  697. height: #{84rpx};
  698. padding: #{24rpx};
  699. image {
  700. width: #{36rpx};
  701. height: #{36rpx};
  702. }
  703. }
  704. .all-setting {
  705. color: #446dfd;
  706. margin-left: #{40rpx};
  707. }
  708. .save-btn {
  709. position: absolute;
  710. right: #{24rpx};
  711. bottom: #{20rpx};
  712. height: #{80rpx};
  713. line-height: #{80rpx};
  714. width: #{280rpx};
  715. text-align: center;
  716. border-radius: #{40rpx};
  717. background-color: #446dfd;
  718. font-size: #{32rpx};
  719. color: #ffffff;
  720. font-weight: bold;
  721. &.iphone_x {
  722. bottom: #{70rpx};
  723. }
  724. }
  725. }
  726. .bottom.iphone_x {
  727. height: #{170rpx};
  728. padding-bottom: #{50rpx};
  729. }
  730. .placeholder {
  731. height: #{140rpx};
  732. }
  733. .placeholder.iphone_x {
  734. height: #{190rpx};
  735. }
  736. .bg {
  737. position: fixed;
  738. left: 0;
  739. top: 0;
  740. width: 100%;
  741. height: 100%;
  742. background-color: rgba(0,0,0,.3);
  743. z-index: 80;
  744. &.again {
  745. z-index: 120;
  746. }
  747. .dialog-group {
  748. position: fixed;
  749. top: 100rpx;
  750. width: 100%;
  751. border-top: #{2rpx} solid #e2e2e2;
  752. background-color: #fff;
  753. padding-left: #{24rpx};
  754. .dialog-group-name {
  755. height: #{88rpx};
  756. line-height: #{88rpx};
  757. font-size: #{28rpx};
  758. color: #353535;
  759. &.active {
  760. color: #446dfd;
  761. }
  762. }
  763. }
  764. .dialog-setting {
  765. position: fixed;
  766. bottom: 0;
  767. left: 0;
  768. width: 100%;
  769. z-index: 122;
  770. &.iphone_x {
  771. padding-bottom: #{50rpx};
  772. }
  773. .dialog-setting-title {
  774. border-top-left-radius: #{16rpx};
  775. border-top-right-radius: #{16rpx};
  776. background-color: #f7f7f7;
  777. height: #{88rpx};
  778. font-size: #{32rpx};
  779. color: #353535;
  780. padding: 0 #{24rpx};
  781. .dialog-setting-btn {
  782. color: #446dfd;
  783. }
  784. }
  785. }
  786. }
  787. </style>