sellerRegulations.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template name="regulations">
  2. <view class="regulations-template">
  3. <view class="regulations-title" @tap.stop="hanldOperationConfim">
  4. <text class="text">售后条款</text>
  5. <view class="freight-right">
  6. <text class="text-l">{{regulaText}}</text>
  7. <text class="iconfont icon-xiayibu"></text>
  8. </view>
  9. </view>
  10. <!--底部选择模态层弹窗组件 -->
  11. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" >
  12. <!-- 遮罩层 -->
  13. <view class="mask"></view>
  14. <view class="layer">
  15. <view class="content">
  16. <view class="freight-ltitle">售后条款</view>
  17. <text class="iconfont icon-iconfontguanbi" @click="freightConfim"></text>
  18. <view class="freight-radio">
  19. <radio-group class="row-group" @change="radioChange">
  20. <label class="row-input" v-for="(item, index) in regulaDatas" :key="index">
  21. <view class="row-text" @click.stop="gotoConten(item.id)">{{item.name.length>10?item.name.substring(0,10)+'...':item.name}}</view>
  22. <radio class="row-radio" :value="item.id" color="#E15616"/>
  23. </label>
  24. </radio-group>
  25. </view>
  26. </view>
  27. <view class="btn">
  28. <view class="button add" @click="freightConfim">确定</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default{
  36. name:'regulations',
  37. props:{
  38. regulaDatas:{
  39. type:Array
  40. }
  41. },
  42. data(){
  43. return{
  44. regulaText:'无条款',
  45. freightMoney:0,
  46. specClass: '',//规格弹窗css类,控制开关动画
  47. clauseId:0
  48. }
  49. },
  50. created() {
  51. },
  52. methods:{
  53. gotoConten(id){
  54. this.$api.navigateTo(`/pages/service/sellconten?clauseId=${id}`)
  55. },
  56. radioChange(e){
  57. this.clauseId = e.target.value;
  58. this.regulaDatas.forEach((item,index)=>{
  59. if(item.id==this.clauseId){
  60. if(item.name.length>10){
  61. this.regulaText = item.name.substr(0,10)+'...'
  62. }else{
  63. this.regulaText = item.name;
  64. }
  65. }
  66. })
  67. },
  68. freightConfim(){//提交完成选择
  69. this.$emit('handleData',this.clauseId)
  70. this.hideSpec()
  71. },
  72. hideSpec() {//关闭弹窗
  73. this.specClass = 'hide';
  74. setTimeout(() => {
  75. this.specClass = 'none';
  76. }, 200);
  77. },
  78. hanldOperationConfim(data){//显示弹窗
  79. this.specClass = 'show';
  80. this.freightMoney = this.hanldFreight
  81. },
  82. showTip(){//显示弹窗
  83. this.$emit('@showregulaAlert');
  84. },
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .regulations-template{
  90. width: 100%;
  91. height: auto;
  92. background: #FFFFFF;
  93. float: left;
  94. margin-top: 24rpx;
  95. .regulations-title{
  96. width: 702rpx;
  97. padding: 0 24rpx;
  98. height: 88rpx;
  99. line-height: 88rpx;
  100. font-size: $font-size-28;
  101. color: $text-color;
  102. background: #FFFFFF;
  103. float: left;
  104. font-weight: bold;
  105. border-bottom: 1rpx solid #EBEBEB;
  106. .freight-left{
  107. float: left;
  108. .icon-yunfeishuoming{
  109. height: 100%;
  110. padding:15rpx;
  111. color: $color-system;
  112. font-weight: normal;
  113. }
  114. }
  115. .Tk{
  116. float: right;
  117. margin-right: 38rpx;
  118. font-size: $font-size-28;
  119. color: #666666;
  120. }
  121. .freight-right{
  122. float: right;
  123. color: #2A81FF;
  124. .text-l{
  125. margin-right: 20rpx;
  126. }
  127. .text{
  128. line-height: 88rpx;
  129. color: #ff0000;
  130. margin:0 20rpx;
  131. font-weight: normal;
  132. }
  133. .icon-xiayibu{
  134. line-height: 88rpx;
  135. color: #999999;
  136. font-weight: normal;
  137. }
  138. }
  139. }
  140. }
  141. .freight-ltitle{
  142. width: 100%;
  143. line-height: 60rpx;
  144. height: 60rpx;
  145. font-size: $font-size-34;
  146. color: #333333;
  147. text-align:center;
  148. }
  149. .icon-iconfontguanbi{
  150. position: absolute;
  151. top: 0;
  152. right: 0;
  153. font-size: 34rpx;
  154. color: #b2b2b2
  155. }
  156. .freight-radio{
  157. height: 66rpx;
  158. line-height: 66rpx;
  159. padding: 0 20rpx;
  160. .row-group{
  161. width: 100%;
  162. max-height: 460rpx;
  163. overflow: auto;
  164. }
  165. .row-input{
  166. height: 66rpx;
  167. line-height: 66rpx;
  168. width: 100%;
  169. display: block;
  170. &:nth-of-type(1){
  171. color: #666666;
  172. pointer-events: none;
  173. }
  174. }
  175. .row-radio{
  176. float: right;
  177. transform: scale(0.9);
  178. color: #b2b2b2;
  179. }
  180. .row-text{
  181. font-size: $font-size-28;
  182. color: #1890f9;
  183. float: left;
  184. }
  185. }
  186. .freight-group{
  187. width: 100%;
  188. height: 88rpx;
  189. display: flex;
  190. border-bottom: 1px solid #FFFFFF;
  191. flex-direction: row;
  192. .text{
  193. display: block;
  194. flex: 1;
  195. line-height: 88rpx;
  196. font-size: $font-size-24;
  197. color: #999999;
  198. text-align: left;
  199. padding-left: 10rpx;
  200. }
  201. .group-from{
  202. flex: 1;
  203. height: 40rpx;
  204. padding: 20rpx;
  205. line-height: 40rpx;
  206. align-items: flex-start;
  207. font-size: $font-size-24;
  208. color: $text-color;
  209. background: #F7F7F7;
  210. border-radius: 14rpx;
  211. margin-bottom: 20rpx;
  212. margin-top: 10rpx;
  213. .form-input{
  214. height: 40rpx;
  215. line-height: 40rpx;
  216. flex-grow: 1;
  217. }
  218. }
  219. }
  220. /* 加入购物模态层*/
  221. @keyframes showPopup {
  222. 0% {
  223. opacity: 0;
  224. }
  225. 100% {
  226. opacity: 1;
  227. }
  228. }
  229. @keyframes hidePopup {
  230. 0% {
  231. opacity: 1;
  232. }
  233. 100% {
  234. opacity: 0;
  235. }
  236. }
  237. @keyframes showLayer {
  238. 0% {
  239. transform: translateY(0);
  240. }
  241. 100% {
  242. transform: translateY(-100%);
  243. }
  244. }
  245. @keyframes hideLayer {
  246. 0% {
  247. transform: translateY(-100%);
  248. }
  249. 100% {
  250. transform: translateY(0);
  251. }
  252. }
  253. @keyframes showAmnation {
  254. 0% {
  255. top: -12rpx;
  256. opacity: 0;
  257. }
  258. 50% {
  259. top: -60rpx;
  260. opacity: 1;
  261. }
  262. 100% {
  263. top: -100rpx;
  264. opacity: 0;
  265. }
  266. }
  267. @keyframes hideAmnation {
  268. 0% {
  269. top: -100rpx;
  270. opacity: 0;
  271. }
  272. 100% {
  273. top: -12rpx;
  274. opacity: 0;
  275. }
  276. }
  277. .popup {
  278. position: fixed;
  279. top: 0;
  280. width: 100%;
  281. height: 100%;
  282. z-index: 999;
  283. display: none;
  284. .mask{
  285. position: fixed;
  286. top: 0;
  287. width: 100%;
  288. height: 100%;
  289. z-index: 21;
  290. background-color: rgba(0, 0, 0, 0.6);
  291. }
  292. .layer {
  293. position: fixed;
  294. z-index: 22;
  295. bottom: -710rpx;
  296. width: 702rpx;
  297. padding: 24rpx 24rpx 36rpx 24rpx;
  298. height: 670rpx;
  299. border-radius: 20rpx 20rpx 0 0;
  300. background-color: #fff;
  301. display: flex;
  302. flex-wrap: wrap;
  303. align-content: space-between;
  304. .content {
  305. width: 100%;
  306. position: relative;
  307. }
  308. .btn {
  309. width: 100%;
  310. height: 88rpx;
  311. display: flex;
  312. .button {
  313. width: 702rpx;
  314. height: 88rpx;
  315. color: #fff;
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. font-size: $font-size-28;
  320. border-radius: 14rpx;
  321. background: $btn-confirm;
  322. }
  323. }
  324. }
  325. &.show {
  326. display: block;
  327. .mask{
  328. animation: showPopup 0.2s linear both;
  329. }
  330. .layer {
  331. animation: showLayer 0.2s linear both;
  332. }
  333. }
  334. &.hide {
  335. display: block;
  336. .mask{
  337. animation: hidePopup 0.2s linear both;
  338. }
  339. .layer {
  340. animation: hideLayer 0.2s linear both;
  341. }
  342. }
  343. &.none {
  344. display: none;
  345. }
  346. &.service {
  347. .row {
  348. margin: 30upx 0;
  349. .title {
  350. font-size: 30upx;
  351. margin: 10upx 0;
  352. }
  353. .description {
  354. font-size: 28upx;
  355. color: #999;
  356. }
  357. }
  358. }
  359. .layer-smimg{
  360. width: 114rpx;
  361. height: 114rpx;
  362. float: left;
  363. border-radius: 10rpx;
  364. margin-right: 24rpx;
  365. image{
  366. width: 114rpx;
  367. height: 114rpx;
  368. border-radius: 10rpx;
  369. }
  370. }
  371. .layer-nunbox{
  372. justify-content: space-between;
  373. align-items: center;
  374. width: 536rpx;
  375. height: 88rpx;
  376. padding: 13rpx 0 0 0;
  377. float: left;
  378. .layer-nunbox-t{
  379. width: 100%;
  380. height:44rpx;
  381. position:relative;
  382. display: flex;
  383. .layer-nunbox-text{
  384. line-height: 44rpx;
  385. font-size: $font-size-28;
  386. }
  387. .number-box{
  388. display: flex;
  389. justify-content: center;
  390. align-items: center;
  391. .iconfont{
  392. font-size: $font-size-32;
  393. padding:0 20rpx;
  394. font-size: $text-color;
  395. }
  396. .btn-input{
  397. width: 62rpx;
  398. height: 48rpx;
  399. line-height: 48rpx;
  400. background: #F8F8F8;
  401. border-radius: 4rpx;
  402. text-align: center;
  403. font-size: $font-size-28;
  404. }
  405. }
  406. .product-step{
  407. position: absolute;
  408. left: 45rpx;
  409. bottom: 0;
  410. height: 44rpx;
  411. background: #FFFFFF;
  412. }
  413. }
  414. .layer-nunbox-b{
  415. width: 100%;
  416. height:44rpx;
  417. margin-top: 13rpx;
  418. }
  419. .text{
  420. line-height: 44rpx;
  421. font-size: $font-size-28;
  422. .p{
  423. color: #FF2A2A;
  424. }
  425. .p:first-child{
  426. margin-left: 30rpx;
  427. }
  428. .p.sm{
  429. font-size: $font-size-24;
  430. }
  431. }
  432. }
  433. }
  434. </style>